API v1

Create a video task

POST/v1/video/generations

Submit a prompt with optional images, videos or audio to create an asynchronous generation task; the task ID and the reserved amount come back at once.

View Markdown
  • Put your API key after Authorization: Bearer in the request header.
  • Send an Idempotency-Key: when the outcome is unknown, retry with the same key and body to create one task and be charged once.
  • Generation runs in the background: poll Retrieve a video task or receive task.completed at your callback_url.
  • Funds are reserved for the upper bound at creation and settled on actual usage; failed and cancelled tasks are free.

Headers

#AuthorizationstringRequired

Bearer, a space and your API key. A missing or invalid key returns 401 authentication_failed.

#Content-TypestringRequired

The body is JSON: application/json.

#X-Request-IDstring

Your own request identifier. An invalid or repeated value is replaced; the value used comes back in the X-Request-ID response header.

#Idempotency-KeystringRequired

Generate a new value for every new request and save it; it starts with a letter or digit. When the outcome is unknown, retry with the same key and the original body to get the original response; the same key with a different body returns 409 idempotency_conflict. Keys belong to your team, not to one API key.

Length8–128CharactersA–Z a–z 0–9 . _ : -

Request bodyapplication/json · Required

The body accepts only the fields below; any other field is rejected.

#modelstringRequired

ID of the model used for this request.

dreamina-seedance-2-0-260128Seedance 2.0
dreamina-seedance-2-0-fast-260128Seedance 2.0 Fast
dreamina-seedance-2-0-mini-260615Seedance 2.0 Mini
#contentarrayRequired

Platform limits: 9 images, 3 videos and 3 audio items, 15 materials and 16 content items. Each video or audio clip lasts 2 to 15 seconds; video and audio totals are each at most 15 seconds. The platform downloads, scans, stores and reviews HTTPS inputs before generation. Preparation failure releases the whole reservation at zero charge. Known preparation failures include their content_index.

Items1–16
Each item matches exactly one of these shapes.
#typestringRequired

Identifies the kind of input item.

Alwaystext
#textstringRequired

Prompt describing the video to generate.

Length1–10000
#resolutionstring

Output resolution. Seedance 2.0 Fast and Mini accept only 480p or 720p.

Default720pOne of480p720p1080p
#ratiostring

Aspect ratio of the output image.

DefaultadaptiveOne ofadaptive21:916:94:31:13:49:16
#durationinteger

Output duration in whole seconds from 4 to 15; the default is 5.

Default5Range4–15
#generate_audioboolean

Whether to generate audio with the video.

Defaultfalse
#seedinteger

Random seed; the default -1 means random.

Range-1–4294967295Default-1
#watermarkboolean

Whether to add a watermark to the output.

Defaultfalse
#callback_urlstring

The address that receives the callback when the task ends. It must match, byte for byte, a callback address of your team that is verified in the console, not removed and not expired; otherwise 400 callback_target_not_verified. A retry with the same Idempotency-Key cannot add, drop or change it; that returns 409 idempotency_conflict.

Length1–2048Formathttps://
Parameters not supported yet7
return_last_frame

Setting it to true returns 400 unsupported_capability.

draftoutput_formatomni_reference_task_typeexecution_expires_afterprioritysafety_identifier

The current models do not take these; sending one returns 400 invalid_request.

ReturnsHTTP 202

Accepted: the task is created and the funds are reserved. The Location response header is the task's lookup path.

#idstringRequired

Task ID assigned by the platform.

Length4–128CharactersA–Z a–z 0–9 _ -
#objectstringRequired

Identifies the kind of object returned.

Alwaysvideo.task
#request_idstringRequired

Request ID used to correlate this task.

Length4–128CharactersA–Z a–z 0–9 _ -
#billing_correlation_idstringRequired

Billing correlation ID for this task.

Length4–128CharactersA–Z a–z 0–9 _ -
#modelstringRequired

ID of the model used for this request.

dreamina-seedance-2-0-260128Seedance 2.0
dreamina-seedance-2-0-fast-260128Seedance 2.0 Fast
dreamina-seedance-2-0-mini-260615Seedance 2.0 Mini
#statusstringRequired

Current state; see the value notes for its meaning.

Alwaysqueued
#phasestring

The inputs are being prepared before generation starts.

Alwayspreparing_assets
#settlement_statusstringRequired

Current progress of billing settlement.

Alwaysreserved
#quoteobjectRequired

Reservation quote recorded when the task is accepted.

6 child fields
#currencystringRequired

Currency of the amounts: USD.

AlwaysUSD
#reserved_amountstringRequired

Amount that must be reserved to accept the task.

Format6 decimal places
#meter_typestringRequired

The meter used to record usage.

Alwaysseedance_video_generation
#estimated_usage_upper_boundobjectRequired

Upper estimate of usage for the reservation.

1 child fields
#video_tokensintegerRequired

Number of video tokens. The field type determines whether an actual usage value may be null.

Range≥ 1
#price_versionstringRequired

Version of pricing applied to this quote.

Length4–128CharactersA–Z a–z 0–9 _ -
#quote_policy_versionstringRequired

Version of the policy used to calculate the reservation quote.

Length1–128CharactersA–Z a–z 0–9 . _ : -
#created_atintegerRequired

Creation time as whole seconds since the Unix epoch.

Range≥ 0

Response headers

#X-Request-IDstringRequired

The identifier of this request: the valid value you sent, or its replacement.

#LocationstringRequired

Canonical relative lookup path for the accepted object.

Status codes

Each error.code and what to do about it is on Error codes.

StatusMeaning and error.code
202Accepted: the task is created and the funds are reserved.
Response headersLocation
400The format or parameters are wrong, or a referenced asset or callback address cannot be used.
401The API key is missing or invalid.
Response headersWWW-Authenticate
409The idempotency key conflicts or its replay has expired, the API key is not ready, or an asset is still processing.
429The balance is too low, requests come too fast, or asset storage is full.
Response headersRetry-After
500Internal error.
503The service is temporarily unavailable, or new tasks are paused.