Skip to main content
Video generation can take several minutes and must not depend on one long-lived HTTP request. Treat each submission as a durable task.

1. Validate before submitting

Use the selected model page to validate duration, framing, and reference rules in your own application. Do not submit familySlug. It is not part of the public API.

2. Persist the returned task

After POST /v1/videos, store at least:
  • id
  • model
  • current status
  • the user or job that owns the task
  • submission time
You need the exact model ID in the poll and download query parameter.

3. Poll with backoff

Poll every 10 to 20 seconds while a task is queued or in_progress. Stop on completed or failed.

4. Download promptly

Stream the completed MP4 to storage instead of buffering the entire file in memory.

5. Prefer webhooks at scale

Pass webhook and an optional webhook_secret when submitting. Acknowledge deliveries with 2xx, process asynchronously, and deduplicate on task ID plus status.

Webhook contract

Verify signatures, retries, and final-state payloads.

Task status

Use the normalized task API for reconciliation.

Failure rules

  • Retry 429 and temporary 5xx responses with exponential backoff and jitter.
  • Do not retry invalid duration, aspect ratio, model ID, key, or balance without changing the request.
  • Treat webhooks as notifications. Re-fetch critical results before committing downstream state.
  • Download completed media to your own storage before its result URL expires.