Vision and multimodal support depends on the model, not just the endpoint. Models like
gpt-4o, gpt-4o-mini, claude-opus-4-5, and gemini-2.5-pro support image and document inputs. Check the Models page for per-model capability details.Images
Pass an image by URL or as a base64-encoded data URI inside acontent array. The model can describe, analyze, compare, or extract information from images.
- Python
- Node.js
- cURL
Base64 Images
For local files or private images that aren’t publicly accessible via URL, encode them as base64 and embed them directly.Image Detail Level
Control how much detail the model uses when processing an image. Higher detail increases token usage and cost.Multiple Images
Pass several images in the same message to compare, diff, or analyze them together.PDFs and Documents
Send PDF files as base64-encoded data for the model to read and reason over. Useful for contract analysis, document Q&A, and data extraction.- Python
- Node.js
Multi-turn Vision Conversations
Images persist in the conversation history just like text messages. The model can refer back to a previously sent image in later turns.Supported Formats
Best Practices
Resize before sending
Resize before sending
Large images increase token usage significantly with little quality gain. Resize to 1024×1024 or smaller before encoding. The model doesn’t need 4K resolution to understand content.
Use low detail for quick checks
Use low detail for quick checks
When you only need a rough description or classification, use
"detail": "low". It uses a fixed 85 tokens regardless of image size and returns much faster.Be specific in your text prompt
Be specific in your text prompt
Tell the model exactly what to look for. Vague prompts like “describe this” produce generic results. “List every line item and its price from this receipt” produces structured, useful output.
Combine with Structured Outputs
Combine with Structured Outputs
Pair vision with a JSON schema to extract structured data from images. Ideal for receipts, invoices, forms, and screenshots.