/omni/media/v1/contents/generations/tasksVideo generation
Video generation is asynchronous: create a task (202 + task id), poll until the status is terminal, then read the signed URL. Same base URL and atp- key as image. The gateway routes your unified model to a video provider with same-name failover. Available video models: seedance-2-0 (standard), seedance-2-0-mini (lighter / lower cost), seedance-2-0-fast (faster rendering), and the Kling family (preview): kling-v3-standard/-pro, kling-o3-standard/-pro with -i2v / -reference / -reference-7 / -v2v / -video-edit variants — all billed per second by resolution (Kling audio generation not yet available); confirm with GET /v1/models.
- A succeeded task carries
content.video_url— a signed edge URL with a 30-minute TTL. After expiry the task still reportssucceededbutvideo_urlisnullandexpired: true(re-create to regenerate). - Requests are refused with
402 insufficient_quotawhen the project balance is ≤ 0.
Call GET https://api.atptoken.ai/v1/models with the same key used to create the task. If a model is absent, that project cannot use it; installing a skill or knowing the model name does not bypass allowed models.
Create a task
curl https://api.atptoken.ai/omni/media/v1/contents/generations/tasks \
-H "Authorization: Bearer atp-..." -H "Content-Type: application/json" \
-H "Idempotency-Key: my-stable-key-123" \
-d '{
"model": "seedance-2-0",
"content": [
{ "type": "text", "text": "a red fox running through snow, cinematic" },
{ "type": "image_url", "image_url": { "url": "https://example.com/first.jpg" }, "role": "first_frame" }
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}'
# → 202 { "id": "task_..." }| Field | Type | Description |
|---|---|---|
| model | string · Req | unified video model (`video` pool) |
| content | array · Req | multimodal input blocks (see below) |
| resolution | string | `480p` / `720p` / `1080p` / `4k` |
| ratio | string | `16:9` `9:16` `4:3` `3:4` `1:1` `21:9` `adaptive` (alias `aspect_ratio`) |
| duration | integer | seconds (mutually exclusive with `frames`) |
| frames | integer | frame count (alt to `duration`) |
| generate_audio | boolean | add a soundtrack (alias `add_audio`) |
| seed | integer | |
| watermark | boolean |
content[] blocks — Each block is { "type": "text" | "image_url" | "video_url" | "audio_url", ... }. Text only → text-to-video; include an image → image-to-video. image_url/video_url take { "url": "<https | base64 | asset://pid.id>" }; role is first_frame / last_frame / reference_image / reference_video.
Poll until terminal
curl https://api.atptoken.ai/omni/media/v1/contents/generations/tasks/task_... \
-H "Authorization: Bearer atp-..."
# → { "status": "succeeded", "content": { "video_url": "https://media-prod.atptoken.ai/v/...mp4?exp=...&sig=..." } }| Method | Path | Action |
|---|---|---|
| POST | /omni/media/v1/contents/generations/tasks | create |
| GET | /omni/media/v1/contents/generations/tasks/{id} | poll |
| GET | /omni/media/v1/contents/generations/tasks | list |
| DELETE | /omni/media/v1/contents/generations/tasks/{id} | cancel |