Skip to main content
POST
TypeScript

Autorisaties

Authorization
string
header
vereist

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

Headers

Idempotency-Key
string

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

Maximum string length: 255
Voorbeeld:

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

Body

application/json
prompt
string
vereist

What to generate. Up to 2,000 characters.

Voorbeeld:

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

type
enum<string>
vereist

The kind of media to generate.

Beschikbare opties:
video,
image
Voorbeeld:

"video"

account_id
string

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

Voorbeeld:

"biz_xxxxxxxxxxxxxx"

duration_seconds
enum<integer>

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

Beschikbare opties:
5,
10,
15
Voorbeeld:

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.

Beschikbare opties:
480p,
720p,
1080p,
4k
Voorbeeld:

"1080p"

Respons

Generation started.

amount_charged
number | null
vereist

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

Voorbeeld:

2.5

completed_at
string | null
vereist

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

Voorbeeld:

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

created_at
string
vereist

ISO 8601 timestamp when the generation was requested.

Voorbeeld:

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

currency
string
vereist

Currency of amount_charged. Always usd.

Voorbeeld:

"usd"

error_message
string | null
vereist

Why generation failed. null unless status is failed.

Voorbeeld:

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

file
object | null
vereist

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

generation
object
vereist

The inputs the asset was generated from.

id
string
vereist

Media asset ID, prefixed media_.

Voorbeeld:

"media_xxxxxxxxxxxxxx"

media_type
enum<string>
vereist

The kind of media this asset holds.

Beschikbare opties:
video,
image
Voorbeeld:

"video"

source
enum<string>
vereist

How the asset was created. Always generated.

Beschikbare opties:
generated
Voorbeeld:

"generated"

status
enum<string>
vereist

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

Beschikbare opties:
processing,
ready,
failed
Voorbeeld:

"ready"