Video API
Task-style video generation (sora-2 / veo-3 series)
Overview
The Video API submits video-generation requests task-style, sharing the same submit endpoint as the Image API: POST /api/generate/submit. The difference is in the model field and the input fields (video additionally accepts duration / seconds). Submit returns a task_id immediately — poll GET /api/generate/status/{task_id} until status=finished.
Authentication
Same Bearer token as the AI API: Authorization: Bearer sk-xxxxxx.
Shared Request Skeleton
{
"model": "sora-2 | sora-2-pro | veo-3.0-generate-001 | veo-3.1-generate-preview | ...",
"input": {
"prompt": "video description",
"size": "WxH pixels, e.g. 1280x720 / 1920x1080 / 720x1280",
"duration": 4,
"seconds": "4",
"image": "first-frame reference URL (optional)",
"images": ["first-frame reference URLs (optional)"],
"metadata": { /* model-specific params */ }
}
}Only prompt / size / image / images / duration / seconds are allowed at the top of input; any other field (aspectRatio, resolution, negativePrompt, etc.) must go under input.metadata or the request returns 400.
file_type is currently always `image`
In the success response, data.files[].file_type is hardcoded to "image" regardless of the media type. Detect video vs image from the file_url extension or your call-site context.
Models
How is this guide?
Last updated on