POST /v2/videos/generations to start a video generation. Video generation is asynchronous, so you submit once, poll for status, and download the finished asset when it’s ready.
The generation flow
1
Submit a generation request
POST to
/v2/videos/generations with your model, prompt, and parameters. The API returns HTTP 202 with a generation ID and status: "pending".2
Poll for completion
GET
/v2/videos/generations/{id} periodically. The status will be pending, failed, or completed.3
Download the video
When status is
completed, download the video from the signed download URL in data[0].url.Step 1: Submit
Step 2: Poll for status
Poll the status endpoint with your generation ID.Polling strategy
Poll every 5 seconds as a starting point. Set a timeout so your integration stays responsive and does not poll forever.Step 3: Download
Theurl in each data item is a signed download URL. Generated media is retained for 24 hours, and the URL expires at the deletes_at timestamp.
Parameters
Using frame and reference images
Pass up to 20 images in theimages array. Each item needs a url and a role.
Video models support these roles:
first_frame: the opening frame of the videolast_frame: the closing frame of the video. This always requires afirst_frame.reference_image: a style or content reference when you need the output to stay closer to an existing visual direction. You cannot combine it withfirst_frameorlast_frame.
Not all models support all roles. A model’s
supported_references field lists the roles it accepts and the maximum count for each. See Models. Unsupported roles return 400 with code invalid_parameter.Image sources
url accepts either form:
- a publicly accessible HTTPS URL
- a base64 data URL, such as
data:image/png;base64,...
data: prefix is rejected.
Failure states
Video generations can fail after submission.- If polling returns
status: "failed", treat that generation as terminal. - Read
error.messagefor the reason. - Fix the input, wait if the problem is temporary, or submit a new generation.
Sound
Setsound: true to generate audio. Supported models are listed on the Models page.