v8

OpenAPI 3.1.02026-08-033623795.0 MB
Media

Generate Media Asset

Starts an AI media generation job billed from the account's balance. Generation is asynchronous — poll GET /media/{id} until the asset is ready, then use file.id anywhere attachments are accepted.

post/media/generate

Headers

Idempotency-Keystring
Example:d9105228-4a08-46b1-8b91-42fed586d383

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

Request body

account_idstring

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

duration_seconds5 | 10 | 15

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

promptstring required

What to generate. Up to 2,000 characters.

reference_mediastring[]

Optional reference image file IDs (file_ prefixed), up to 4. For video, a single reference seeds the opening frame; multiple references guide subject and style instead.

resolution'480p' | '720p' | '1080p' | '4k'

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.

type'video' | 'image' required

The kind of media to generate.

Response

Generation started.

amount_chargednumber nullable required

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

completed_atstring nullable required

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

created_atstring required

ISO 8601 timestamp when the generation was requested.

currencystring required

Currency of amount_charged. Always usd.

error_messagestring nullable required

Why generation failed. null unless status is failed.

idstring required

Media asset ID, prefixed media_.

media_type'video' | 'image' required

The kind of media this asset holds.

source'generated' required

How the asset was created. Always generated.

status'processing' | 'ready' | 'failed' required

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

Example response

{
  "generation": {
    "resolution": "480p"
  },
  "media_type": "video",
  "source": "generated",
  "status": "processing"
}