Create Video from Motion and Image
October 7, 2025
Table of contents
This endpoint applies a motion template to a static image, creating an animated video where the character in the image performs the motion. Motions can be official Kling templates or custom user-uploaded motions.
See the Kling Motion Control User Guide for detailed information about motion control features.
https://api.useapi.net/v1/kling/videos/motion-create
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
API token
is required, see Setup useapi.net for details.
Request Body
{
"email": "[email protected]",
"workId": -123456,
"image": "https://s21-kling.klingai.com/.../person.jpg",
"prompt": "Person dancing energetically",
"duration": "5",
"mode": "std",
"character_id": 0,
"change_direction": false,
"sound_effect": true,
"audio_prompt": "upbeat music",
"music_prompt": "electronic dance music",
"enable_asmr": false,
"replyUrl": "https://your-callback-url.com/webhook",
"replyRef": "your-reference-id"
}
-
email
is optional when only one account configured. However, if you have multiple accounts configured, this parameter becomes required. -
workId
is required, integer. Motion identifier from GET /videos/motions.
Negative values indicate official Kling motions, positive values indicate user-uploaded motions. -
image
is required, URL to the image containing the person. The person’s body and pose should be clearly visible.
Must be uploaded via POST /assets first - use theurl
field from the response. -
prompt
is optional, string up to 2500 characters. Text description to guide the video generation. -
duration
is optional, must be5
or10
. Duration of the generated video in seconds.
Default:5
-
mode
is optional, must bestd
orpro
. Generation quality mode. Pro mode provides higher quality but costs more.
Default:std
-
character_id
is optional, integer from0
to10
. When the image contains multiple people, this selects which character to animate (0-indexed, counting from left to right).
Default:0
(leftmost person) -
change_direction
is optional, boolean. Whentrue
, mirrors/reverses the motion horizontally.
Default:false
-
sound_effect
is optional, boolean. Whentrue
, enables audio generation for the video.
Default:true
-
audio_prompt
is optional, string up to 2500 characters. Description of desired sound effects (only used whensound_effect=true
). -
music_prompt
is optional, string up to 2500 characters. Description of desired background music (only used whensound_effect=true
). -
enable_asmr
is optional, boolean. Enables ASMR-style audio generation (only used whensound_effect=true
).
Default:false
-
maxJobs
is optional, range from1
to50
. Specifies the maximum number of concurrent jobs. -
replyUrl
is optional, a callback URL to receive generation progress and result. See GET /tasks/task_id
for response model. -
replyRef
is optional, a reference identifier for the callback.
Notes:
- The image must contain at least one clearly visible person
- If
sound_effect=false
, the parametersaudio_prompt
,music_prompt
, andenable_asmr
cannot be used - The system will automatically detect characters in the image and select based on
character_id
- Character detection sorts people left-to-right, so
character_id=0
is the leftmost person,character_id=1
is second from left, etc. - To delete a user-uploaded motion used in this request, use DELETE /tasks/
task_id
with the motion’staskId
from GET /videos/motions
Responses
-
{ "task": { "id": 123456789, "userId": 12345, "type": "motion_control_imgs2video", "scene": "NORMAL_CREATION", "status": 5, "status_name": "submitted", "status_final": false, "taskInfo": { "type": "motion_control_imgs2video", "inputs": [ { "name": "image_origin", "inputType": "URL", "url": "https://s21-kling.klingai.com/.../person.jpg", "fromWorkId": 0 }, { "name": "image_binary", "inputType": "URL", "url": "https://s21-kling.klingai.com/...binary.zip" }, { "name": "motion_binary_1", "inputType": "URL", "url": "https://s21-kling.klingai.com/...motion-binary.zip", "fromWorkId": -123456 }, { "name": "motion_video_1", "inputType": "URL", "url": "https://s21-kling.klingai.com/...motion.mp4", "cover": "https://s21-kling.klingai.com/...cover.jpg" } ], "arguments": [ { "name": "prompt", "value": "Person dancing energetically" }, { "name": "duration", "value": "5" }, { "name": "model_mode", "value": "std" }, { "name": "enable_audio", "value": "true" } ], "extraArgs": {}, "callbackPayloads": [], "scene": "NORMAL_CREATION" }, "favored": false, "deleted": false, "viewed": false, "createTime": 1745376611075, "updateTime": 1745376611075 }, "works": [], "status": 5, "status_name": "submitted", "status_final": false, "message": "", "limitation": { "type": "motion_control_imgs2video", "remaining": 10000, "limit": 10000 }, "userPoints": { "points": [], "total": 0 }, "userTickets": { "ticket": [] }, "editProject": null }
-
{ "error": "Parameter workId is required" }
-
{ "error": "Unauthorized", "code": 401 }
-
Kling was unable to locate one of the referenced assets.
{ "error": "Sorry, the requested resource was not found (VALID.ResourceNotFound)", "message": "Not Found" }
-
Kling uses a
500
response to indicate moderation and other issues with the input. It may be hard to separate actual 500 errors from moderation errors, so use theerror
field text and your best judgement to tell them apart, since themessage
field most often has very generic and perhaps misleading text.{ "error": "The content you uploaded appears to violate the community guidelines. (CM_EXT.POther)", "message": "Service busy (CM_EXT.POther)" }
When successful, the response includes a task ID which can be used to check the status using GET /tasks/task_id
.
Model
{ // TypeScript, all fields are optional
task: {
id: number
userId: number
type: string
scene: string
status: number
status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
status_final: boolean
taskInfo: {
type: string
inputs: Array<{
name: string
inputType: string
token: string | null
blobStorage: any | null
url: string
cover: string | null
fromWorkId: number | null
}>
arguments: Array<{
name: string
value: string
}>
extraArgs: Record<string, any>
callbackPayloads: any[]
scene: string
}
favored: boolean
deleted: boolean
viewed: boolean
createTime: number
updateTime: number
viewTime: number
}
works: Array<any>
status: number
status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
status_final: boolean
message: string
error: string
limitation: {
type: string
remaining: number
limit: number
}
userPoints: {
points: Array<{
orderId: string
type: string
amount: number
balance: number
startTime: number
endTime: number
}>
total: number
}
userTickets: {
ticket: Array<{
orderId: string
type: string
packageType: string
amount: number
balance: number
startTime: number
endTime: number
}>
}
editProject: any | null
}
Examples
-
curl -X POST "https://api.useapi.net/v1/kling/videos/motion-create" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -d '{ "email": "[email protected]", "workId": -123456, "image": "https://s21-kling.klingai.com/.../person.jpg", "prompt": "Person dancing energetically", "duration": "5", "mode": "std", "sound_effect": true, "audio_prompt": "upbeat music" }'
-
const token = "API token"; const email = "Previously configured account email"; const apiUrl = "https://api.useapi.net/v1/kling/videos/motion-create"; const response = await fetch(apiUrl, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`, }, body: JSON.stringify({ email: email, workId: -123456, // from GET /videos/motions image: "https://s21-kling.klingai.com/.../person.jpg", prompt: "Person dancing energetically", duration: "5", mode: "std", sound_effect: true, audio_prompt: "upbeat music" }) }); const result = await response.json(); console.log("response", {response, result});
-
import requests token = "API token" email = "Previously configured account email" apiUrl = "https://api.useapi.net/v1/kling/videos/motion-create" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } data = { "email": email, "workId": -123456, # from GET /videos/motions "image": "https://s21-kling.klingai.com/.../person.jpg", "prompt": "Person dancing energetically", "duration": "5", "mode": "std", "sound_effect": True, "audio_prompt": "upbeat music" } response = requests.post(apiUrl, headers=headers, json=data) print(response, response.json())