Image guide
The image upload feature allows you to include images in your API requests to support multi-modal conversations alongside text.
The API currently only supports images in base64 format with limit of 20 MB per image. Direct file uploads or external URLs are not supported.
Supported formats
- PNG (image/png)
- JPEG (image/jpeg)
- GIF (image/gif)
Image uploads can be useful for:
- Asking questions about visual content (e.g., text in a screenshot, diagram interpretation)
- Providing context for follow-up queries
- Analyzing visual media as part of a multi-turn conversation
⸻
Overview
To include an image in a request, you must encode the image as a base64 string and embed it in a data URI using the following format:
Replace image/png with the correct MIME type if you’re using JPEG or GIF:
image/jpeg
for.jpg
or.jpeg
image/gif
for .gif
This data URI should be included in your API request as part of a messages array, using the image_url
content type.
⸻
Request Format
Images must be embedded in the messages array, alongside any text input. Each image should be provided using the following structure:
⸻
Examples
- Image and regex cannot be used together in the same request.
sonar-deep-research
does not support image input.