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
AfterPOST /v1/videos, store at least:
idmodel- current
status - the user or job that owns the task
- submission time
3. Poll with backoff
Poll every 10 to 20 seconds while a task isqueued 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
Passwebhook 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
429and temporary5xxresponses 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.