Kling 3.0 Motion Control
Kling 3.0 Motion Control transfers the motion from a reference video onto the character in a reference image — preserving the character's identity, appearance, and background — to produce a new video where your character performs the reference action. Outputs are 720P or 1080P, up to 30 seconds.
Models
| Model Name | Mode |
|---|---|
kling-v3-motion-control | Reference image + reference video to motion-transferred video |
Pricing
Billed per second of output video (= reference video length) × resolution:
| Resolution | Credits/sec |
|---|---|
720p | 30 |
1080p | 40 |
The reference video duration is probed automatically on the server for billing — if probing fails (URL unreachable or unsupported format), task creation returns a 400 error and no credits are charged. Credits are pre-charged when the task is created; failed tasks are refunded automatically.
Create Task
POST https://api.aivideoapi.ai/v1/videos/generations
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | kling-v3-motion-control |
input | object | Yes | Generation parameters |
callback_url | string | No | URL to receive task completion/failure notifications |
Input Parameters
| Field | Type | Required | Description |
|---|---|---|---|
input_urls | string[] | Yes | Reference image URL(s). JPG/JPEG/PNG, ≤ 10MB, ≥ 300px, aspect ratio between 2:5 and 5:2. The characters and background in the output are based on this image. |
video_urls | string[] | Yes | Reference video URL(s). MP4/MOV, ≤ 100MB, 3-30 seconds. The character motion in the output matches this video. |
character_orientation | string | No | image: keep the orientation of the person in the picture (output up to 10s). video: match the orientation of the characters in the video (output up to 30s). Default video. |
mode | string | No | Output resolution: 720p (default) or 1080p. |
prompt | string | No | Scene/motion description, max 2500 characters. Default: "No distortion, the character's movements are consistent with the video." |
The duration parameter is not supported: the output video length follows the reference video, capped by character_orientation (image ≤ 10s, video ≤ 30s). All media must be public HTTP(S) URLs.
Examples
Basic motion transfer
curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3-motion-control",
"callback_url": "https://your-server.com/webhook",
"input": {
"input_urls": ["https://example.com/character.png"],
"video_urls": ["https://example.com/reference-motion.mp4"],
"character_orientation": "video",
"mode": "720p"
}
}'
1080P with a prompt
curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3-motion-control",
"callback_url": "https://your-server.com/webhook",
"input": {
"input_urls": ["https://example.com/dancer.png"],
"video_urls": ["https://example.com/dance-clip.mp4"],
"character_orientation": "image",
"mode": "1080p",
"prompt": "The character performs the dance smoothly with no distortion"
}
}'
Response
{
"code": 200,
"msg": "success",
"data": {
"taskId": "8b6a5162-5c91-4a42-8e80-4c8ef5486f24"
}
}
Query Task
curl https://api.aivideoapi.ai/v1/tasks/{taskId} \
-H "Authorization: Bearer sk-your-api-key"
Status transitions: pending -> processing -> completed or failed.
If the task fails, pre-charged credits are refunded automatically.
Callback
Pass callback_url when creating the task and the system will POST to your URL when the task completes or fails. See Callback Guide for request headers and the retry strategy.
On completion
{
"id": "8b6a5162-5c91-4a42-8e80-4c8ef5486f24",
"status": "completed",
"model": "kling-v3-motion-control",
"created_at": 1781136227,
"completed_at": 1781136589,
"output": {
"urls": [
"https://file.aivideoapi.ai/videos/2026/06/15/abc.mp4"
],
"metadata": {
"model": "kling-3.0/motion-control"
}
}
}
On failure
{
"id": "57c8772c-f834-46f3-9b7d-81f92e104050",
"status": "failed",
"model": "kling-v3-motion-control",
"created_at": 1781136227,
"error": {
"code": "upstream_error",
"message": "Video generation failed"
}
}
Important Notes
- Return a 2xx status code as soon as possible after receiving the callback (within 3 seconds recommended). Non-2xx responses or timeouts (10 seconds) trigger retries — up to 3 attempts, spaced 3 and 10 minutes apart.
- Use
X-Task-Idfor idempotent handling on your side to avoid duplicate records for the same task. - The authoritative task state is always
GET /v1/tasks/{taskId}; if all 3 callbacks fail you can still poll as a fallback.
Error Codes
When a request fails, the API returns a JSON error response:
{
"error": {
"code": "insufficient_credits",
"message": "Your credit balance is too low. Please top up.",
"type": "billing_error"
}
}
Error Reference
| HTTP Status | Code | Type | Description |
|---|---|---|---|
| 400 | invalid_request | invalid_request_error | Missing or invalid parameters |
| 401 | invalid_api_key | authentication_error | API key is invalid, disabled, or deleted |
| 402 | insufficient_credits | billing_error | Credit balance too low, please top up |
| 403 | ip_not_allowed | permission_error | Request IP not in the key's allowlist |
| 404 | model_not_found | invalid_request_error | Model does not exist or is inactive |
| 404 | task_not_found | invalid_request_error | Task ID does not exist |
| 429 | rate_limit_exceeded | rate_limit_error | Too many requests, please slow down |
| 429 | spend_limit_exceeded | billing_error | Key spend limit reached (hourly/daily/total) |
| 500 | internal_error | api_error | Unexpected server error |
| 503 | upstream_error | upstream_error | Upstream AI provider returned an error |
Common Scenarios
invalid_request (400)
Returned when required fields are missing or invalid.
{
"error": {
"code": "invalid_request",
"message": "'model' is required.",
"type": "invalid_request_error"
}
}
insufficient_credits (402)
Your balance is too low. Check your balance with GET /v1/credits and top up in Dashboard > Billing.
invalid_api_key (401)
Possible causes:
- The key does not start with
sk- - The key has been disabled or deleted
- The user account has been banned
upstream_error (503)
The upstream AI provider returned an error. This may happen when:
- The input contains sensitive or prohibited content
- The provider is temporarily unavailable
- The request parameters are not supported by the provider
Credits are automatically refunded when a task fails due to upstream errors.