Image input
Send images for models to read, describe, or analyze.
Vision-capable models accept images alongside text. Check the model catalog or look for image in architecture.input_modalities from GET /v1/models. To create an image, use Image generation.
Send an image
Use a public https:// URL or base64 data. Set the message's content to an array containing both text and image blocks.
{
"model": "openai/gpt-6.1-sol",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "What is in this photo?" },
{ "type": "image_url", "image_url": { "url": "https://example.com/photo.jpg" } }
]
}
]
}Use the following formats for base64 images.
| Endpoint | Base64 image |
|---|---|
| Chat Completions | "image_url": { "url": "data:image/png;base64,..." } |
| Responses | "image_url": "data:image/png;base64,..." |
| Anthropic Messages | "source": { "type": "base64", "media_type": "image/png", "data": "..." } |
Anthropic Messages accepts base64 images in PNG, JPEG, GIF, or WebP.
Limitations
- Request bodies are limited to 4 MiB. Base64 encoding increases image size by about one third, so use URLs for large images.
- Responses and Anthropic Messages accept text and image inputs. Other input types, such as PDF and audio, return
400. - Send images in a regular
usermessage. Anthropic Messages rejects images insidetool_result. - Images are billed as input tokens. The model determines the token count based on image dimensions.