Generate videos
Create and retrieve asynchronous video generations
Create a generation
POST /v1/videos/generations returns HTTP 202.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | yes | Stable model ID from GET /v1/models |
prompt | string | yes | 1–5,000 characters |
image_url | HTTPS URL | no | Enables image-to-video |
duration | integer | no | 5 by default; model-dependent |
aspect_ratio | string | no | 16:9 by default |
negative_prompt | string | no | Up to 2,000 characters |
webhook_url | HTTPS URL | no | Completion callback destination |
metadata | object | no | String-to-string values returned with task input |
Send a unique Idempotency-Key header (maximum 191 characters) for every
logical request. Retrying with the same key returns the original task without
charging credits again.
Input requirements are model-specific. Kling 2.1 Standard requires
image_url; Kling 2.1 Master also supports text-only requests. Read the live
inputs array from GET /v1/models before submitting.
Retrieve a generation
GET /v1/videos/generations/{id} returns only tasks owned by the current API
key's account.
Possible statuses are pending, processing, success, failed, and
canceled. On success, output is an array of objects containing a url and,
when available, thumbnail_url. On failure, the response includes an error
object and reserved credits are restored.