kling-video-motion-control-v3.0 API
Generates 720p or 1080p video using a character image and a motion reference, with an optional existing subject. Output follows the effective motion. Reference clips are 3–30 seconds subject to character orientation. Duration and aspect_ratio cannot be set.
- Model:
kling-video-motion-control-v3.0 - Provider: Kling
- Type: video
POST /v1/videos/generations
Use a reference video to animate a person in an image. You can also reference an existing subject.
Image plus action video
Required parameters: model, contents, settings
Available parameters: model, prompt, contents, settings, options, wait, nonce, idempotency_key
Request parameters
| Parameter | Type | Required | Description |
|---|
model | string | Yes | Target video model Options: kling-video-motion-control-v3.0 |
prompt | string | No | Fill in when using V3/Turbo text-to-video; when using the contents, specify text in type=prompt. |
contents | array | Yes | Pass text or URL based on material type; action control provides both image and video. |
settings | object | Yes | 720p, 1080p; character orientation references reference video for 3~10 seconds when image is provided, 3~30 seconds when video is provided. |
options | object | No | Optional watermark and external business identifiers |
wait | boolean | No | false: returns task ID immediately after submission; true: returns current task status after a delay |
nonce | string | No | Generate a new nonce upon new generation; in case of exception, reuse the original value |
idempotency_key | string | No | Compatibility field, not used as basis for current video deduplication |
resolution | string | No | compatible field; not added if settings object is present |
first_frame_url | string | No | assembles first frame when no non-empty contents; converts action control to image |
reference_images | array | No | Assemble reference images when contents is not empty; action control is limited to one image |
reference_videos | array | No | Assemble reference videos when contents is not empty; only one segment, adhering to scene constraints |
character_orientation | string | No | Compatible with orientation field; recommended to place in settings |
audio | string | No | compatible audio field; conforms to model and material combination restrictions |
generate_audio | boolean | No | compatible boolean field; does not indicate model support for audio generation |
## Parameter details
Optional prompt up to 2500 characters; actions are provided by reference video, and text describes character appearance or scene.
The request body uses JSON; the dot notation below represents nested fields, for example, `settings.resolution` is written inside the `settings` object.
| Field | Type | Required | Description |
|---|---|---|---|
| `model` | string | Yes | Target video model; optional kling-video-motion-control-v3.0 |
| `prompt` | string | No | Fill in when using V3/Turbo text-to-video; when using the contents, specify text in type=prompt. |
| `contents` | array | Yes | Pass text or URL based on material type; action control provides both image and video. |
| `contents[].type` | string | Yes | Select based on current model and scene; optional prompt, image, video, element |
| `contents[].text` | string | No | Required when type=prompt |
| `contents[].url` | string | No | Image/video type is required, public HTTPS address |
| `contents[].element_id` | string | No | Required when type=element, valid subject ID already exists |
| `contents[].id` | string | No | voice and action control element use a unique reference name within the task |
| `settings` | object | Yes | 720p, 1080p; character orientation references reference video for 3~10 seconds when image is provided, 3~30 seconds when video is provided. |
| `settings.resolution` | string | No | output clarity; optional 720p, 1080p; default is "720p" |
| `settings.character_orientation` | string | Yes | Character orientation; image duration up to 10 seconds, video up to 30 seconds; optional image, video |
| `settings.audio` | string | No | Original audio or silent; optional original, off; default is "original" |
| `options` | object | No | Optional watermark and external business identifiers |
| `options.external_task_id` | string | No | Business identifier; the current site still uses the returned ID for query |
| `options.watermark_info` | object | No | Watermark options |
| `options.watermark_info.enabled` | boolean | No | Enable watermark |
| `wait` | boolean | No | false: returns the task ID immediately after submission; true: returns the current task status after a delay. Default is false |
| `nonce` | string | No | Generate a new nonce upon new generation; in case of exception, reuse the original value |
| `idempotency_key` | string | No | Compatibility field, not used as basis for current video deduplication |
## Query and response
`GET /v1/videos/generations/{id}` queries a single task. `GET /v1/videos/generations?limit=20&offset=0` retrieves the task list, returning `data`, `total`, `limit`, `offset`
pending / submitted / processing indicates in progress; succeeded indicates successful generation; failed / timeout / canceled indicates the task has ended.
| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | No | Original query task ID preserved exactly |
| `model` | string | No | Public model |
| `status` | string | No | Official status; optional values: pending, submitted, processing, succeeded, failed, timeout, canceled, unknown |
| `created_at` | integer | No | Unix timestamp |
| `error` | object | No | Success is typically null; failure may include code and message |
| `error.code` | string | No | Error code |
| `error.message` | string | No | Error message |
| `request_id` | string | No | Request identifier, not the task ID |
| `code` | integer | No | Model result business code |
| `message` | string | No | Result description |
| `data` | array | No | Final model result list; must tolerate and be compatible with object shapes |
| `data[].id` | string | No | Task identifier |
| `data[].status` | string | No | Model result status |
| `data[].message` | string | No | Task description |
| `data[].create_time` | integer | No | Unix milliseconds |
| `data[].update_time` | integer | No | Unix milliseconds |
| `data[].outputs` | array | No | Video result |
| `data[].outputs[].type` | string | No | video |
| `data[].outputs[].id` | string | No | Output identifier, not the query task ID |
| `data[].outputs[].url` | string | No | Temporary video URL, save promptly |
| `data[].outputs[].duration` | string | No | Output duration in seconds, may include decimals; compatible with number type |
| `data[].usage` | object | No | Optional native statistics; absence does not imply 0 |
| `data[].usage.prompt_tokens` | integer | No | Native input tokens; unknown if not provided |
| `data[].usage.input_tokens` | integer | No | Optional native input alias, retain according to actual field |
| `data[].usage.completion_tokens` | integer | No | Native output tokens; no cross-coverage value filling |
| `data[].usage.output_tokens` | integer | No | Optional native output alias, retain according to actual field |
| `data[].usage.total_tokens` | integer | No | Total native count, may differ from official billing total; no additional charges |
| `tokenhub_usage` | object | No | Official billing and reconciliation standard; no overlap with native statistics |
| `tokenhub_usage.total_tokens` | integer | No | Valid non-negative integer, including explicit 0; actual cost uses official total |
| `usage` | object | No | Quota, may be an alias of official quota or native statistics, cannot be billed again |
| `usage.prompt_tokens` | integer | No | Native input tokens; unknown if not provided |
| `usage.input_tokens` | integer | No | Optional native input alias, retain according to actual field |
| `usage.completion_tokens` | integer | No | Native output tokens; no cross-coverage value filling |
| `usage.output_tokens` | integer | No | Optional native output alias, retain according to actual field |
| `usage.total_tokens` | integer | No | Determined by field source, cannot be duplicated with tokenhub_usage |
Top-level `usage.total_tokens` represents the total usage of the task returned, which may include input from reference video; when verifying usage, do not rely solely on output duration. `tokenhub_usage` and `data` contain raw usage details and input/output sub-items only when provided in the response; different metrics are not additive, and absence does not indicate 0. The time, identifiers, media, and token numbers in the example are all fictional data.
## Retries and new tasks
When request results are unclear, first query the original task; if no task ID is obtained, check the task list. For exception recovery, retain the original request content and `nonce`, and do not change the nonce in consecutive POST requests. A new nonce must be generated if a new request is needed. `idempotency_key` is a compatibility field and does not participate in the current video deduplication at this site; it cannot replace the nonce or provide independent idempotency guarantees. After a regular task completes, deduplication mappings may be released, and thus permanent deduplication cannot be guaranteed; requests that have been closed and retained with barriers do not imply they can be regenerated again. Retain the task ID and request ID for verification.
## Common errors
| HTTP status | Processing notes |
|---|---|
| 400 | Parameter, material, billing mode, or current capability not supported |
| 401 | Invalid token |
| 403 | Insufficient permissions |
| 402 | Insufficient available balance or reservation failed |
| 404 | Task not found or unauthorized access |
| 409 | Original submission pending confirmation; nonce not changed |
| 422 | Public Schema or JSON validation failed |
| 429 | Request restricted; verify the original task first |
| 500 | Internal error; recipient status must be verified |
| 502 | Generation service error; recipient status must be verified |
| 503 | Temporarily unavailable. Verify whether the submission was accepted. |
Cancellation is not supported when the task is still in progress. After generation, use the returned HTTPS URL to retrieve the video. The general structure of error responses is shown in the example on the right 400; specific fields are subject to actual return values.
## Requirements for reference materials
Avatar image: JPEG/PNG, up to 50MB, width and height at least 300px, aspect ratio 1:2.5~2.5:1. Action video: MP4/MOV, up to 100MB, width and height 340~3850px, at least 3 seconds. Maximum duration is 10 seconds for image input and 30 seconds for video input.
Do not specify duration or aspect_ratio; final output duration and aspect ratio follow the effective action and input materials. Maintain consistent character proportions, prioritize clear single-character continuous motion in action videos. Audio can be original (preserving original) or off (silent), default is original.
Add an existing subject to contents: `{"type":"element","element_id":"EXAMPLE_ELEMENT_ID","id":"e1"}`; in this case, character_orientation uses video.
## Official references
[Official API Guide](https://www.tencentcloud.com/zh/document/product/1300/83714) · [International Version Guide](https://intl.cloud.tencent.com/zh/document/product/1300/83714) · [Official Pricing Information](https://www.tencentcloud.com/zh/document/product/1300/78937)
Request example
curl --request POST \
'https://api.router.ai/v1/videos/generations' \
-H "Authorization: Bearer $OPENCROW_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary '{
"model": "kling-video-motion-control-v3.0",
"contents": [
{
"type": "image",
"url": "https://media.example.com/character.png"
},
{
"type": "video",
"url": "https://media.example.com/motion.mp4"
}
],
"settings": {
"character_orientation": "image",
"resolution": "720p",
"audio": "off"
},
"wait": false
}'
Endpoint reference: Aliyun Wan video generation