Doc version: v1.0.0 | Last updated: 2026-06-11
This platform fully supports the Kling AI official video generation API. Requests and responses are transparently proxied; parameter semantics are identical to the official API.
POST https://platform.dataeyes.ai/kling/v1/videos/multi-elements/init-selection
Initialize the original video before using Multi-elements feature. When replacing or removing elements within the existing video, the relevant elements need to be marked in the video beforehand.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Content-Type | string | Yes | application/json | Data Exchange Format |
Authorization | string | Yes | Authentication information, refer to API authentication |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
video_id | string | No | The ID of the video generated by the Kling AI - Only videos generated within the last 30 days are supported - Only supports videos with a duration of ≥2 seconds and ≤5 seconds, or ≥7 seconds and ≤10 seconds - Related to the video_url parameter: both video_id and video_url cannot be empty at the same time, and cannot both have values at the same time | |
video_url | string | No | Get link for uploaded video - Only .mp4/.mov formats are supported - Only supports videos with a duration of ≥2 seconds and ≤5 seconds, or ≥7 seconds and ≤10 seconds - Video resolution must be between 720px and 2160px (inclusive) in both width and height - Only supports videos with frame rates of 24, 30, or 60 fps - Related to the video_id parameter: both video_id and video_url cannot be empty at the same time, and cannot both have values at the same time |
curl --request POST \
--url https://platform.dataeyes.ai/kling/v1/videos/multi-elements/init-selection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"video_id": "",
"video_url": "https://v1-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/animals-output-5s.mp4"
}'
{
"code": 0, // Error code; Specific definitions can be found in "Error Code"
"message": "string", // Error message
"request_id": "string", // Request ID, generated by the system, used for tracking requests and troubleshooting
"data": {
"status": 0, // Rejection code, non-zero indicates recognition failure
"session_id": "id", // Session ID, generated during video initialization task, remains unchanged during editing operations, valid for 24 hours
"final_unit_deduction": "string", // The deduction units of task
"fps": 30.0, // Frame rate of parsed video, required when fetching selection preview video
"original_duration": 1000, // Duration of parsed video, required when creating task
"width": 720, // Width of parsed video, currently unused
"height": 1280, // Height of parsed video, currently unused
"total_frame": 300, // Total frame count of parsed video, required when creating task
"normalized_video": "url" // URL of initialized video
}
POST https://platform.dataeyes.ai/kling/v1/videos/multi-elements/add-selection
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Content-Type | string | Yes | application/json | Data Exchange Format |
Authorization | string | Yes | Authentication information, refer to API authentication |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id | string | Yes | Session ID, generated during the video initialization task and remains unchanged during editing operations | |
frame_index | int | Yes | Frame Number - A maximum of 10 frames can be marked. That is, up to 10 frames can be used to define selection areas in the video - Only supports marking 1 frame at a time | |
points | array | Yes | Click Coordinates, represented by x and y - Value range: [0, 1], expressed as percentages; [0, 1] represents the top-left corner of the frame - Multiple points can be marked at once; up to 10 points can be marked on a single frame | |
x | float | Yes | X coordinate [0-1] | |
y | float | Yes | Y coordinate [0-1] |
curl --request POST \
--url https://platform.dataeyes.ai/kling/v1/videos/multi-elements/add-selection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"session_id": "847570360458960960",
"frame_index": 0,
"points": [
{
"x": 0.7738498789346246,
"y": 0.297142857142857
}
]
}'
{
"code": 0, // Error code; Specific definitions can be found in "Error Code"
"message": "string", // Error message
"request_id": "string", // Request ID, generated by the system, used for tracking requests and troubleshooting
"data": {
"status": 0, // Rejection code, non-zero indicates recognition failure
"session_id": "id", // Session ID, generated during video initialization task, remains unchanged during editing operations, valid for 24 hours
"final_unit_deduction": "string", // The deduction units of task
"res": {
"frame_index": 0,
"rle_mask_list": [{
"object_id": 0,
"rle_mask": {
"size": [720, 1280],
"counts": "string"
},
"png_mask": {
"size": [720, 1280],
"base64": "string"
}
}]
}
}
}
POST https://platform.dataeyes.ai/kling/v1/videos/multi-elements/delete-selection
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Content-Type | string | Yes | application/json | Data Exchange Format |
Authorization | string | Yes | Authentication information, refer to API authentication |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id | string | Yes | Session ID, generated during the video initialization task and remains unchanged during editing operations | |
frame_index | int | Yes | Frame Number | |
points | array | Yes | Click Coordinates to delete, represented by x and y - Value range: [0, 1], expressed as percentages; [0, 1] represents the top-left corner of the frame - Multiple points can be provided at once - Coordinates must exactly match those used when adding the video selection area | |
x | float | Yes | X coordinate [0-1] | |
y | float | Yes | Y coordinate [0-1] |
curl --request POST \
--url https://platform.dataeyes.ai/kling/v1/videos/multi-elements/delete-selection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"session_id": "847570360458960960",
"frame_index": 0,
"points": [
{
"x": 0.7738498789346246,
"y": 0.297142857142857
}
]
}'
{
"code": 0, // Error code; Specific definitions can be found in "Error Code"
"message": "string", // Error message
"request_id": "string", // Request ID, generated by the system, used for tracking requests and troubleshooting
"data": {
"status": 0, // Rejection code, non-zero indicates recognition failure
"session_id": "id", // Session ID, generated during video initialization task, remains unchanged during editing operations, valid for 24 hours
"final_unit_deduction": "string", // The deduction units of task
"res": {
"frame_index": 0,
"rle_mask_list": [{
"object_id": 0,
"rle_mask": {
"size": [720, 1280],
"counts": "string"
},
"png_mask": {
"size": [720, 1280],
"base64": "string"
}
}]
}
}
}
POST https://platform.dataeyes.ai/kling/v1/videos/multi-elements/clear-selection
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Content-Type | string | Yes | application/json | Data Exchange Format |
Authorization | string | Yes | Authentication information, refer to API authentication |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id | string | Yes | Session ID, generated during the video initialization task and remains unchanged during editing operations |
curl --request POST \
--url https://platform.dataeyes.ai/kling/v1/videos/multi-elements/clear-selection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"session_id": "847570360458960960"
}'
{
"code": 0, // Error code; Specific definitions can be found in "Error Code"
"message": "string", // Error message
"request_id": "string", // Request ID, generated by the system, used for tracking requests and troubleshooting
"data": {
"status": 0, // Rejection code, non-zero indicates recognition failure
"session_id": "id", // Session ID, generated during video initialization task, remains unchanged during editing operations, valid for 24 hours
"final_unit_deduction": "string", // The deduction units of task
}
}
POST https://platform.dataeyes.ai/kling/v1/videos/multi-elements/preview-selection
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Content-Type | string | Yes | application/json | Data Exchange Format |
Authorization | string | Yes | Authentication information, refer to API authentication |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id | string | Yes | Session ID, generated during the video initialization task and remains unchanged during editing operations |
curl --request POST \
--url https://platform.dataeyes.ai/kling/v1/videos/multi-elements/preview-selection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"session_id": "847570360458960960"
}'
{
"code": 0, // Error code; Specific definitions can be found in "Error Code"
"message": "string", // Error message
"request_id": "string", // Request ID, generated by the system, used for tracking requests and troubleshooting
"data": {
"status": 0, // Rejection code, non-zero indicates recognition failure
"session_id": "id", // Session ID, generated during video initialization task, remains unchanged during editing operations, valid for 24 hours
"final_unit_deduction": "string", // The deduction units of task
"res": {
"video": "url", // Video with mask
"video_cover": "url", // Cover image of video with mask
"tracking_output": "url" // Mask result for each frame in image segmentation results
}
}
}
POST https://platform.dataeyes.ai/kling/v1/videos/multi-elements
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Content-Type | string | Yes | application/json | Data Exchange Format |
Authorization | string | Yes | Authentication information, refer to API authentication |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model_name | string | No | kling-v1-6 | Model Name Options: kling-v1-6 |
session_id | string | Yes | Session ID, generated during the video initialization task and remains unchanged during editing operations | |
edit_mode | string | Yes | Operation Type Options: addition, swap, removal- addition: Add an element - swap: Replace an element - removal: Remove an element | |
image_list | array | No | Cropped Reference Images - For adding video elements: This parameter is required; upload 1–2 images - For editing (swapping) video elements: This parameter is required; upload 1 image only - For deleting video elements: This parameter is not required - Use key:value format as follows: - The API does not perform cropping, please upload images with subjects already cropped - Supports image input as either Base64-encoded string or URL (ensure the URL is publicly accessible) - Important: When using Base64, do NOT add any prefix like data:image/png;base64,. Submit only the raw Base64 string.- Correct Base64 format: - Incorrect Base64 format (with data: prefix): - Supported image formats: .jpg / .jpeg / .png - Image file size must not exceed 10MB. Image dimensions must be at least 300px. Aspect ratio must be between 1:2.5 and 2.5:1 | |
image | string | Yes | Image URL or Base64 string | |
prompt | string | Yes | Positive Prompt - Use the format <<>> to explicitly refer to a specific video or image, such as <<<video_1>>> or <<<image_1>>> - To ensure optimal results, the prompt must include references to the video and image(s) required for the editing - Must not exceed 2,500 characters Recommended Prompt Templates: Adding Elements: - EN: Using the context of <<<video_1>>>, seamlessly add [x] from <<<image_1>>> - ZH: 基于<<<video_1>>>中的原始内容,以自然生动的方式,将<<<image_1>>>中的【】,融入<<<video_1>>>的【】 Replacing Elements: - EN: swap [x] from <<<image_1>>> for [x] from <<<video_1>>> - ZH: 使用<<<image_1>>>中的【】,替换<<<video_1>>>中的【】 Removing Elements: - EN: Delete [x] from <<<video_1>>> - ZH: 删除<<<video_1>>>中的【】 Note: [x] or 【】 are placeholders where you should fill in specific content. | |
negative_prompt | string | No | Negative Prompt - Must not exceed 2,500 characters | |
mode | string | No | std | Video Generation Mode Options: std, pro- std: Standard mode, basic rendering, cost-effective - pro: Professional mode, high-quality, enhanced rendering, better video output quality |
duration | string | No | 5 | Video Duration (in seconds) Options: 5, 10- Only 5-second and 10-second videos are supported - To generate a 5-second video, the input video must be ≥2 seconds and ≤5 seconds - To generate a 10-second video, the input video must be ≥7 seconds and ≤10 seconds |
watermark_info | object | No | Whether to generate watermarked results simultaneously - Defined by the enabled parameter, format: - true: generate watermarked result, false: do not generate - Custom watermarks are not currently supported | |
callback_url | string | No | Callback URL for Task Result Notification. If configured, the server will actively send notifications when the task status changes - For the message schema, refer to the Callback Protocol | |
external_task_id | string | No | Custom Task ID - A user-defined task ID; it will not overwrite the system-generated task ID, but can be used to query the task - Please ensure uniqueness of the task ID within a single user account | |
| Parameter Format Details |
image_list
"image_list":[
{ "image":"image_url" },
{ "image":"image_url" }
]
iVBORw0KGgoAAAANSUhEUgAAAAUA...
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...
watermark_info
"watermark_info": { "enabled": boolean }
curl --request POST \
--url https://platform.dataeyes.ai/kling/v1/videos/multi-elements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-v1-6",
"session_id": "847570360458960960",
"edit_mode": "removal",
"image_list": [],
"prompt": "Delete the chick from <<<video_1>>>",
"negative_prompt": "",
"mode": "std",
"duration": "5",
"callback_url": "",
"external_task_id": ""
}'
{
"code": 0, // Error code; Specific definitions can be found in "Error Code"
"message": "string", // Error message
"request_id": "string", // Request ID, generated by the system, used for tracking requests and troubleshooting
"data": {
"task_id": "string", // Task ID, generated by the system
"task_status": "string", // Task status, Enum values: submitted, processing, succeed, failed
"task_info": {
"external_task_id": "string" // User-defined task ID
},
"created_at": 1722769557708, // Task creation time, Unix timestamp, unit: ms
"updated_at": 1722769557708 // Task update time, Unix timestamp, unit: ms
}
}
GET https://platform.dataeyes.ai/kling/v1/videos/multi-elements/{id}
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Content-Type | string | Yes | application/json | Data Exchange Format |
Authorization | string | Yes | Authentication information, refer to API authentication |
curl --request GET \
--url https://platform.dataeyes.ai/kling/v1/videos/multi-elements/{task_id} \
--header 'Authorization: Bearer <token>'
{
"code": 0, // Error code; Specific definitions can be found in "Error Code"
"message": "string", // Error message
"request_id": "string", // Request ID, generated by the system, used for tracking requests and troubleshooting
"data": {
"task_id": "string", // Task ID, generated by the system
"task_status": "string", // Task status, Enum values: submitted, processing, succeed, failed
"task_status_msg": "string", // Task status message, displays failure reason when task fails (e.g., triggered platform content moderation)
"task_info": { // Task creation parameters
"external_task_id": "string" // User-defined task ID
},
"task_result": {
"videos": [
{
"id": "string", // Generated video ID, globally unique
"session_id": "id", // Session ID, generated during video initialization task, remains unchanged during editing operations, valid for 24 hours
"url": "string", // URL of generated video (Note: For security purposes, generated images/videos will be deleted after 30 days, please save them promptly)
"watermark_url": "string", // Watermarked video download URL, anti-hotlinking format
"duration": "string" // Total video duration, unit: s
}
]
},
"watermark_info": {
"enabled": boolean
},
"final_unit_deduction": "string", // Final unit deduction for the task
"created_at": 1722769557708, // Task creation time, Unix timestamp, unit: ms
"updated_at": 1722769557708 // Task update time, Unix timestamp, unit: ms
}
}
GET https://platform.dataeyes.ai/kling/v1/videos/multi-elements
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Content-Type | string | Yes | application/json | Data Exchange Format |
Authorization | string | Yes | Authentication information, refer to API authentication |
curl --request GET \
--url 'https://platform.dataeyes.ai/kling/v1/videos/multi-elements?pageNum=1&pageSize=30' \
--header 'Authorization: Bearer <token>'
{
"code": 0, // Error code; Specific definitions can be found in "Error Code"
"message": "string", // Error message
"request_id": "string", // Request ID, generated by the system, used for tracking requests and troubleshooting
"data": [
{
"task_id": "string", // Task ID, generated by the system
"task_status": "string", // Task status, Enum values: submitted, processing, succeed, failed
"task_status_msg": "string", // Task status message, displays failure reason when task fails (e.g., triggered platform content moderation)
"task_info": { // Task creation parameters
"external_task_id": "string" // User-defined task ID
},
"task_result": {
"videos": [
{
"id": "string", // Generated video ID, globally unique
"session_id": "id", // Session ID, generated during video initialization task, remains unchanged during editing operations, valid for 24 hours
"url": "string", // URL of generated video (Note: For security purposes, generated images/videos will be deleted after 30 days, please save them promptly)
"watermark_url": "string", // Watermarked video download URL, anti-hotlinking format
"duration": "string" // Total video duration, unit: s
}
]
},
"watermark_info": {
"enabled": boolean
},
"final_unit_deduction": "string", // Final unit deduction for the task
"created_at": 1722769557708, // Task creation time, Unix timestamp, unit: ms
"updated_at": 1722769557708 // Task update time, Unix timestamp, unit: ms
}
]
}