API DocsAI Model APIsVideosSeedance 2.0

Image-to-Video

Generate video from a first frame or first-and-last frames plus an optional text prompt. Async task API: submit, poll, then download.

Generate one target video from images and an optional text prompt. Two mutually exclusive modes:

  • First frame: one first-frame image + optional text
  • First & last frames: first-frame image + last-frame image + optional text

Optional synchronized audio. Up to 15 seconds and 4K resolution (standard model).

This is an async task-based API: submit a request to receive a task id, poll for status, then download the video when complete.

Only Doubao Seedance 2.0 series models are supported.

Note: First frame, first & last frames, and multimodal reference-to-video are mutually exclusive and must not be mixed.

Base URL

  • https://api.autorouter.top — Production

Authentication

BearerAuth: http (bearer) Authenticate using a Bearer Token. Format: Authorization: Bearer sk-xxxxxx

Endpoints

POST /api/v3/contents/generations/tasks

Create Video Generation Task

Create a video generation task from a first frame or first-and-last frames.

Request Body

Content-Type: application/json

Example (first frame):

{
  "model": "doubao-seedance-2-0-260128",
  "content": [
    {
      "type": "text",
      "text": "Make this cat jump"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/cat.jpg"
      },
      "role": "first_frame"
    }
  ],
  "resolution": "720p",
  "ratio": "adaptive",
  "duration": 5,
  "generate_audio": true,
  "watermark": false
}

Example (first & last frames):

{
  "model": "doubao-seedance-2-0-260128",
  "content": [
    {
      "type": "text",
      "text": "Slowly pull the camera back from a close-up"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/first.jpg"
      },
      "role": "first_frame"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/last.jpg"
      },
      "role": "last_frame"
    }
  ],
  "resolution": "720p",
  "duration": 5,
  "generate_audio": true
}

Properties:

NameTypeRequiredDescription
modelstringYesModel ID. See details below
contentobject[]YesInput list with optional text and images
content[].typestringYestext or image_url
content[].textstringNoText prompt when type=text
content[].image_urlobjectYes*Image object when type=image_url
content[].image_url.urlstringYes*Image URL, Base64, or asset ID
content[].rolestringConditionalImage role: first_frame / last_frame
resolutionstringNoVideo resolution. See details below
ratiostringNoAspect ratio. Default adaptive
durationintegerNoDuration in seconds. Range [4, 15] or -1; default 5
generate_audiobooleanNoWhether to generate audio. Default true
watermarkbooleanNoWhether to add watermark. Default false
callback_urlstringNoCallback URL for status changes
return_last_framebooleanNoReturn last-frame image. Default false
execution_expires_afterintegerNoTimeout in seconds. Range [3600, 259200]; default 172800
priorityintegerNoQueue priority. Range [0, 9]; default 0
toolsobject[]NoTool config such as web search
safety_identifierstringNoEnd-user identifier (ASCII, ≤64 chars)

Note: resolution, ratio, duration, and watermark also support weakly validated --[parameters] in the prompt. Prefer request-body strong validation.

Seedance 2.0 does not accept reference images containing real human faces uploaded directly. Use preset virtual avatars, authorized real-person assets, or face-containing outputs generated by Seedance 2.0 under your account within the last 30 days.

modelstring(Required)

Model ID to call.The specific model ID should follow the models visible in the Autorouter Models catalog and to your API key.

ModelDescriptionDefault resolutionAvailable resolutions
doubao-seedance-2-0-260128Standard, quality-oriented720p480p, 720p, 1080p, 4k
doubao-seedance-2-0-fast-260128Fast, lower latency720p480p, 720p
doubao-seedance-2-0-mini-260615Lightweight720p480p, 720p

contentobject[](Required)

Input for video generation: text and images.

typestring(Required)

Content type: text or image_url.

textstring(Optional)

Text prompt. Optional for image-to-video.

  • Languages: Chinese and English; also Spanish, Indonesian, Portuguese, and Japanese
  • Length: Prefer ≤500 Chinese characters or ≤1000 English words
image_url.urlstring(Required)

Image source:

  1. Public URL
  2. Base64: data:image/<format>;base64,<data> (format lowercase)
  3. Asset ID: asset://<ASSET_ID>

Per-image limits:

  • Formats: jpeg, png, webp, bmp, tiff, gif, heic, heif
  • Aspect ratio (w/h): [0.4, 2.5]
  • Side length: [300, 6000] px
  • Size: < 30 MB each; request body ≤ 64 MB. Avoid Base64 for large files

Count:

  • First frame: 1 image
  • First & last frames: 2 images
rolestring(Conditional)

Image role / purpose.

First frame

One image_url object; role is first_frame or omitted.

First & last frames

Two image_url objects; role is required:

  • First frame: first_frame
  • Last frame: last_frame

First and last images may be identical. If aspect ratios differ, the first frame wins and the last frame is cropped to match.

resolutionstring(Optional)

Video resolution.

  • doubao-seedance-2-0-260128: default 720p; options 480p, 720p, 1080p, 4k
  • doubao-seedance-2-0-fast-260128 / doubao-seedance-2-0-mini-260615: default 720p; options 480p, 720p

ratiostring(Optional)

Output aspect ratio. Default adaptive.

Options: 16:9, 4:3, 1:1, 3:4, 9:16, 21:9, adaptive

In first-frame / first-and-last modes, adaptive maps the first-frame aspect ratio to the nearest fixed enum.

Pixel sizes by resolution:

Resolution16:94:31:13:49:1621:9
480p864×496752×560640×640560×752496×864992×432
720p1280×7201112×834960×960834×1112720×12801470×630
1080p1920×10801664×12481440×14401248×16641080×19202206×946
4k3840×21603326×24942880×28802494×33262160×38404398×1886

durationinteger(Optional)

Output duration in seconds. Default 5; range [4, 15] or -1.

When duration = -1, the model chooses an integer duration within the valid range.

generate_audioboolean(Optional)

Whether the output includes synchronized audio. Default true.

Generated audio is always mono.

return_last_frameboolean(Optional)

Whether to return the last-frame image. Default false.

When true, query the task to get a watermark-free PNG matching the video size. Useful for chaining clips by using the previous last frame as the next first frame.

Responses

200: Task created successfully

Content-Type: application/json

400: Invalid request parameters

Content-Type: application/json

429: Rate limited

Content-Type: application/json

Request examples

curl -X POST "https://api.autorouter.top/api/v3/contents/generations/tasks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxxxxx" \
  -d '{
  "model": "doubao-seedance-2-0-260128",
  "content": [
    {
      "type": "text",
      "text": "Make this cat jump"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/cat.jpg"
      },
      "role": "first_frame"
    }
  ],
  "resolution": "720p",
  "duration": 5,
  "generate_audio": true
}'

Response examples

{
  "id": "cgt-2025xxxxxx-xxxxx"
}

Response fields:

NameTypeDescription
idstringTask ID (kept for 7 days). Poll the query API for results

GET /api/v3/contents/generations/tasks/{id}

Get Video Generation Task

Query the status and result of a video generation task.

  • Only the last 7 days of task records are queryable, in the interval [T-7 days, T), where T is the request UTC timestamp (second precision)
  • Video URLs are valid for 24 hours; download or transfer them promptly

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer auth. Format: Bearer sk-xxxxxx

Path Parameters

NameTypeRequiredDescription
idstringYesThe video generation task ID to query

Responses

200: Query succeeded

Content-Type: application/json

Request examples

curl -X GET "https://api.autorouter.top/api/v3/contents/generations/tasks/{id}" \
  -H "Authorization: Bearer sk-xxxxxx"

Response examples

{
  "id": "cgt-2025xxxxxx-xxxxx",
  "model": "doubao-seedance-2-0-260128",
  "status": "succeeded",
  "error": null,
  "created_at": 1730000000,
  "updated_at": 1730000060,
  "content": {
    "video_url": "https://ark-video-xxx.volces.com/xxx.mp4",
    "last_frame_url": "https://ark-video-xxx.volces.com/xxx.png"
  },
  "seed": -1,
  "resolution": "720p",
  "ratio": "16:9",
  "duration": 5,
  "framespersecond": 24,
  "generate_audio": true,
  "tools": [
    { "type": "web_search" }
  ],
  "safety_identifier": "user_hash_xxx",
  "priority": 0,
  "service_tier": "default",
  "execution_expires_after": 172800,
  "usage": {
    "completion_tokens": 108000,
    "total_tokens": 108000,
    "tool_usage": {
      "web_search": 1
    }
  }
}

Response fields:

NameTypeDescription
idstringVideo generation task ID
modelstringModel name and version used by the task (model-name-version)
statusstringTask status; see details below
errorobject / nullError info; null on success, error object on failure
created_atintegerTask creation Unix timestamp (seconds)
updated_atintegerUnix timestamp (seconds) when the task status was last updated
contentobjectTask output content
content.video_urlstringGenerated video URL (mp4). Valid for 24 hours
content.last_frame_urlstringLast-frame image URL. Valid for 24 hours. Returned only when create used "return_last_frame": true
seedintegerSeed integer used for this request
resolutionstringOutput video resolution
ratiostringOutput video aspect ratio
durationintegerOutput duration in seconds. Mutually exclusive with frames in the response; returned when create did not specify frames
framesintegerOutput frame count. Mutually exclusive with duration; returned when create specified frames
framespersecondintegerOutput frame rate
generate_audiobooleanWhether the video includes synchronized audio. Returned for Seedance 2.0 series
toolsobject[]Tools actually used for this request. Omitted when no tool was used
tools[].typestringTool type used, e.g. web_search
safety_identifierstringEnd-user identifier. Echoed when set at create time
priorityintegerExecution priority of the request
service_tierstringService tier that actually processed the task
execution_expires_afterintegerTask timeout threshold in seconds
usageobjectToken usage for this request
usage.completion_tokensintegerTokens consumed to generate the video; usable for billing reconciliation
usage.total_tokensintegerTotal tokens for the request. Input tokens are not counted for video models, so total_tokens = completion_tokens
usage.tool_usageobjectTool usage counters
usage.tool_usage.web_searchintegerNumber of web-search calls; returned only when web search was enabled

statusstring

Task status:

  • queued: waiting in queue
  • running: running
  • cancelled: cancelled (auto-deleted after 24h; only queued tasks can be cancelled)
  • succeeded: succeeded
  • failed: failed
  • expired: timed out

Poll every 3–5 seconds until status is succeeded, failed, cancelled, or expired.

errorobject / null

Error details. null on success; error data on failure.

codestring

Error code.

messagestring

Error message.

contentobject

Output content of the video generation task.

video_urlstring

Generated video URL in mp4 format. Valid for 24 hours; download or transfer promptly.

last_frame_urlstring

Last-frame image URL. Valid for 24 hours; download or transfer promptly.

Returned only when create used "return_last_frame": true.

generate_audioboolean

Whether the output video includes synchronized audio. Returned for Seedance 2.0 series.

  • true: with synchronized audio
  • false: silent video

usageobject

Token usage for this request.

completion_tokensinteger

Tokens consumed to generate the video; usable for billing reconciliation.

Note: Seedance 2.0 series has a minimum token usage. If actual usage is below the minimum, this field returns the minimum and billing uses that minimum.

total_tokensinteger

Total tokens for the request. Video models do not count input tokens (0), so total_tokens = completion_tokens.

tool_usageobject

Tool usage counters.

  • web_search (integer): number of web-search calls; returned only when web search was enabled

Error handling

HTTP 400

CaseSuggestion
Missing imageFirst frame needs 1 image; first & last need 2 with required role
Mixed modesDo not mix first-frame, first & last, and reference-to-video
Invalid image format / sizeFollow image_url.url limits
Fast / Mini with 1080p or 4kUse 480p / 720p, or switch to the standard model

HTTP 401 / 403

  • 401 Unauthorized: Invalid or expired API Key
  • 403 Forbidden: API Key not allowed for this model

HTTP 402

Insufficient balance. Top up in the AutoRouter console.

Task failed / expired

CauseSuggestion
Content moderationAdjust prompt or reference image
Image URL unreachableUse a public URL, Base64, or asset ID
Unauthorized real faceUse virtual avatars, authorized assets, or recent Seedance outputs
TimeoutIncrease execution_expires_after and retry

Failed tasks are automatically refunded.

On this page