Skip to main content

Images

Attach an image to a user message and the model reads it alongside the text. Each API has its own content-part spelling: image_url parts on Chat Completions, input_image on Responses, image blocks on Messages.

Works with​

Image parts are accepted on every chat model. The catalog does not yet flag which models have vision; if the underlying model can't process images, the upstream provider's error is relayed back to you. The Claude, GPT, Gemini, and Grok families read images today, and so does mindshub_blaze (Qwen 3.8 27B on Cerebras). The per-model column is on the capability matrix.

mindshub_blaze accepts the same image shapes as every other model, but its provider does not. Cerebras takes images only as base64 PNG or JPEG data URLs and rejects remote URLs and detail. So on this alias the gateway does that work for you: a public http(s) URL is downloaded server-side (up to 6 MiB per image), any other raster type (GIF, WebP, …) is transcoded to PNG, and detail is dropped before the request goes upstream. Your request shape does not change by model. What you can hit: an image URL that can't be fetched, is over the size cap, or isn't a decodable image returns a 400 naming that URL, as does one whose host resolves to a private or internal address or that redirects to one; Cerebras itself caps a request at 10 images (paid tiers) and 10 MiB total.

Request​

response = client.chat.completions.create(
model="sonnet",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What's in this image?"},
{"type": "image_url", "image_url": {"url": "https://example.com/chart.png"}},
],
}],
)
print(response.choices[0].message.content)

These samples use sonnet, which reads images and draws the prepaid wallet.

Image sources:

  • A data: URL (data:<media type>;base64,<data>) or a public http(s) URL, which the upstream provider fetches. On Messages, base64 and url sources both work.
  • JPEG, PNG, GIF, and WebP are passed through. Other inline raster formats (data: URLs) are transcoded to PNG server-side; remote URLs are handed to the provider unchanged.
  • A malformed data URL or invalid base64 returns 400.

Response​

Nothing about the response shape changes: the model's description arrives as ordinary text. Image tokens are metered as input tokens.

Per-model differences​

  • Anthropic's Files API references ("source": {"type": "file"}) are unsupported on Messages, and behavior is target-dependent: some providers reject them, others ignore them. Use base64 or url sources.
  • An image inside a tool result (a function_call_output on Responses, a tool_result on Messages, a tool message on Chat Completions) reaches the model as an image where it can take one. glm, gpt-oss-fireworks and mindshub_blaze cannot, so they see a short text note in its place instead of failing the request. An image in a user turn is still sent as is.
  • PDF and other file inputs are not a documented feature yet; a file part reaches only the OpenAI-transport models today and is dropped elsewhere.

Errors you can hit​

400 for a malformed data URL or invalid base64. A model without vision returns its provider's own error, relayed with the original status. See Errors.