Image Inputs
Send images to vision models through the AgnicPay AI Gateway
Image Inputs
Send images to multimodal models for analysis, description, OCR, and more. AgnicPay supports multiple image formats and both URL-based and base64-encoded images.
Overview
Image requests are available via the /v1/chat/completions API with a multi-part messages parameter. The image_url can either be a URL or a base64-encoded image.
Multiple images can be sent in separate content array entries. We recommend sending the text prompt first, then the images for best results.
Using Image URLs
For publicly accessible images, send the URL directly:
Python
JavaScript
cURL
Using Base64 Encoded Images
For locally stored images, use base64 encoding:
Python
JavaScript
Supported Image Formats
| Format | MIME Type | Extension |
|---|---|---|
| PNG | image/png | .png |
| JPEG | image/jpeg | .jpg, .jpeg |
| WebP | image/webp | .webp |
| GIF | image/gif | .gif |
Multiple Images
Send multiple images in a single request:
Compatible Models
Models with vision capabilities include:
| Provider | Models |
|---|---|
| OpenAI | openai/gpt-4o, openai/gpt-4o-mini, openai/gpt-4-turbo |
| Anthropic | anthropic/claude-3.5-sonnet, anthropic/claude-3-opus, anthropic/claude-3-haiku |
google/gemini-2.0-flash, google/gemini-1.5-pro, google/gemini-1.5-flash |
Check the model's architecture.input_modalities for "image" support.
Best Practices
- Use URLs for public images - More efficient than base64 encoding
- Compress large images - Reduce payload size without losing quality
- Send text first - Place your prompt before the images
- Check model limits - Different models have different image count limits