Submit a Task
Submit a video generation task and get a task_id
POST /v1/video/generations
Submit a video generation task. The endpoint returns a task_id immediately; generation runs asynchronously and progress is tracked via Query a Task.
Request Headers
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Bearer sk-xxx (API Key from the console, see Authentication) |
Content-Type | Yes | application/json |
Request Parameters
Parameters fall into two groups:
- Top-level (external) parameters: parsed by the gateway, shared across all channels, with fixed field names.
metadataparameters: a pass-through object carrying upstream/model-specific capabilities (resolution, aspect ratio, multi-modal reference inputs, watermark, etc.). The gateway does not inspect its internals and forwards the documented metadata fields listed below to the upstream — so official Volcengine Seedance params such ascontent,ratio,generate_audio, andwatermarkgo insidemetadata(duration is the exception: a positive duration goes in the top-levelseconds, while the special value-1can only be passed asmetadata.duration— see "How to Pass Duration").
Top-level Parameters
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | — | Description of the video content |
model | string | Yes | — | Model identifier; see Models for available options |
seconds | string | No | 5 | Video duration in seconds, maps to the official duration. Positive integers only; for -1 (follow the input video) use metadata.duration instead — see "How to Pass Duration" |
images | string[] | No | — | Image-to-video: first-frame image URLs (publicly accessible; reference images use metadata.content + role:"reference_image") |
metadata Parameters
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
duration | int | No | — | Video duration in seconds. Prefer the top-level seconds for positive values; -1 (follow the input video) can only be passed here — the top-level seconds cannot express a negative. See "How to Pass Duration" |
resolution | string | No | 720p | Resolution: 480p / 720p / 1080p / 4k |
ratio | string | No | 16:9 | Aspect ratio: 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / 21:9 / adaptive |
generate_audio | bool | No | true | Whether to generate audio (keep true when using a reference audio / background music) |
content | array | No | — | Multi-modal reference inputs (reference image / video / audio). Array items: {type, image_url|video_url|audio_url, role}; reference video uses type:"video_url" + role:"reference_video" (public URL, up to 3 clips, 2–15s each) |
content[].audio_url | object | No | — | Reference audio (background music / sound effects): {type:"audio_url", audio_url:{url}, role:"reference_audio"}; public URL, up to 3 clips; cannot be used alone — pair with at least 1 reference image or 1 reference video |
omni_reference_task_type | string | No | auto | Task-type hint (Seedance 2.5 only): auto / reference / edit / extend. Specifying it moves parameter-constraint validation forward to submission time (otherwise the task fails asynchronously after starting). See "V2V Task Type and Parameter Rules" below |
draft | bool | No | false | Draft mode switch (Seedance 2.5 only): true generates a 480p draft only; once you are happy with it, call POST /v1/videos/{task_id}/finalize for the 1080p final. While enabled, resolution may only be 480p (forced to 480p when omitted). See Draft Mode |
frames | int | No | — | Number of frames |
seed | int | No | — | Random seed (deterministic result) |
camera_fixed | bool | No | false | Fixed camera position |
watermark | bool | No | false | Watermark |
service_tier | string | No | — | Service tier (e.g. fast) |
return_last_frame | bool | No | false | Return the last frame |
callback_url | string | No | — | Webhook callback URL |
For per-model supported metadata options, see Models.
Parameter Placement Rules
- Required / common:
prompt/model/seconds→ put at the top level - Extended capabilities:
resolution/ratio/generate_audio/content/watermark, etc. → put inmetadata - First / first+last frame: top-level
images(single first frame, simplest) ormetadata.contentwithrole:"first_frame"/"last_frame" - Reference materials (reference image / video / audio): always use
metadata.contentwithrole:"reference_*"; do not mix with top-levelimages(when both are present,metadata.contentoverridesimages) - Duration: see "How to Pass Duration" below — positive values go in the top-level
seconds,-1only asmetadata.duration
How to Pass Duration
seconds and duration live on different levels and behave asymmetrically on the Seedance 2.5 channel — passing the wrong one either fails silently or returns a 400:
| Form | Takes effect | Notes |
|---|---|---|
Top-level seconds: "5" | ✅ | The normal form. Positive integers only (1–3600); the gateway maps it to the upstream duration |
Top-level duration: 5 | ❌ | Validated, but never forwarded upstream (silently dropped) — do not use |
metadata.duration: 5 | ✅ | Goes straight into the upstream request body |
Precedence: a top-level seconds that parses to a positive number overrides metadata.duration; 0, empty, or non-numeric does not override.
-1 (follow the input video) can only go through metadata.duration: both top-level seconds and top-level duration are range-checked against 1–3600, so passing -1 returns 400 invalid_seconds.
{
"model": "doubao-seedance-2-5-260628",
"prompt": "turn the cream in the frame red",
"metadata": {
"duration": -1,
"ratio": "adaptive",
"content": [{"type": "video_url", "video_url": {"url": "https://your-host/clip.mp4"}, "role": "reference_video"}]
}
}Video-edit tasks require
durationto be-1, so in edit scenarios do not pass a top-levelseconds— it would overridemetadata.duration. See "V2V Task Type and Parameter Rules" below.
Referencing Material Library Assets
Reference images / videos / audio can be passed as public URLs, or as asset://<asset-id> referencing an asset already created in the Material Library — the gateway forwards the reference as-is and the upstream resolves it by asset id, so you do not need to download or re-host the file yourself.
Create the asset first via the Material Library API (or upload it on the console's Materials page), then put the returned id in the URL field:
| Use | Where to put it |
|---|---|
| First frame | Top-level images: "images": ["asset://Asset-xxxxxx"] |
| Reference image | metadata.content[]: {"type":"image_url","image_url":{"url":"asset://Asset-xxxxxx"},"role":"reference_image"} |
| Reference video | metadata.content[]: {"type":"video_url","video_url":{"url":"asset://Asset-xxxxxx"},"role":"reference_video"} |
| Reference audio | metadata.content[]: {"type":"audio_url","audio_url":{"url":"asset://Asset-xxxxxx"},"role":"reference_audio"} |
The id comes from one of two places: for virtual assets, use the asset id returned by Material Library API CreateAsset / ListAssets and write it as asset://Asset-xxxxxx; for real-person assets, use the group id returned by real-person verification and write it as asset://group-xxxxxx.
curl "$BASE_URL/v1/video/generations" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "Use the product in image 1 as the subject; slow orbiting camera, pure white studio background",
"seconds": "5",
"metadata": {
"resolution": "720p",
"content": [
{"type": "image_url", "image_url": {"url": "asset://Asset-2026xxxxxx"}, "role": "reference_image"}
]
}
}'V2V Task Type and Parameter Rules (Important)
⚠️ On 2.5, edit-style prompts must set the duration to
-1, and it can only be passed asmetadata.duration(the top-levelsecondscannot express a negative — the gateway returns 400) — otherwise the task ends inFAILURE.
Seedance 2.5 (doubao-seedance-2-5-260628) auto-detects the task type from the prompt semantics: when the prompt is an instruction to modify video content (e.g. "turn the cream red"), the task is treated as a video-edit task rather than reference-video generation. The output of a video-edit task is a rework of a model-selected input video, so its duration and aspect ratio must follow that input video and cannot be specified by you.
- The duration must be
-1(meaning "follow the input video"), written asmetadata.duration: -1; the input video must be 4–30s long. - Specifying a concrete duration (top-level
seconds: "5", ormetadata.duration: 5) violates this constraint → upstream parameter validation fails → the task ends inFAILURE. - 2.0 / fast / mini are unaffected: they always process as video generation and accept a concrete
seconds(e.g.5/10).
| Scenario | Task type | Duration | ratio | Input video | Models |
|---|---|---|---|---|---|
| Reference-video-guided generation | Video generation | top-level seconds ("5" / "10") | concrete value (16:9 etc.) | optional | 2.0 / fast / mini |
| Modifying video content | Video edit | metadata.duration: -1 | follows input video | required, 4–30s | 2.5 (auto-detected) |
Per the Volcengine docs: on 2.5 an edit task only accepts duration: -1; 2.0 / fast / mini are unrestricted and always process as video generation, accepting a concrete duration (e.g. 5 / 10).
Explicitly hinting the task type (2.5 only)
Instead of relying on auto-detection, set metadata.omni_reference_task_type to validate the parameter constraints at submission time — a mismatch returns 400 immediately rather than creating a task that fails asynchronously:
| Value | Task type | Extra constraints |
|---|---|---|
auto | Model decides (default, same as omitting) | — |
reference | Reference-to-video | No special duration (seconds or metadata.duration) / ratio limits |
edit | Video edit | ratio must be adaptive, duration must be metadata.duration: -1; reference video 4–30s |
extend | Video extension | ratio must be adaptive; content must include a reference video |
⚠️ Hinting does not guarantee that task type: the upstream still judges from the prompt semantics, and a mismatch still fails the task asynchronously. Write the prompt to match the task type you hint. Non-string values are rejected by the gateway (400 invalid_omni_reference_task_type).
Ark-Compatible Mode (Volcengine Native Protocol)
The endpoints above are the gateway's own convention. The same models can also be called through the Volcengine Ark native video API — request body, response body and error envelope match the official POST /api/v3/contents/generations/tasks documentation, so code written for Volcengine / BytePlus only needs a different base URL and API key.
| Operation | Endpoint |
|---|---|
| Create a task | POST /api/v3/contents/generations/tasks |
| Query a task | GET /api/v3/contents/generations/tasks/{id} |
Parameter mapping from the gateway form:
| Gateway form | Ark-compatible form |
|---|---|
prompt | content: [{"type":"text","text":"..."}] |
seconds | duration (seconds, top level) |
metadata.resolution | resolution (top level) |
images / metadata.content | content[] items (image_url / video_url / audio_url, including asset://Asset-xxxxxx) |
Other metadata fields (ratio, generate_audio, watermark, seed, callback_url, ...) | Top-level fields with the same names |
Fields the gateway has not modelled are forwarded as-is, so official parameters not listed here still reach the upstream.
BASE_URL="https://api.yunjizi.cn"
curl "$BASE_URL/api/v3/contents/generations/tasks" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-260128",
"content": [{"type": "text", "text": "A blue whale leaping out of the ocean, slow motion, cinematic look"}],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}'
# {"id":"task_xxx"}The create response contains only the gateway task id. Query it with the same protocol:
curl "$BASE_URL/api/v3/contents/generations/tasks/task_xxx" \
-H "Authorization: Bearer sk-YOUR-KEY"
# {
# "id":"task_xxx",
# "model":"dreamina-seedance-2-0-260128",
# "status":"succeeded",
# "content":{"video_url":"https://..."},
# "usage":{"completion_tokens":108900,"total_tokens":108900},
# "created_at":1786344639,
# "updated_at":1786344879,
# "resolution":"720p",
# "duration":5
# }status:queued/running/succeeded/failed.content,usage,resolutionanddurationappear only once the value is known — absent fields are omitted, not zero-filled.- Errors use the Ark envelope:
{"error":{"code":"...","message":"...","param":"","type":"BadRequest"}}. - These two endpoints only route to Volcengine-native channels. If no such channel serves the model you get
503with no available channel, and a Volcengine-native channel is likewise not selectable through/v1/video/generationsor/v1/videos. - Draft mode (Seedance 2.5) has its own two-step flow in this protocol — see Draft Mode.
Examples
Text-to-Video
BASE_URL="https://yunjizi.cn" # Domestic; overseas use https://api.yunjizi.cn
curl "$BASE_URL/v1/video/generations" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-260128",
"prompt": "A blue whale leaping out of the ocean, slow motion, cinematic look",
"seconds": "5",
"metadata": {
"resolution": "720p",
"ratio": "16:9",
"generate_audio": true
}
}'Image-to-Video (First Frame)
curl "$BASE_URL/v1/video/generations" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-260128",
"prompt": "The camera slowly pushes in; the cup in the frame wobbles gently",
"images": ["https://example.com/first-frame.jpg"],
"seconds": "5",
"metadata": {
"resolution": "720p"
}
}'Reference-to-Video (Multi-modal)
Reference images / videos / audio can be combined freely (audio cannot be used alone — pair it with at least 1 reference image or 1 reference video); put them all in metadata.content, which maps to the official Seedance content array (role values: reference_image / reference_video / reference_audio). The "first frame / last frame" wording in the prompt is narrative about the video content; material roles are controlled by role, not by the first_frame / last_frame controls in the placement rules.
curl "$BASE_URL/v1/video/generations" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-260128",
"prompt": "Keep the first-person perspective of video 1 throughout, with audio 1 as the background music. A first-person fruit tea commercial for the seedance-brand \"Ping Ping An An\" apple fruit tea limited edition; frame 1 is image 1: your hand picks a dewy Aksu red apple with a crisp crunch; 2-4s: quick cut, you drop apple chunks into a shaker, add ice and tea base, shake hard, the clinking of ice syncing with a light beat, voiceover: \"fresh-cut and freshly shaken\"; 4-6s: first-person close-up of the finished drink, layered fruit tea poured into a clear cup, your hand squeezes milk cap on top, a pink label is stuck on the cup, the camera zooms in on the layering; 6-8s: first-person handheld toast, you raise the drink from image 2 toward the camera (as if handing it to the viewer), the label clearly visible, voiceover: \"have a fresh sip\", and the last frame freezes on image 2. Background voice: female throughout.",
"seconds": "11",
"metadata": {
"ratio": "16:9",
"generate_audio": true,
"watermark": false,
"content": [
{"type": "image_url", "image_url": {"url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/r2v_tea_pic1.jpg"}, "role": "reference_image"},
{"type": "image_url", "image_url": {"url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/r2v_tea_pic2.jpg"}, "role": "reference_image"},
{"type": "video_url", "video_url": {"url": "https://ark-project.tos-cn-beijing.volces.com/doc_video/r2v_tea_video1.mp4"}, "role": "reference_video"},
{"type": "audio_url", "audio_url": {"url": "https://ark-project.tos-cn-beijing.volces.com/doc_audio/r2v_tea_audio1.mp3"}, "role": "reference_audio"}
]
}
}'Audio-Reference to Video
A reference audio (role:"reference_audio") serves as background music / sound effects and is referred to as "audio 1" in the prompt; audio cannot be used alone — pair it with at least 1 reference image or 1 reference video, and keep generate_audio true.
curl "$BASE_URL/v1/video/generations" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-260128",
"prompt": "Using image 1 as the visual reference and audio 1 as the background music: a sunrise by the sea, waves gently lapping the shore, the camera slowly pushes in toward a lighthouse in the morning light, calm and healing.",
"seconds": "5",
"metadata": {
"resolution": "720p",
"ratio": "16:9",
"generate_audio": true,
"content": [
{"type": "image_url", "image_url": {"url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/r2v_tea_pic1.jpg"}, "role": "reference_image"},
{"type": "audio_url", "audio_url": {"url": "https://ark-project.tos-cn-beijing.volces.com/doc_audio/r2v_tea_audio1.mp3"}, "role": "reference_audio"}
]
}
}'Complete Parameters (First Frame + Optional Metadata Fields)
Note: this example uses top-level
imagesas the first frame, so it omitsmetadata.content— multi-modal references and the first frame are mutually exclusive (see Parameter Placement Rules); use the Reference-to-Video example above for multi-modal references.
curl "$BASE_URL/v1/video/generations" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-260128",
"prompt": "A blue whale leaping out of the ocean, slow motion, cinematic look",
"images": ["https://example.com/first-frame.png"],
"seconds": "5",
"metadata": {
"resolution": "720p",
"ratio": "16:9",
"generate_audio": true,
"frames": 30,
"seed": 42,
"camera_fixed": false,
"watermark": false,
"service_tier": "fast",
"return_last_frame": false,
"callback_url": "https://example.com/webhook"
}
}'Response
The endpoint returns an OpenAI-compatible video object; id (same as task_id) is the task identifier and status is queued:
{
"id": "task_9f3a2b7c",
"task_id": "task_9f3a2b7c",
"object": "video",
"model": "dreamina-seedance-2-0-260128",
"status": "queued",
"progress": 0,
"created_at": 1786344639
}Note down id (i.e. task_id) — it is used to query progress and download the result.