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"promptstringrequiredPositive prompt.
e.g. "A cat surfing a wave at sunset"≥ 1 characters≤ 8192 charactersaccessobjectControls 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.
patobjectrequiredenabledboolean- default true
audiobooleanEnable model-native generated audio. Only supported by models with audio capability.
durationnumberVideo duration in seconds. Defaults to the model's default duration.
≥ 1≤ 60inputs(string | object)[]- ≤ 5 items
sourceobjectrequiredtype"url"requiredurlstringrequired
type"image"requiredasstring"auto""first_frame""last_frame""reference"
metadataobjectnegative_promptstring- ≤ 8192 characters
resolutionstringResolution tier. Defaults to the model's default tier.
"1080p""480p""4k""720p"webhookobjectcustomobject[]- ≥ 1 items≤ 5 items
urlstringrequired
dashboardbooleanSet to false to disable dashboard-managed webhooks for this task. Request-level custom webhooks are still sent.
Response#
Video generation task created
dataobjectrequiredestimatedCoststringrequiredEstimated cost in USD reserved for this task. Failed videos are refunded, so the final cost may be lower.
e.g. "0.05"taskIdstringrequiredTask ID
e.g. "tsk_01KE7XWWEQ4MCGWKBQKJ1G47RP"accessobjectReturned when
access.pat.enabledis true.Currently the generate endpoint only returns a Public Access Token.
publicAccessTokenstringrequiredShort-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.