Skip to main content
POST
TypeScript

Autorizaciones

Authorization
string
header
requerido

An Account API key, an App API key, an account access token, an account-scoped user token, or a user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************. See Auth & API keys for how to get each one.

Scopes

media:generate

Encabezados

Idempotency-Key
string

A unique key that makes this request safe to retry. See Idempotent requests.

Maximum string length: 255
Ejemplo:

"d9105228-4a08-46b1-8b91-42fed586d383"

Cuerpo

application/json
prompt
string
requerido

What to generate. Up to 2,000 characters.

Ejemplo:

"A 9:16 product showcase of a cordless power scrubber"

type
enum<string>
requerido

The kind of media to generate.

Opciones disponibles:
video,
image
Ejemplo:

"video"

account_id
string

Account ID, prefixed biz_. Defaults to the account the API key belongs to.

Ejemplo:

"biz_xxxxxxxxxxxxxx"

duration_seconds
enum<integer>

Video length in seconds. Video only; defaults to 5.

Opciones disponibles:
5,
10,
15
Ejemplo:

5

reference_media
string[]

Optional reference file IDs (file_ prefixed), up to 4. Images guide the output: for video, a single image seeds the opening frame; multiple images guide subject and style instead. Include one video to remake it: its motion and scene are kept and the images are swapped in. Video only; needs an image and can't be combined with duration_seconds. The output matches the video's length, up to 30 seconds, and is billed on it.

resolution
enum<string>

Video resolution. Video only; defaults to 1080p. 1080p is not supported by Seedance 2.0 Fast or Mini; 4k is only supported by Seedance 2.0.

Opciones disponibles:
480p,
720p,
1080p,
4k
Ejemplo:

"1080p"

Respuesta

Generation started.

amount_charged
number | null
requerido

USD amount charged to the account's balance for this generation. null if the generation wasn't billed.

Ejemplo:

2.5

completed_at
string | null
requerido

ISO 8601 timestamp when the asset reached a terminal state. null while processing.

Ejemplo:

"2026-01-01T12:00:00.000Z"

created_at
string
requerido

ISO 8601 timestamp when the generation was requested.

Ejemplo:

"2026-01-01T12:00:00.000Z"

currency
string
requerido

Currency of amount_charged. Always usd.

Ejemplo:

"usd"

error_message
string | null
requerido

Why generation failed. null unless status is failed.

Ejemplo:

"The generation provider rejected the prompt. The charge was refunded."

file
object | null
requerido

The produced file, usable anywhere attachments are accepted. null until the asset is ready.

generation
object
requerido

The inputs the asset was generated from.

id
string
requerido

Media asset ID, prefixed media_.

Ejemplo:

"media_xxxxxxxxxxxxxx"

media_type
enum<string>
requerido

The kind of media this asset holds.

Opciones disponibles:
video,
image
Ejemplo:

"video"

source
enum<string>
requerido

How the asset was created. Always generated.

Opciones disponibles:
generated
Ejemplo:

"generated"

status
enum<string>
requerido

Lifecycle state: processing while generation runs, ready when the file is available, failed when generation failed and the charge was refunded.

Opciones disponibles:
processing,
ready,
failed
Ejemplo:

"ready"