Skip to main content
Create a key in the dashboard. A scoped key needs runs:write to submit and runs:read to retrieve. Authentication covers revocation and where to keep keys.

Generate a video

Submit a prompt and the model’s parameters to /v1/run/{model_id}. The example below uses MiniMax H3, which takes a length in seconds, a quality tier, and an aspect ratio. It returns video with sound.
The response is a 202 with a run ID. Generation continues in the background.
credit_estimate is a hold on your balance, and a run that produces no output releases it. Rates change, so read the estimate from the response rather than hard-coding the number above. Idempotency-Key is any string you choose, and sending the same one twice returns this same 202 instead of generating twice.

Wait for the file

Poll status_url about once a second until status reaches completed, failed, or canceled. It reports state without carrying the file.
How long a run takes depends on the model, the length you asked for, and current load. While it waits, queue_position counts the runs ahead of it. Once it starts, progress tracks it to completion. Fetch the run once it completes:

The whole sequence

The curl version uses jq to read fields from each response.
Only the body changes between models. Field names, defaults, and bounds come from the model’s catalog entry. Runs documents the rest of the run API.

Failures

A failed generation puts error on both the status payload and the run. Branch on error.code. Exceeding your concurrency returns 429 with run.concurrency_exceeded. An empty balance returns 402 with insufficient_credit_balance. Errors lists the rest.