Generate Video
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The template ID |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
variables | object | Yes | Key-value map of variable values. Text variables are strings. Image/video variables are URLs (HTTP or S3). |
webhook_url | string | No | URL to receive a POST callback when generation completes or fails. |
Request
Response
Response fields
| Field | Type | Description |
|---|---|---|
generations | array | List of generation objects (one per video) |
generations[].generation_id | string | Unique generation ID for polling status |
generations[].status | string | Always "generating" on success |
template_id | string | The template used for generation |
credits_charged | number | Total credits deducted |
Variable values
- Text variables: Provide a string value. If omitted, the template’s
default_valueis used. - Image variables: Provide an HTTP(S) URL to the image. The server downloads and uploads it to S3 automatically. You can also provide an S3 key if you’ve pre-uploaded the file.
- Video variables: Same as image — provide an HTTP(S) URL or S3 key.
- Required variables: If a required variable has no value and no default, the request returns
400.
Webhook callback
Ifwebhook_url is provided, the server POSTs to that URL when the generation completes or fails:
Errors
| Status | Error | When |
|---|---|---|
| 400 | validation_error | Missing required variables or invalid input |
| 401 | unauthorized | Missing or invalid API key |
| 402 | insufficient_credits | Not enough credits for generation |
| 403 | forbidden | API key lacks templates:read scope |
| 404 | not_found | No template exists with the given ID |
| 422 | invalid_template | Template has invalid configuration |
| 500 | generation_error | Unexpected server error during generation |

