Video Generation
Video generation is asynchronous: create a task to get a task ID, then poll for the result. All video models share the same POST /v1/videos endpoint — just change the model parameter.
Supported Models
| Model Family | Notes | Docs |
|---|---|---|
| Seedance official-consistent | Seedance 2.0/2.5 series (dreamina-seedance-*), official path /api/v3/contents/generations/tasks + unified asset entry, /v1/videos compatible | Seedance Guide · Asset Library |
| Kling | Kuaishou video model | Kling |
| Grok Imagine | xAI grok-imagine-video series, 1–15 s (default 8 s), native audio and 1080p on 1.5 | Grok Imagine |
Endpoint Overview
| Operation | Method & Path | Applies to |
|---|---|---|
| Create video task (unified) | POST $URL/v1/videos | Seedance / Kling |
| Query task status | GET $URL/v1/videos/{task_id} | Seedance / Kling |
| Create task (official-consistent) | POST $URL/api/v3/contents/generations/tasks | Seedance |
| Query/List/Cancel (official-consistent) | GET / DELETE $URL/api/v3/contents/generations/tasks* | Seedance |
| Asset library (unified entry) | POST $URL/?Action=<Action>&Version=2024-01-01 | Seedance |
Two interface styles
- Unified
/v1/videos: shared by all models, OpenAI Video style responses (id/status/video_url) — described on this page; - Official-consistent path: Seedance uses the official documentation paths
/api/v3/contents/generations/tasksand the asset entryPOST /?Action=xxx— see Seedance Guide.
1. Create Task
bash
curl $URL/v1/videos \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-mini-260615",
"prompt": "A cat wearing sunglasses walking on a neon street",
"seconds": "5",
"size": "720p"
}'Response:
json
{ "id": "cgt-xxxxxxxx", "model": "dreamina-seedance-2-0-mini-260615", "status": "in_progress", "created_at": 1785000000 }2. Query Task
Poll with the id from step 1 (every 5-10 seconds):
bash
curl $URL/v1/videos/cgt-xxxxxxxx \
-H "Authorization: Bearer $YOUR_API_KEY"When finished:
json
{ "id": "cgt-xxxxxxxx", "model": "dreamina-seedance-2-0-mini-260615", "status": "completed", "video_url": "https://..." }Task Status
| Status | Meaning | Action |
|---|---|---|
queued | Queued | Keep polling |
in_progress | Generating | Keep polling |
completed | Success | Get the video URL from the response; download it soon |
failed | Failed | Check error.message |
Idempotency
If you send a custom client_request_id (idempotency key), use a fresh unique value for each new task (e.g. UUID). Reusing an old value hits the upstream idempotency cache and returns the historical result.
Timeout
- Tasks stuck over 20 minutes are auto-failed and won't be retried indefinitely; poll to get the final status.
New Models
We keep onboarding new video models. Each new model gets its own doc page; the calling convention stays the same — only model and a few parameters differ.
