Use a current public model ID from Models or
GET /models. Example IDs and options must match the selected model’s advertised capabilities and limits.Sending images
Turn a message’scontent from a string into an array of parts, mixing text and image_url parts:
Accepted formats
- Data URIs:
data:image/png;base64,...(also jpeg, webp, gif). - Public http(s) URLs: fetched at request time.
Which models support vision
Checkcapabilities.vision on GET /models, or the model cards on the models page. Sending an image to a non-vision model fails fast with 400 model_lacks_vision before anything is billed, and the error names the exact content part at fault.
How images are billed
Images are tokenized by the model and counted insideprompt_tokens: there is no separate image fee. The response’s usage object and nomask.cost_usd reflect the real total.