← Blog

Claude API Image Input: Multimodal Support Guide

2026-11-12 · 5 min read · SubToAPI Team

Does the Claude API support image input?

Yes. Claude's API supports multimodal input, meaning you can send images alongside text in the same request and get back a text response that reasons about what's in the image. This works through the standard /v1/messages endpoint — there's no separate "vision endpoint." You just add an image content block to your message array next to your text block, and Claude's current models (the ones with vision capability) will process both together.

This is useful for a wide range of real products: reading screenshots for bug reports, extracting data from scanned invoices or receipts, describing product photos for e-commerce listings, analyzing charts and diagrams, transcribing handwritten notes, or building accessibility tools that describe images for visually impaired users. The rest of this article covers exactly how the request format works, what limits apply, and common mistakes to avoid.

How image input works in the Claude API

Instead of sending a plain string as the content of a user message, you send an array of content blocks. One block has type: "text", another has type: "image". Claude reads them together as a single turn.

An image block needs a source object with three fields:

Here's a minimal example using the direct Claude API format:

{
  "model": "claude-sonnet-4",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "image",
          "source": {
            "type": "base64",
            "media_type": "image/jpeg",
            "data": "/9j/4AAQSkZJRgABAQEA..."
          }
        },
        {
          "type": "text",
          "text": "What's wrong with this chart? Be specific."
        }
      ]
    }
  ]
}

A few practical rules:

Sending images with curl

A common pattern is reading a local file, base64-encoding it, and inlining it into the JSON payload:

IMAGE_B64=$(base64 -i screenshot.png | tr -d '\n')

curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-4",
    "max_tokens": 1024,
    "messages": [{
      "role": "user",
      "content": [
        {"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": "'"$IMAGE_B64"'"}},
        {"type": "text", "text": "Extract the total and date from this receipt."}
      ]
    }]
  }'

If you're routing requests through SubToAPI instead of calling Anthropic directly, the message format is identical — SubToAPI passes through the same /v1/messages structure, so your image content blocks work without modification:

curl https://api.subtoapi.app/v1/messages \
  -H "Authorization: Bearer $SUBTOAPI_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-4",
    "max_tokens": 1024,
    "messages": [{
      "role": "user",
      "content": [
        {"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": "'"$IMAGE_B64"'"}},
        {"type": "text", "text": "Extract the total and date from this receipt."}
      ]
    }]
  }'

This matters if your team already has API keys managed through a dashboard and wants usage metadata per request without re-architecting the integration — see /docs/messages for the full request reference.

Limits and practical constraints

Keep these in mind before building image features:

Building a practical image-analysis feature

A typical pattern for a web app:

  1. User uploads an image client-side.
  2. Your backend converts it to base64 (or receives it already base64-encoded from the browser's FileReader).
  3. Your backend sends the request to Claude with a task-specific prompt — "describe this," "extract these five fields," "flag anything that looks like a safety issue."
  4. You parse the text response, optionally asking Claude to return structured JSON for easier downstream handling.
async function analyzeImage(base64Data, mimeType, question) {
  const response = await fetch("https://api.subtoapi.app/v1/messages", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
      "content-type": "application/json",
    },
    body: JSON.stringify({
      model: "claude-sonnet-4",
      max_tokens: 1024,
      messages: [{
        role: "user",
        content: [
          { type: "image", source: { type: "base64", media_type: mimeType, data: base64Data } },
          { type: "text", text: question },
        ],
      }],
    }),
  });
  return response.json();
}

If you need this analysis to trigger follow-up actions — like filing a ticket when a screenshot shows an error, or looking up a product SKU from a photo — pair image input with tool use. Claude can look at an image and decide to call a function based on what it sees; see /docs/tools for how that combination works, and /docs/quickstart if you're setting up API access for the first time.

For teams evaluating whether to route image-analysis traffic through a managed gateway, SubToAPI's plans (Solo, Team, Scale — see /pricing) include the same streaming and usage metadata for multimodal requests as text-only ones, so switching doesn't require separate billing logic for vision features. You can test the full flow during the free trial at /signup.

questions

Can I send an image by URL instead of base64? The core Claude API expects base64-encoded image data in the source.data field. If you only have a URL, fetch the image server-side, base64-encode it, and include it in the request — don't send the raw URL as the data value.

Does image input cost more than text-only requests? Images consume tokens based on their resolution after internal resizing, so a request with an image typically uses more input tokens than text alone. Resize large images before sending to control cost.

Can Claude read text inside an image, like a screenshot or scanned document? Yes, Claude can read and transcribe text visible in images, including UI screenshots, handwritten notes, and scanned documents, as part of its vision capability — just ask for the specific text or fields you need extracted.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →