Skip to content

Kling Motion Control

Create videos where characters in an image perform actions from a reference video.

1. Create Task

Endpoint: POST /kling/v1/videos/motion-control

Description: Submit a motion control video generation task. The process is asynchronous. Upon success, a task_id is returned, which can be used to query the results later.

Authentication: Bearer Token

http
Authorization: Bearer YOUR_API_TOKEN

Request Parameters (Body)

FieldTypeRequiredDefaultDescription
promptstringNoEmptyText prompt for positive/negative descriptions. Can be used to add elements or camera effects. Max 2500 characters.
image_urlstringYes-Reference image for characters and background. Supports Base64 or URL. Formats: .jpg, .jpeg, .png. Max 10MB.
video_urlstringYes-Reference video for character motion. Supports .mp4, .mov. Max 100MB, min 3s.
keep_original_soundstringNoyesWhether to keep original video sound. Enum: yes, no.
character_orientationstringYes-Character orientation in generated video. Enum: image (same as image), video (same as video).
modestringYes-Video generation mode. Enum: std (standard), pro (professional).
callback_urlstringNo-Callback URL for task completion notifications.
external_task_idstringNo-User-defined task ID. Must be unique per user.

Response Parameters

FieldTypeDescription
codeintegerError code (0 for success)
messagestringError message
request_idstringRequest ID
dataobjectData object
data.task_idstringTask ID
data.task_statusstringTask status: submitted, processing, succeed, failed

2. Query Task (Single)

Endpoint: GET /v1/video/generations/:task_id

Description: Query the status and results of a video generation task by task ID.

Authentication: Bearer Token

http
Authorization: Bearer YOUR_API_TOKEN

Path Parameters

FieldTypeRequiredDescription
task_idstringYesTask ID returned by the create task endpoint

Response Parameters

FieldTypeDescription
codeintegerError code (0 for success)
messagestringError message
request_idstringRequest ID for tracking and troubleshooting
dataobjectData object
data.task_idstringTask ID
data.task_statusstringTask status: submitted, processing, succeed, failed
data.task_status_msgstringTask status message, shows failure reason when failed
data.task_infoobjectTask creation parameters
data.task_info.external_task_idstringUser-defined task ID
data.task_resultobjectTask result (only returned on success)
data.task_result.videosarrayList of generated videos
data.task_result.videos[].idstringGenerated video ID, globally unique
data.task_result.videos[].urlstringGenerated video URL (Note: videos will be deleted after 30 days, please save in time)
data.task_result.videos[].durationstringVideo duration in seconds
data.created_atintegerTask creation time, Unix timestamp (milliseconds)
data.updated_atintegerTask update time, Unix timestamp (milliseconds)

Response Example

json
{
  "code": 0,
  "message": "success",
  "request_id": "req_123456",
  "data": {
    "task_id": "task_123456",
    "task_status": "succeed",
    "task_status_msg": "success",
    "task_info": {
      "external_task_id": "custom_id_123"
    },
    "task_result": {
      "videos": [
        {
          "id": "vid_123",
          "url": "https://example.com/video.mp4",
          "duration": "5"
        }
      ]
    },
    "created_at": 1722769557708,
    "updated_at": 1722769557708
  }
}

企业合作联系:service@ezmodel.cloud