Kling Video V4 API

A multimodal video model that generates clips from text, first and last images, or a reference video.

POST /v1/videos/generations

Text-to-video, initial and final frame image generation, and reference video generation, supporting asynchronous submission and task query.

Text-to-video

Required parameters: model

Available parameters: model, prompt, contents, settings, options, wait, nonce

First and last frame image generation

Required parameters: model

Available parameters: model, prompt, contents, settings, options, wait, nonce

Reference Video

Required parameters: model

Available parameters: model, prompt, contents, settings, options, wait, nonce

Request parameters

ParameterTypeRequiredDescription
modelstringYesFixed model name Options: kling-video-v4
promptstringNoTop-level prompt; prompt text from contents takes precedence
contentsarrayNoImage-to-video with reference materials list, restrictions see details below
settingsobjectNooptional generation settings; take precedence over top-level compatibility fields if provided
optionsobjectNogeneral options
waitbooleanNodefault false, recommended to query task status after submission
noncestringNosame business request uses the same and unique idempotency key
When generation fails, the task query still returns the task object; please check the top-level status and error. Temporary result URLs should be saved promptly.

Request example

curl --request POST 'https://api.router.ai/v1/videos/generations' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-binary '{
    "model": "kling-video-v4",
    "prompt": "A fictional blue paper cube rotates slowly on a white table.",
    "settings": {"resolution": "1080p", "duration": 3, "aspect_ratio": "16:9"},
    "wait": false,
    "nonce": "EXAMPLE_KLING_V4_TEXT_001"
  }'

Endpoint reference: Aliyun Wan video generation