Video Inputs
Send video files to video-capable models through the AgnicPay AI Gateway
Video Inputs
Send video files to compatible models for analysis, description, object detection, and action recognition. AgnicPay supports multiple video formats for comprehensive video understanding tasks.
Overview
Video requests are available via the /v1/chat/completions API with the video_url content type. Videos can be sent as URLs or base64-encoded data URLs.
Video URL support varies by provider. Some providers only support specific URL types (e.g., YouTube links for certain Google models).
Using Video URLs
For publicly accessible videos:
Python
JavaScript
Using Base64 Encoded Videos
For local video files:
Python
JavaScript
Supported Video Formats
| Format | MIME Type | Extension |
|---|---|---|
| MP4 | video/mp4 | .mp4 |
| MPEG | video/mpeg | .mpeg |
| MOV | video/mov | .mov |
| WebM | video/webm | .webm |
Compatible Models
Models with video processing capabilities:
| Provider | Models | URL Support |
|---|---|---|
| Gemini 2.0 Flash, Gemini 1.5 Pro | YouTube links |
Use Cases
- Video summarization - Generate text summaries
- Object recognition - Identify objects and people
- Action detection - Describe activities and movements
- Scene understanding - Analyze settings and contexts
- Content moderation - Review video content
- Sports analysis - Analyze gameplay and movements
Best Practices
File Size Considerations
- Compress videos - Reduce size without losing quality
- Trim videos - Include only relevant segments
- Lower resolution - 720p is often sufficient
- Reduce frame rate - Lower FPS for non-critical analysis
Optimal Video Length
- Check model-specific limits on duration
- Split long videos into shorter segments
- Focus on key moments
Quality vs. Size Trade-offs
| Quality | Resolution | Use Case |
|---|---|---|
| High | 1080p+ | Detailed analysis, text recognition |
| Medium | 720p | General analysis |
| Lower | 480p | Basic scene understanding |
Troubleshooting
Video not processing?
- Verify the model supports video input
- Check format compatibility
- Try base64 encoding instead of URL
- Ensure file isn't corrupted
Large file errors?
- Compress the video
- Reduce resolution or frame rate
- Trim to shorter duration
Poor analysis?
- Ensure video quality is sufficient
- Provide specific prompts
- Check if content is clearly visible