Skip to main content
What you need: one API key starting with vg_ and either an active credit balance or an active Unlimited package.
1

Create a job

POST /api/v1/generate accepts a prompt, a model name, and a few parameters. The answer is 202 Accepted — the job is queued, not finished.
2

Read the response

The structure is always the same:
Store job.id. Everything that happens next is read through that id.
creditsCharged was already deducted at this step. If the job eventually fails, the credits are refunded automatically — but if you resend the same prompt without an idempotencyKey, you will pay twice.
3

Poll until it finishes

GET /api/v1/jobs/{jobId} returns the latest status. Check every 5 seconds; short clips usually finish within a few minutes, but queue length plays a part.
Possible statuses: queued, dispatching, processing, succeeded, failed, cancelled. Until the status is succeeded, the result field is null.
4

Download and store it

result.url is guaranteed to be publicly accessible for 24 hours. After that the link stops working.
Save the file to your own storage (S3, R2, disk) as soon as the status is succeeded. Do not keep the URL as your archive.

Common next steps