Learn how to use Sonar’s image upload feature.
The image upload feature allows you to include images in your API requests to support multi-modal conversations alongside text. Images can be provided either as base64 encoded strings within a data URI or as standard HTTPS URLs.
Image uploads can be useful for:
⸻
To include an image in a request, you can either:
image/png
with the correct MIME type if you’re using JPEG or GIF (image/jpeg
or image/gif
).This data URI or HTTPS URL should be included in your API request as part of a messages
array, using the image_url
content type.
⸻
Images must be embedded in the messages
array, alongside any text input. Each image should be provided using the following structure:
Using Base64 Data URI:
Using HTTPS URL:
⸻
sonar-deep-research
does not support image input.Learn how to use Sonar’s image upload feature.
The image upload feature allows you to include images in your API requests to support multi-modal conversations alongside text. Images can be provided either as base64 encoded strings within a data URI or as standard HTTPS URLs.
Image uploads can be useful for:
⸻
To include an image in a request, you can either:
image/png
with the correct MIME type if you’re using JPEG or GIF (image/jpeg
or image/gif
).This data URI or HTTPS URL should be included in your API request as part of a messages
array, using the image_url
content type.
⸻
Images must be embedded in the messages
array, alongside any text input. Each image should be provided using the following structure:
Using Base64 Data URI:
Using HTTPS URL:
⸻
sonar-deep-research
does not support image input.