Image input
Send images to the model together with text.
Put an image_url part next to the text in a message's content array. The URL is either a public https:// link or a base64 data: URL holding the file itself.
curl https://api.sara-ai.kz/v1/chat/completions \
-H "Authorization: Bearer $SARA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemma-4-31b",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What does this image say?"},
{"type": "image_url", "image_url": {"url": "https://sara-ai.kz/en/opengraph-image"}}
]
}]
}'Which models accept images
gemma-4-31baccepts images.glm-5.2-744bis text-only. A request that sends it an image returns 404.
Good to know
- PNG and JPEG are supported.
- A message can carry several images: add one
image_urlpart per image. - An image is billed as input tokens: about 260–280 per image, whatever its dimensions.
- Images work with streaming, thinking and structured outputs.
- A request can be up to 32 MB. A base64 image is about a third larger than the file it encodes.
/v1/messagesand/v1/responsesaccept images too, each in its own format.