Blue Whale APIBlue Whale API
Video Generation API

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

NameRequiredDescription
AuthorizationYesBearer sk-xxx (API Key from the console, see Authentication)
Content-TypeYesapplication/json

Request Parameters

Parameters fall into two groups:

  • Top-level (external) parameters: parsed by the gateway, shared across all channels, with fixed field names.
  • metadata parameters: 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 as content, ratio, generate_audio, and watermark go inside metadata (duration is the exception: a positive duration goes in the top-level seconds, while the special value -1 can only be passed as metadata.duration — see "How to Pass Duration").

Top-level Parameters

FieldTypeRequiredDefaultDescription
promptstringYes—Description of the video content
modelstringYes—Model identifier; see Models for available options
secondsstringNo5Video 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"
imagesstring[]No—Image-to-video: first-frame image URLs (publicly accessible; reference images use metadata.content + role:"reference_image")

metadata Parameters

FieldTypeRequiredDefaultDescription
durationintNo—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"
resolutionstringNo720pResolution: 480p / 720p / 1080p / 4k
ratiostringNo16:9Aspect ratio: 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / 21:9 / adaptive
generate_audioboolNotrueWhether to generate audio (keep true when using a reference audio / background music)
contentarrayNo—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_urlobjectNo—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_typestringNoautoTask-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
draftboolNofalseDraft 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
framesintNo—Number of frames
seedintNo—Random seed (deterministic result)
camera_fixedboolNofalseFixed camera position
watermarkboolNofalseWatermark
service_tierstringNo—Service tier (e.g. fast)
return_last_frameboolNofalseReturn the last frame
callback_urlstringNo—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 in metadata
  • First / first+last frame: top-level images (single first frame, simplest) or metadata.content with role:"first_frame" / "last_frame"
  • Reference materials (reference image / video / audio): always use metadata.content with role:"reference_*"; do not mix with top-level images (when both are present, metadata.content overrides images)
  • Duration: see "How to Pass Duration" below — positive values go in the top-level seconds, -1 only as metadata.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:

FormTakes effectNotes
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 duration to be -1, so in edit scenarios do not pass a top-level seconds — it would override metadata.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:

UseWhere to put it
First frameTop-level images: "images": ["asset://Asset-xxxxxx"]
Reference imagemetadata.content[]: {"type":"image_url","image_url":{"url":"asset://Asset-xxxxxx"},"role":"reference_image"}
Reference videometadata.content[]: {"type":"video_url","video_url":{"url":"asset://Asset-xxxxxx"},"role":"reference_video"}
Reference audiometadata.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 as metadata.duration (the top-level seconds cannot express a negative — the gateway returns 400) — otherwise the task ends in FAILURE.

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 as metadata.duration: -1; the input video must be 4–30s long.
  • Specifying a concrete duration (top-level seconds: "5", or metadata.duration: 5) violates this constraint → upstream parameter validation fails → the task ends in FAILURE.
  • 2.0 / fast / mini are unaffected: they always process as video generation and accept a concrete seconds (e.g. 5 / 10).
ScenarioTask typeDurationratioInput videoModels
Reference-video-guided generationVideo generationtop-level seconds ("5" / "10")concrete value (16:9 etc.)optional2.0 / fast / mini
Modifying video contentVideo editmetadata.duration: -1follows input videorequired, 4–30s2.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:

ValueTask typeExtra constraints
autoModel decides (default, same as omitting)—
referenceReference-to-videoNo special duration (seconds or metadata.duration) / ratio limits
editVideo editratio must be adaptive, duration must be metadata.duration: -1; reference video 4–30s
extendVideo extensionratio 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.

OperationEndpoint
Create a taskPOST /api/v3/contents/generations/tasks
Query a taskGET /api/v3/contents/generations/tasks/{id}

Parameter mapping from the gateway form:

Gateway formArk-compatible form
promptcontent: [{"type":"text","text":"..."}]
secondsduration (seconds, top level)
metadata.resolutionresolution (top level)
images / metadata.contentcontent[] 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, resolution and duration appear 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 503 with no available channel, and a Volcengine-native channel is likewise not selectable through /v1/video/generations or /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 images as the first frame, so it omits metadata.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.