Seedance 2.0 video generation API · Unified v1
API version
This page describes the Unified Video API (v1). You can independently choose the Seedance Native API (v3) instead; use the request and result format documented for your chosen interface.
For Seedance-family API model IDs, a successful, fully settled GET /v1/tasks/{id} response may include assets[].source_url for each recorded original asset URL. Other models and unfinished or failed tasks omit this field. The original link may already be expired or access-limited; its expiry is not checked and the link is not refreshed when querying. Save files promptly; use assets[].url if the original link is unavailable. Platform download links and console previews are unchanged. Do not send your Tokenlio API Key to either asset URL.
Model capabilities and optional controls
Only specifications and modes currently available for the requested API model ID can be used. Ranges on this page are interface limits, not a guarantee that every model ID supports every combination. Unsupported durations, resolutions, input counts or modes are rejected with VIDEO_REQUEST_INVALID; do not retry the same unsupported request.
Optional controls generate_audio, return_last_frame, seed, watermark and output_format may have no effect or use a default when unsupported. Defaults describe the request, not a guarantee of generated audio, a final frame, repeatable output or a particular container. Check the actual assets and downloaded file. Unknown fields, invalid types and null are still rejected.
Seedance 2.0 | explicit integer duration | video and reference inputs | asynchronous tasks
Seedance 2.0 uses the shared asynchronous video API. Use the parameters and examples below only for specifications and modes supported by the API model ID you request.
Start with quick start to create a task; when you need to control the picture, go straight to the scenario examples.
Base URL: https://api.tokenlio.ai
Every path below is relative to the Base URL:
- Create:
POST /v1/videos/generations, returns 202 Accepted. - Query:
GET /v1/tasks/{id}, reads task status and results. - Download:
GET /v1/tasks/{id}/content, obtains the video file.
Before you start
- Sign in to the Tokenlio console and create a Workspace model-routing API Key.
- Copy the published Seedance 2.0 API model ID from the model catalog and replace
example/seedance-2.0in every example. - Video tasks are asynchronous: creation returns a 202 response with the task
idimmediately, so poll the query endpoint for the result.
Smaller variants in the same series
Seedance 2.0 has two variants with smaller output specs. Endpoints, parameters, responses and downloads are identical; only the model ID and available resolutions differ:
- Seedance 2.0 Fast:
480p/720poutput, suited to fast iteration and previews. - Seedance 2.0 Mini:
480p/720poutput, suited to batch generation.
All example/... values on this page are placeholders. Available models, the exact API model IDs and prices follow the model catalog; a model name does not mean your Key is authorised.
Defaults are 720p, 16:9 and mp4, with at most 9 reference images, 3 reference videos and 3 reference audio clips. Audio references must accompany images or video.
Quick start (end-to-end)
The example below walks from submitting a video generation task to polling the task status. Set the Key securely as the TOKENLIO_API_KEY environment variable and replace the model ID before running it.
Do not automatically retry creation
Every POST without an idempotency identifier is an independent generation request. If creation times out before you receive an id, check the console call records first; once you have an id, only query that task instead of submitting again. The optional idempotency header is described in the shared guide.
# 1. Submit the generation task (returns 202 with the task ID)
curl -X POST "https://api.tokenlio.ai/v1/videos/generations" \
-H "Authorization: Bearer $TOKENLIO_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"model": "example/seedance-2.0",
"prompt": "A fluffy golden kitten yawns at the camera, warm morning light through the window screen, every strand of fur visible",
"duration": 5,
"resolution": "720p",
"size": "16:9",
"generate_audio": true
}'
# 2. Query the task status (poll every 5–10 seconds)
# Replace TASK_ID with the id returned above
curl -X GET "https://api.tokenlio.ai/v1/tasks/TASK_ID" \
-H "Authorization: Bearer $TOKENLIO_API_KEY"import os
import time
import requests
API_KEY = os.environ.get("TOKENLIO_API_KEY")
BASE_URL = "https://api.tokenlio.ai"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
# 1. Create the video task
payload = {
"model": "example/seedance-2.0",
"prompt": "A fluffy golden kitten yawns at the camera, warm morning light through the window screen, every strand of fur visible",
"duration": 5,
"resolution": "720p",
"size": "16:9",
"generate_audio": True
}
resp = requests.post(f"{BASE_URL}/v1/videos/generations", headers=headers, json=payload)
resp.raise_for_status()
task = resp.json()
task_id = task["id"]
print(f"Task submitted, id: {task_id}, status: {task.get('status')}")
# 2. Poll until the task finishes
while True:
time.sleep(5)
query_resp = requests.get(f"{BASE_URL}/v1/tasks/{task_id}", headers=headers)
query_resp.raise_for_status()
result = query_resp.json()
status = result.get("status")
print(f"Polled status: {status}")
if status == "succeeded":
for asset in result.get("assets", []):
if asset.get("role") == "video":
print(f"Video ready, download URL: {asset.get('url')}")
elif asset.get("role") == "last_frame":
print(f"Last frame URL: {asset.get('url')}")
break
elif status == "failed":
err = result.get("error", {})
print(f"Task failed: {err.get('code')} - {err.get('message')}")
breakconst apiKey = process.env.TOKENLIO_API_KEY;
const baseUrl = 'https://api.tokenlio.ai';
async function generateVideo() {
// 1. Create the video task
const createRes = await fetch(`${baseUrl}/v1/videos/generations`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'example/seedance-2.0',
prompt: 'A fluffy golden kitten yawns at the camera, warm morning light through the window screen, every strand of fur visible',
duration: 5,
resolution: '720p',
size: '16:9',
generate_audio: true,
}),
});
if (!createRes.ok) {
throw new Error(`Creation failed: ${createRes.status} ${await createRes.text()}`);
}
const { id } = await createRes.json();
console.log(`Task accepted, task id: ${id}`);
// 2. Poll the result
while (true) {
await new Promise((r) => setTimeout(r, 5000));
const queryRes = await fetch(`${baseUrl}/v1/tasks/${id}`, {
headers: { 'Authorization': `Bearer ${apiKey}` },
});
const task = await queryRes.json();
console.log(`Current status: ${task.status}`);
if (task.status === 'succeeded') {
const videoAsset = task.assets.find((a) => a.role === 'video');
console.log('Generation succeeded, video URL:', videoAsset?.url);
break;
} else if (task.status === 'failed') {
console.error('Task failed:', task.error);
break;
}
}
}
generateVideo().catch(console.error);package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
"time"
)
func main() {
apiKey := os.Getenv("TOKENLIO_API_KEY")
baseURL := "https://api.tokenlio.ai"
// 1. Create the video generation task
payload := map[string]any{
"model": "example/seedance-2.0",
"prompt": "A fluffy golden kitten yawns at the camera, warm morning light through the window screen, every strand of fur visible",
"duration": 5,
"resolution": "720p",
"size": "16:9",
"generate_audio": true,
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", baseURL+"/v1/videos/generations", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+apiKey)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var created struct {
ID string `json:"id"`
Status string `json:"status"`
}
_ = json.NewDecoder(resp.Body).Decode(&created)
fmt.Printf("Task created, id: %s, status: %s\n", created.ID, created.Status)
// 2. Poll for the result
for {
time.Sleep(5 * time.Second)
qReq, _ := http.NewRequest("GET", baseURL+"/v1/tasks/"+created.ID, nil)
qReq.Header.Set("Authorization", "Bearer "+apiKey)
qResp, err := client.Do(qReq)
if err != nil {
continue
}
var result struct {
Status string `json:"status"`
Assets []struct {
Role string `json:"role"`
URL string `json:"url"`
} `json:"assets"`
}
_ = json.NewDecoder(qResp.Body).Decode(&result)
qResp.Body.Close()
fmt.Printf("Task status: %s\n", result.Status)
if result.Status == "succeeded" {
for _, asset := range result.Assets {
if asset.Role == "video" {
fmt.Println("Generation succeeded, video URL:", asset.URL)
}
}
break
} else if result.Status == "failed" {
fmt.Println("Task processing failed")
break
}
}
}Response formats
Creation returns HTTP 202 Accepted:
{
"id": "c1f7b02d-9473-4f05-8716-1f912c98e100",
"model": "example/seedance-2.0",
"status": "queued",
"assets": []
}A finished task returns HTTP 200 OK:
{
"id": "c1f7b02d-9473-4f05-8716-1f912c98e100",
"model": "example/seedance-2.0",
"status": "succeeded",
"assets": [
{
"role": "video",
"url": "https://download.tokenlio.ai/videos/c1f7b02d-9473-4f05-8716-1f912c98e100.mp4?expires=1786219148"
}
]
}Request parameters
| Parameter | Type | Required / default | Definition and limits |
|---|---|---|---|
model | string | Required | The exact published API model ID from the catalog (for example example/seedance-2.0); display aliases are not accepted. |
prompt | string | Required for text-to-video / recommended otherwise | Up to 4,000 characters; 100–500 characters is usually enough — state the subject, camera movement, environment lighting and motion detail. |
duration | integer | Required (no default) | Output length in seconds; an integer from 4–15. Decimals and negative values are not accepted. Only use this option within the model's currently available capabilities. |
resolution | string | 720p | 480p, 720p, 1080p, 4k. Only use this option within the model's currently available capabilities. |
size | string | 16:9 | Aspect ratio: 16:9, 9:16, 1:1, 4:3, 3:4, 21:9, adaptive. Only use this option within the model's currently available capabilities. |
generate_audio | boolean | true | Optional audio-generation preference; supported models apply true or false. It may have no effect; it does not guarantee audio in the result. |
return_last_frame | boolean | false | Optional final-frame request. Use an asset with role=last_frame only if it is returned; some models ignore this control. |
seed | integer | Optional | Optional signed 64-bit random seed. It may be ignored and never guarantees identical output. |
output_format | string | mp4 | Requested container: mp4. If unsupported, it may fall back to mp4; inspect the downloaded file instead of relying on its extension. |
image_urls | string[] | Optional | Public HTTPS URLs of reference images, at most 9. Cannot be combined with image_with_roles. Only use this option within the model's currently available capabilities. |
image_with_roles | object[] | Optional | Image objects with roles, used to set first/last frames, at most 2 items. Cannot be combined with image_urls. Only use this option within the model's currently available capabilities. |
image_with_roles[].url | string | Required | Stable public HTTPS URL of the image. |
image_with_roles[].role | string | Required | first_frame (at most 1) or last_frame (requires a first frame). |
video_urls | string[] | Optional | Public HTTPS URLs of reference videos, at most 3 clips and 15 seconds of total input duration. Only use this option within the model's currently available capabilities. |
audio_urls | string[] | Optional | Public HTTPS URLs of reference audio, at most 3 clips. Reference images or videos must be supplied too; 2.0 does not accept audio-only references. Only use this option within the model's currently available capabilities. |
expected_pricing_revision | string | Optional | A pricing version you already hold; if the version changed, creation is rejected with VIDEO_PRICE_CHANGED and no price is reserved or locked. |
max_charge_amount | string | Optional | Maximum USD you are willing to pay (for example "0.50"), at most 8 fractional digits. |
Strict JSON types
- Use valid JSON data types: booleans must be real booleans (
true/false) and integers must be integers (such as5); never send"true"or"5". - Do not send
nullvalues or undefined fields. watermarkandomni_reference_task_typehave no effect on 2.0 models; they do not enable 2.5 modes. Unknown fields and invalid JSON types are still rejected.
Usage scenarios
Advanced examples apply only when the requested model supports the illustrated specification or mode. They use the same create, query and download endpoints.
All examples below use the Standard model example/seedance-2.0; replacing the prompt and material URLs is enough to run them. Fast and Mini accept exactly the same request bodies with their own model ID and resolution limited to 480p / 720p; see their pages for examples.
Scenario 1: standard text-to-video
The most common case. Set the standard 16:9 landscape frame, 720p, automatic audio, and a seed when you want to control randomness.
{
"model": "example/seedance-2.0",
"prompt": "A chubby panda cub sits on the grass in a green bamboo forest, holding a fresh bamboo shoot in both paws and chewing happily, a breeze stirs the bamboo leaves, morning sun casts a golden halo on its fur",
"duration": 5,
"resolution": "720p",
"size": "16:9",
"seed": 42,
"generate_audio": true
}Scenario 2: 4K cinematic footage(when available)
Only Seedance 2.0 supports 4k output. This example uses a 21:9 frame and 15 seconds, suited to high-resolution footage; see the Fast and Mini pages for the smaller variants.
{
"model": "example/seedance-2.0",
"prompt": "A cyberpunk future city seen from the top of a skyscraper, slowly tilting down. Rainy night neon reflects in the wet streets, a holographic whale swims through the air, flying cars weave between buildings, extremely detailed cinematic lighting, 8k detail",
"duration": 15,
"resolution": "4k",
"size": "21:9",
"generate_audio": true
}Scenario 3: 9:16 vertical short video (social/short drama)
Built for mobile platforms (Douyin, TikTok, YouTube Shorts, Reels): set size to 9:16, describe dialogue or ambience in the prompt, and generate a short clip with clear audio.
{
"model": "example/seedance-2.0",
"prompt": "A young professional woman stands at a floor-to-ceiling window overlooking the city in the morning, holding a coffee, turns to smile and greet the camera, soft morning greeting and light café music in the background, bright and warm",
"duration": 6,
"resolution": "1080p",
"size": "9:16",
"generate_audio": true
}Scenario 4: single first frame (animate a still image)(when available)
Use image_with_roles with role: "first_frame" to use the image as the starting frame. Describe the subject's motion and camera changes in the prompt; the result is not guaranteed to match every detail of the source image.
{
"model": "example/seedance-2.0",
"prompt": "The young woman in period dress in the frame brushes the strings of a guqin, lifts her eyes with a gentle smile, spring wind stirs her hair and sleeves, peach petals drift slowly down",
"duration": 5,
"resolution": "720p",
"size": "16:9",
"image_with_roles": [
{
"url": "https://YOUR_PUBLIC_CDN/character_start.png",
"role": "first_frame"
}
]
}First-frame rules
- With only a first frame, do not send
last_frame. - When
image_with_rolesis used, do not also sendimage_urls,video_urlsoraudio_urls.
Scenario 5: precise first-to-last frame transition (time lapse or state change)(when available)
Supply both a first frame (first_frame) and a last frame (last_frame); the model computes a smooth transition from the starting state to the ending state. Ideal for day-to-night shifts, seasonal change or a building being completed.
{
"model": "example/seedance-2.0",
"prompt": "Starting from the sunny daytime city skyline of the first frame, the camera pushes in with a steady time-lapse, the sun sinks into afterglow, and the shot resolves smoothly into the glittering night skyline of the last frame",
"duration": 8,
"resolution": "1080p",
"size": "16:9",
"image_with_roles": [
{
"url": "https://YOUR_PUBLIC_CDN/city_daytime.jpg",
"role": "first_frame"
},
{
"url": "https://YOUR_PUBLIC_CDN/city_night.jpg",
"role": "last_frame"
}
]
}First/last frame limits
- At most one first frame and one last frame.
- A last frame requires a first frame; a lone last frame is rejected.
- The two images must use different public URLs.
Scenario 6: chain clips with return_last_frame(when available)
For long cinematic shots, a single 5–10 second clip is often not enough. Set "return_last_frame": true and a successful task returns the final frame as an extra asset. Use it as the first_frame of the next task to connect the shots. Differences can still appear between tasks, so check the transition while editing.
{
"model": "example/seedance-2.0",
"prompt": "An astronaut walks across an alien desert, the camera follows slowly behind, an enormous stone ruin stands on the horizon, steady determined steps",
"duration": 6,
"resolution": "720p",
"size": "16:9",
"return_last_frame": true
}A successful response contains two assets:
{
"id": "c1f7b02d-9473-4f05-8716-1f912c98e100",
"status": "succeeded",
"assets": [
{ "role": "video", "url": "https://download.tokenlio.ai/videos/result.mp4?..." },
{ "role": "last_frame", "url": "https://download.tokenlio.ai/videos/frame_last.png?..." }
]
}Scenario 7: silent footage with generate_audio: false
When you need clean footage for later colour grading and sound design, or you already have an audio track and do not want generated ambience, set "generate_audio": false.
{
"model": "example/seedance-2.0",
"prompt": "A deep-sea coral reef, tropical fish weaving through beams of light in clear blue water, macro shot of swaying anemones, an exceptionally calm documentary scene",
"duration": 6,
"resolution": "1080p",
"size": "16:9",
"generate_audio": false
}Scenario 8: style and character references with image_urls
When the model should follow the art style, character look or scene elements of some images without fixing the opening composition, pass 1–9 images through image_urls.
{
"model": "example/seedance-2.0",
"prompt": "Following the ink-wash Chinese painting style and mountain texture of the reference images, generate a short film of a small boat drifting slowly down a misty river",
"duration": 6,
"resolution": "720p",
"size": "16:9",
"image_urls": [
"https://YOUR_PUBLIC_CDN/ink_style_ref1.jpg",
"https://YOUR_PUBLIC_CDN/mountain_ref2.jpg"
]
}Scenario 9: camera motion and action transfer with video_urls
Pass existing footage to drive the camera path (fast push-in, FPV drone flight, orbit) or the rhythm of motion.
{
"model": "example/seedance-2.0",
"prompt": "Keep the fast dolly and rapid dive of the reference video, replacing the scene with a flight through the snow-capped canyons of the Rocky Mountains, pine trees and snow on both sides",
"duration": 5,
"resolution": "720p",
"size": "16:9",
"video_urls": [
"https://YOUR_PUBLIC_CDN/fpv_camera_movement.mp4"
]
}Billing note
With a reference video, billed duration covers both the input video duration and the requested output duration; the final amount is the charged_amount and currency in the task record.
Scenario 10: camera motion plus audio rhythm
Supply a reference video (camera rhythm) and reference audio (music mood) together.
{
"model": "example/seedance-2.0",
"prompt": "Follow the smooth push-in rhythm of the reference video; a futuristic smart car speeds along a highway at night, changing lanes on the electronic beat of the reference audio",
"duration": 8,
"resolution": "720p",
"size": "16:9",
"video_urls": [
"https://YOUR_PUBLIC_CDN/car_drive_ref.mp4"
],
"audio_urls": [
"https://YOUR_PUBLIC_CDN/electronic_beat.mp3"
]
}2.0 limitation
Seedance 2.0 does not accept audio-only references. audio_urls must be sent with video_urls or image_urls. For purely audio-driven video, use Seedance 2.5.
Scenario 11: all-modal commercial spot (multiple images + video + audio)
A commercial-grade multimodal call: combine high-resolution product stills, a motion reference video and a music bed to generate a first-person promotional clip.
{
"model": "example/seedance-2.0",
"prompt": "A first-person promotional film for a premium sports watch. Follow the wrist-wearing and wrist-raise camera path of the reference video and cut to the crisp beats of the reference audio. The wearer is on a morning run and raises a wrist showing the black titanium smartwatch from the reference images, heart-rate data highlighted on the dial, sunlight glinting off the bezel",
"duration": 10,
"resolution": "1080p",
"size": "16:9",
"image_urls": [
"https://YOUR_PUBLIC_CDN/watch_product_front.jpg",
"https://YOUR_PUBLIC_CDN/watch_product_angle.jpg"
],
"video_urls": [
"https://YOUR_PUBLIC_CDN/runner_camera_ref.mp4"
],
"audio_urls": [
"https://YOUR_PUBLIC_CDN/sports_commercial_bgm.mp3"
],
"generate_audio": true
}Input material guidelines
To keep tasks accepted and the output clean, prepare inputs within these limits:
| Material | Recommended specs and limits |
|---|---|
| Images | Up to 9; JPEG, PNG, WebP or BMP; keep each file < 30 MB; dimensions between 300×300 and 4096×4096 px; aspect ratio 0.4–2.5. |
| Videos | Up to 3 clips; prefer MP4 / H.264 at 480p or 720p; 2–15 seconds per clip, at most 15 seconds in total. |
| Audio | Up to 3 clips; MP3 or WAV preferred; at most 15 seconds in total; each file < 15 MB; must accompany images or video. |
URL requirements
Every material uses a directly reachable public HTTPS URL that needs no login, headers or redirects. Do not use private addresses or base64; upload material you are entitled to use and keep links valid and content stable for the life of the task.
Error codes and troubleshooting
Invalid creation requests return 400 Bad Request with an error identifier:
| Error code / message | Cause and fix |
|---|---|
duration must be an explicit integer from 4 to the model maximum | duration is missing, not an integer, or outside 4–15 seconds. |
unsupported model resolution | The resolution is not supported by this model. Seedance 2.0 supports 480p, 720p, 1080p and 4k. |
unsupported input asset counts or frame combination | Too many materials (for example more than 9 images), or an invalid frame combination such as last_frame without first_frame. |
frame inputs cannot be mixed with reference inputs | First/last frames were mixed with ordinary references. image_with_roles cannot be combined with image_urls, video_urls or audio_urls. |
this model requires images or video with reference audio | audio_urls was sent alone. 2.0 has no audio-only input; pairs are required. |
VIDEO_REQUEST_INVALID | Unknown fields, wrong JSON types, or a specification/mode unavailable for the requested model. |
maximum charge must be a non-negative USD decimal string... | max_charge_amount is malformed; use a non-negative decimal string with at most 8 fractional digits (for example "0.25"). |
