Video API Overview
Generate AI-powered activist videos using OpenAI’s Sora 2 and Sora 2 Pro models.Available Models
Video Specifications
Durations
Videos can be 4, 8, or 12 seconds long:- “4” seconds - Shortest, cheapest
- “8” seconds - Standard duration (recommended)
- “12” seconds - Longest, most expensive
Resolutions
Available sizes:
"1280x720"- Landscape 16:9 (sora-2, sora-2-pro)"720x1280"- Portrait 9:16 (sora-2, sora-2-pro)"1792x1024"- Landscape HD (sora-2-pro only)"1024x1792"- Portrait HD (sora-2-pro only)
Pricing
Videos are charged based on model, duration, and resolution: Sora 2 Standard:- 4s: $1.25 (0.5 credits)
- 8s: $2.50 (1 credit)
- 12s: $3.75 (1.5 credits)
- 4s: $3.50 (1 credit)
- 8s: $7.00 (2 credits)
- 12s: $10.50 (3 credits)
- 4s: $6.00 (4 credits)
- 8s: $15.00 (6 credits)
- 12s: $22.50 (9 credits)
Video Generation Flow
Video Lifecycle
- Queued - Video creation request received, queued for processing
- In Progress - Video actively generating (60-90 seconds)
- Completed - Video ready, URL available
- Failed - Generation failed (error included)
Video Expiration
- OpenAI Storage: Videos stored on OpenAI servers for 1 hour only
- R2 Persistence: Videos automatically persisted to Cloudflare R2 after 45 minutes
- Permanent Storage: Persisted videos available indefinitely
Videos are automatically persisted to R2 storage 45 minutes after creation to ensure they remain available after OpenAI’s 1-hour retention window.
Endpoints
Quick Example
Best Practices
1. Use Webhooks, Not Polling
Instead of polling every 5 seconds, set up a webhook:2. Validate Prompts Client-Side
Validate before sending to avoid 400 errors:3. Handle Insufficient Credits
Check balance before creating videos:4. Use Theory of Change for Context
Align video visuals with your strategic approach:Common Error Codes
Rate Limits
Video generation is rate limited by account tier:Next Steps
Create Video
Create your first AI-generated video
Retrieve Status
Check video generation status
Download Video
Download completed videos
Webhooks
Set up real-time notifications