API
Images as input
Send images to vision models as URLs or base64 data URLs, in OpenAI or Anthropic format. Routing picks only models that accept images.
Add an image part to a user message. The gateway is text-in, text-out: models can read images, but it doesn't generate images, audio or video.
reply = client.chat.completions.create(
model="auto",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What's in this picture?"},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}},
],
}],
)URL or data URL
- A URL must be one the provider can fetch.
- A data URL, such as
data:image/png;base64,iVBOR…, works everywhere and is the safe choice. AWS Bedrock accepts only data URLs, in PNG, JPEG, GIF or WebP.
Both are converted when the request is translated: a data URL becomes Anthropic's base64 source, a URL becomes its URL source, and the reverse on /v1/messages.
Which models are used
A request with an image only goes to offers that support vision. If you name a model that can't read images, you get 400 capability_mismatch. On the models page, filter by Vision.
Size and guardrails
The whole request body can be up to 20 MB. Larger requests get 413. If your organisation's guardrails limit file types or sizes, an image that breaks the rule is blocked or replaced with the text [file removed], depending on the rule's action.
Checked against the gateway on 31 October 2026. Something wrong or missing? Tell us.