Skip to navigation

Images

Send images to vision-capable models by URL or base64

Send images with your prompt to have a model describe, compare, or extract from them. Use image_url for a URL or data: URI, or image for raw base64; Gateway converts either to the served vendor’s format.

curl https://api-gateway.merge.dev/v1/responses \
-H "Authorization: Bearer $MERGE_GATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.1",
"input": [{
"type": "message",
"role": "user",
"content": [
{"type": "text", "text": "Compare these two product shots."},
{"type": "image_url", "url": "https://example.com/before.jpg"},
{"type": "image_url", "url": "https://example.com/after.jpg"}
]
}]
}'

With the OpenAI SDK at /v1/openai, send the standard {"type": "image_url", "image_url": {"url": "..."}} part, or input_image on Responses. AI SDK file parts take data as bytes, base64, a data: URI, or a URL.

AI SDK file parts need merge-gateway-ai-sdk-provider 0.3.0 or later; earlier versions drop them silently.

Reference

FieldNotes
image_url.urlAn https:// URL or a data: URI
image.source_typebase64 (default) or url
image.media_typeRequired, even for a URL, such as image/png
image.dataBase64 string, or the URL when source_type is url

Inline images are capped at 20 MB decoded per request, all images combined; URLs don’t count. Over the cap returns 413 payload_too_large, and a route without image input returns 400 unsupported_params.

Next steps