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. File variables (image, video, audio) can be URLs, uploads, data URIs, or S3 keys depending on how you submit the request. |
character_variables | object | No | Map of image variable keys to character IDs from GET /api/characters or POST /api/characters. Only supported for ingredients-to-video templates. For the same key, this overrides variables[key] and template default_value. |
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 |
latency_estimate_sec | object or null | Estimated generation latency window for the selected model/mode |
latency_estimate_sec.typical | number | Typical completion time in seconds |
latency_estimate_sec.busy | number | Busy-period completion time in seconds |
latency_estimate_sec to choose a polling cadence for GET /api/generations/:id (for example, every typical / 6 seconds, clamped to 10-30s).
Variable values
- Text variables: Provide a string value. If omitted, the template’s
default_valueis used. - Image variables: Provide an HTTP(S) URL, an S3 key, a base64 data URI, or upload the file with
multipart/form-data. - Video variables: Same as image — HTTP(S) URL, S3 key, data URI, or multipart upload.
- Audio variables: Same as image/video — HTTP(S) URL, S3 key, data URI, or multipart upload.
- Required variables: If a required variable has no value and no default, the request returns
400. - Character variables: For
ingredients-to-videotemplates, provide character IDs keyed by image variable name (for example"personImage": "character-id"). IDs can come from public characters or private characters you created with your own API key.
Image input precedence
For image variable keys (for examplepersonImage, productImage), generation resolves values in this order:
character_variables[key](Prism character ID)variables[key](image URL/S3 key/data URI/upload)- template
default_value
- Public HTTP(S) URLs are downloaded by the server and re-hosted before generation.
- Base64 data URIs are converted to hosted files automatically.
- S3 keys are accepted for files you’ve already uploaded into Prism storage.
- Send
multipart/form-dataand attach the file directly tovariables[KEY]. - Example:
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 |

