Without an applied server prompt POST /v1/messages, images are passed in an image block. Base64 is the most reliable option because the file is already inside the request and does not depend on an external host.
{
"model": "claude-opus-5",
"max_tokens": 1024,
"messages": [{
"role": "user",
"content": [
{"type": "image", "source": {
"type": "base64", "media_type": "image/jpeg", "data": "<BASE64>"
}},
{"type": "text", "text": "What's in the image?"}
]
}]
}{"type": "image", "source": {"type": "url", "url": "https://example.com/photo.jpg"}}- Formats: JPEG, PNG, GIF, WebP.
- Anthropic limits each image to 10 MB of base64-encoded data and 8000×8000 px. With more than 20 images, resize each side to 2000 px or less to stay within the stricter many-image limit.
- One API request allows up to 100 images with a 200k context window and up to 600 with a 1M context window; request size and token limits may stop processing sooner.
- GIF animation is not played — Claude analyzes only the first frame.
- The URL must be a direct public
https://resource with no authentication, cookies, login page, or anti-bot challenge. - The server must consistently return the correct image MIME (
image/jpeg,image/png,image/gif, orimage/webp). - Guard does not download the URL itself: the address is passed through in the Claude Messages request without a server prompt for remote retrieval.
- Anthropic's official
count_tokensmay reject a URL source even when Messages accepts the same file. For/v1/messages, Guard skips that internal count preflight and uses a safe full-context reserve; send the image as base64 when you need a preliminary exact count. - Redirects, CDN protection, hotlink protection, and temporary signed URLs may fail. Availability from an arbitrary external host is not guaranteed.
- If a URL is rejected, download the file yourself and send base64.
- Multiple images are allowed while the whole request remains under the limit.
- Images count as input tokens (depends on resolution) — see Billing.
Fresh native metadata advertises text and image input modalities for GPT-6 Sol and GPT-6 Luna. Use images only in the supported shape of the selected API; image metadata does not create a /v1/files alias.
| Family | Image input |
|---|---|
| Kimi | image_url, input_image and image blocks are accepted and passed to the model as they are; video blocks behave the same way |
| Composer | no: 400 cursor_image_input_unavailable before any charge |
| Grok 4.6 | yes: inline base64, up to 16 images per request, image/png, image/jpeg, image/webp, image/gif |
| Grok 4.7 | no: 400 cursor_image_input_unavailable before any charge |
{
"model": "cursor-grok-4.6-high",
"max_tokens": 512,
"messages": [{
"role": "user",
"content": [
{"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": "iVBORw0…"}},
{"type": "text", "text": "What is in the picture?"}
]
}]
}Image input is confirmed only for glm-5.3-flash. Send PNG as base64/data URL in the native shape for the selected API.
| API | Content block |
|---|---|
| Chat | image_url.image_url.url = data:image/png;base64,… |
| Messages | image.source = {type: base64, media_type: image/png, data: …} |
| Responses | input_image.image_url = data:image/png;base64,… |
Chat Completions:
{
"model": "glm-5.3-flash",
"max_tokens": 4096,
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Describe the image"},
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<base64>"}}
]}]
}Messages:
{
"model": "glm-5.3-flash",
"max_tokens": 4096,
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Describe the image"},
{"type": "image", "source": {
"type": "base64", "media_type": "image/png", "data": "<base64>"
}}
]}]
}Responses:
{
"model": "glm-5.3-flash",
"max_output_tokens": 4096,
"store": false,
"input": [{"role": "user", "content": [
{"type": "input_text", "text": "Describe the image"},
{"type": "input_image", "image_url": "data:image/png;base64,<base64>"}
]}]
}Gemini accepts images as embedded base64 data or as an https link: Google downloads the linked file itself. Send the image in the native form of the selected API.
| API | Image block |
|---|---|
| Messages | image with source.type: "base64", or source.type: "url" with an https address in url |
| Chat Completions | image_url with an address of the form data:image/png;base64,… or an https address; detail only auto |
| Responses | input_image with image_url: a data address or an https address |
Chat Completions:
{
"model": "gemini-4-argon",
"max_tokens": 4096,
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Describe the image"},
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<base64>"}}
]}]
}Messages:
{
"model": "gemini-4-argon",
"max_tokens": 4096,
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Describe the image"},
{"type": "image", "source": {
"type": "base64", "media_type": "image/png", "data": "<base64>"
}}
]}]
}Responses:
{
"model": "gemini-4-argon",
"max_output_tokens": 4096,
"input": [{"role": "user", "content": [
{"type": "input_text", "text": "Describe the image"},
{"type": "input_image", "image_url": "data:image/png;base64,<base64>"}
]}]
}A link instead of data, Messages:
{
"type": "image",
"source": {"type": "url", "url": "https://example.com/picture.png"}
}Muse accepts images as embedded base64 data: in Chat Completions and Responses it is a data address of the form data:image/png;base64,….
| API | Image block |
|---|---|
| Messages | image |
| Chat Completions | image_url |
| Responses | input_image |