Vision Models
Send images alongside text prompts
Vision-capable models accept images alongside text using the standard OpenAI content-parts format. The gateway routes your request to the model as-is — no re-encoding, no extra fees beyond the model's normal input token price for the image content.
Sending an image
Pass an array of content parts instead of a plain string. Images can be public URLs or base64 data URLs.
pythonresp = client.chat.completions.create( model="claude-opus-5-5", max_tokens=500, messages=[{ "role": "user", "content": [ {"type": "text", "text": "What's in this screenshot? Be specific."}, {"type": "image_url", "image_url": {"url": "https://example.com/ui.png"}}, ], }], )
Base64-encoding a local file
pythonimport base64 with open("chart.png", "rb") as f: b64 = base64.b64encode(f.read()).decode() part = {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{b64}"}}
Finding vision models
The catalog marks every model's input modalities. Filter oninput_modalities containing "image":
bashcurl -s https://tokenhub-staging.coality.io/api/public/models | jq '[.data[] | select(.input_modalities | index("image")) | .id]'
Most frontier models in the catalog accept images, including claude-opus-5-5, gpt-6-astra, gemini-4-argon, and qwen3-8-max. Check a model's detail page for its exact modality list.
Practical tips
| Topic | Guidance |
|---|---|
| Image size | Large images consume more input tokens. Downscale to what the task needs before sending. |
| Multiple images | Send several image parts in one message; bill each per its token cost. |
| File types | PNG and JPEG are universally supported across vision models; prefer those. |
| Vision + caching | Stable image prefixes (e.g. a fixed UI reference) can benefit from prompt caching like text prefixes. |