Overview
Both the Agentic Research API and Chat Completions API support image analysis through direct image uploads. Images can be provided either as base64 encoded strings within a data URI or as standard HTTPS URLs.Examples
- Agentic Research API
- Chat Completions API
- Base64 Encoded Data
- HTTPS URL
Use this method when you have the image file locally and want to embed it directly into the request payload. Remember the 50MB size limit and supported formats (PNG, JPEG, WEBP, GIF).
Request Format
Agentic Research API
Images must be embedded in theinput array when using message array format. Each image should be provided using the following structure:
image_url field accepts either:
- A URL of the image: A publicly accessible HTTPS URL pointing directly to the image file
- The base64 encoded image data: A data URI in the format
data:image/{format};base64,{base64_content}
Chat Completions API
Images must be embedded in themessages array, alongside any text input. Each image should be provided using the following structure:
url field accepts either:
- A URL of the image: A publicly accessible HTTPS URL pointing directly to the image file
- The base64 encoded image data: A data URI in the format
data:image/{format};base64,{base64_content}
Pricing
Images are tokenized based on their pixel dimensions using the following formula:- A 1024×768 image would consume: (1024 × 768) / 750 = 1,048 tokens
- A 512×512 image would consume: (512 × 512) / 750 = 349 tokens