Microsoft Foundry in Practice

Processing Images with Claude on Foundry

Invoices, dashboards, whiteboard photos, scanned forms — Claude can read them all. Microsoft documents image support for Claude on Foundry across both hosting versions; here is how to send images and what limits apply.

Claude 3P 101 · Updated July 2026 · Unofficial guide

Vision — the ability to include images alongside text in a request — is part of Claude's core Messages API, and Microsoft lists image support among the capabilities documented for both Foundry hosting versions ("Hosted on Azure" and "Hosted on Anthropic infrastructure"). Since Foundry exposes the standard Claude API at https://<resource>.services.ai.azure.com/anthropic/v1/messages, image requests look exactly like they do on the first-party API: an image content block inside a user message, sitting next to your text.

The encoding pattern

The most portable pattern is base64: read the image bytes, encode them, and embed them in the content block with the correct media type. Base64 is a way of representing binary data as plain text so it can travel inside a JSON request body.

import base64
from anthropic import AnthropicFoundry

client = AnthropicFoundry(api_key="...", resource="example-resource")
with open("invoice.png", "rb") as f:
    data = base64.standard_b64encode(f.read()).decode()

msg = client.messages.create(
    model="claude-sonnet-5",  # your deployment name
    max_tokens=1024,
    messages=[{"role": "user", "content": [
        {"type": "image", "source": {"type": "base64",
         "media_type": "image/png", "data": data}},
        {"type": "text", "text": "Extract vendor, date, and total."},
    ]}],
)
print(msg.content[0].text)

Set media_type to match the actual file format; check the official Claude documentation for the current list of accepted image formats. A common failure mode is mislabeling the media type (for example, a JPEG declared as PNG), which produces a request error rather than a silent fix.

Limits worth knowing

PDF is a separate feature. Sending whole PDF documents (PDF input) is generally available on Foundry, while image support is documented as a core capability.

Foundry-specific considerations

Two things differ from the first-party API. First, the model parameter is your deployment name (which defaults to the bare model ID like claude-sonnet-5 but may have been customized at deployment time). Second, data handling depends on your hosting choice: for "Hosted on Azure" deployments, Microsoft states that prompts and outputs — including your images — are processed on Azure infrastructure, with data at rest staying in the selected Azure geography; "Hosted on Anthropic infrastructure" deployments may process data outside Azure. For workloads involving sensitive documents, this hosting-version distinction is often the deciding factor, and you should confirm specifics against your provider's current documentation.

Also note that Claude vision reads and reasons about images; it does not return images. For document pipelines, the usual pattern is image in, structured JSON out — combine this article with schema-shaped output techniques.

Cost and throughput planning for image workloads

Budget image pipelines the same way you budget text: everything is input tokens at the model's standard rate, billed on Foundry in Claude Consumption Units through Azure Marketplace. Two planning levers matter most. First, model choice — an extraction task that Haiku 4.5 handles at $1 per million input tokens does not need Opus 4.8 at $5; run a sample set through both and compare accuracy before defaulting to the bigger model. Second, prompt caching — the images themselves change per request, but a long, stable system prompt describing your extraction rules is exactly the kind of prefix worth caching, and cache reads do not count against your ITPM rate limit.

Where to go next

Pair vision with structured JSON output on Foundry for extraction pipelines, and see vision for documents for platform-neutral patterns. If you are just getting set up, start at your first API call on Foundry.

Sources