Qwen/Qwen2.5-VL-72B-Instructgoogle/gemma-4-31B-it
Core Capabilities
- Image understanding: Describe images, extract text (OCR), and answer questions about visual content.
- Visual Q&A: Ask follow-up questions about diagrams, screenshots, or product images.
- Multimodal conversation: Mix text and images in a single conversation, such as “compare these two charts.”
- Content moderation: Classify or flag image content using natural language instructions.
Image Message Format
When sending images, setcontent in messages to an array. Array items can be of type text or image_url. The image_url can be either a publicly accessible image URL or a data: URL, which is a base64-encoded image.
Example structure:
Key Parameters
-
Parameters
-
temperature: Controls output randomness. -
max_completion_tokens: Limits generation length and helps avoid truncated output. -
stream=True: Returns responses as a stream. Recommended for long responses to reduce timeout risk.
-
- Context The maximum context length supported by each model can be viewed in Models.
- Image limits Supported image formats and size limits vary by model. For details, refer to Models.
Billing
- Formula: Cost = input tokens x input unit price + output tokens x output unit price If the request hits or writes Prompt Caching, cache read tokens and cache write tokens are billed at the corresponding cache unit prices. For the complete billing policy, see Token Usage and Billing.
- Pricing: The input unit price for vision models may differ from text-only models. Check the model detail page in Models for details.
-
Token calculation notes
Input tokens = text tokens + image tokens.
- Images and other vision inputs are converted into input tokens and billed at the input unit price. The pixel-to-token mapping differs by model: higher resolution and more images usually produce more input tokens.
- Text in the same request is still counted in the standard way.
- If there are multiple images, each image is counted separately.
-
Token calculation examples
The following representative models illustrate how visual content is converted into tokens:
Examples
The examples read the API key from an environment variable to avoid writing secrets into code.Image Description
Visual Q&A with Base64 Images
Multiple Images in One Request
To send multiple images in a single request, add moreimage_url entries to the same content array. The model receives these images together and can use them for tasks such as comparison and summarization.

