Generate video

Queues a video generation and returns the task straight away. Video takes minutes rather than seconds, so a webhook is the better way to hear about it than polling.

POST/video/generate
AuthAPI keyorOAuth tokenHow to send it

Creates a video task on the model you name. There is no auto and no count: one request renders one video. A render takes minutes, so plan for a webhook rather than holding a request open.

Resolution, duration, audio, and frame inputs are checked against the model at create. Video models lists what each model accepts, and generate video covers the result.

Request body#

modelstringrequired
"bytedance/seedance-2.0-mini""google/gemini-omni-flash-1.1""prunaai/p-video""xai/grok-imagine-video-1.5"
promptstringrequired

Positive prompt.

e.g. "A cat surfing a wave at sunset"≥ 1 characters≤ 8192 characters
accessobject

Controls whether the create-task response should include a short-lived Public Access Token.

That token can be passed to browser or client-side code for polling task status and task videos without exposing your API key.

patobjectrequired
enabledboolean
default true
audioboolean

Enable model-native generated audio. Only supported by models with audio capability.

durationnumber

Video duration in seconds. Defaults to the model's default duration.

≥ 1≤ 60
inputs(string | object)[]
≤ 5 items
sourceobjectrequired
type"url"required
urlstringrequired
type"image"required
asstring
"auto""first_frame""last_frame""reference"
metadataobject
negative_promptstring
≤ 8192 characters
resolutionstring

Resolution tier. Defaults to the model's default tier.

"1080p""480p""4k""720p"
webhookobject
customobject[]
≥ 1 items≤ 5 items
urlstringrequired
dashboardboolean

Set to false to disable dashboard-managed webhooks for this task. Request-level custom webhooks are still sent.

Response#

Video generation task created

dataobjectrequired
estimatedCoststringrequired

Estimated cost in USD reserved for this task. Failed videos are refunded, so the final cost may be lower.

e.g. "0.05"
taskIdstringrequired

Task ID

e.g. "tsk_01KE7XWWEQ4MCGWKBQKJ1G47RP"
accessobject

Returned when access.pat.enabled is true.

Currently the generate endpoint only returns a Public Access Token.

publicAccessTokenstringrequired

Short-lived Public Access Token for polling task status and video results.

This token is safe to return to frontend code and can be used instead of your API key for polling public task state.

e.g. "pat_eyJhbGciOi..."

Errors#

A failed call names what went wrong in code, with a sentence in message. The codes, which of them are worth retrying, and how to read a validation failure are on Errors.