MaaS_KL_O3
Competency Map
| Functional Classification | Subfunction | std (3s \~ 15s) | pro (3s \~ 15s) | 4k (3s \~ 15s) |
|---|---|---|---|---|
| Text-to-Video | Single-shot Video Generation | ✗ | ✓ | ✓ |
| Multi-shot Video Generation | ✓ | ✓ | ✓ | |
| Voice Control (Human Voice Control) | ✗ | ✗ | ✗ | |
| Image to Video |
Single-shot Video Generation | ✓ | ✓ | ✓ |
| Multi-shot Video Generation | ✓ | ✓ | ✓ | |
| First and last frames (one continuous shot) | ✓ | ✓ | ✓ | |
| Subject Control (Video Character Subject + Multi-Image Subject) | ✓ | ✓ | ✓ |
|
| Video Reference | ✓ (仅3s \~ 10s) | ✓ (仅3s \~ 10s) | ✗ | |
| Voice Control (Human Voice Control) | ✗ | ✗ | ✗ |
| Functional Classification | Subfunction | Custom aspect ratio (1K/2K/4K) | Intelligent Aspect Ratio |
|---|---|---|---|
| Text-to-Image | Single Image Generation | ✓ | ✓ |
| Other | - | - | |
| Image-to-Image | Single Image Generation | ✓ | ✓ |
| Group Image Generation | ✓ | ✓ | |
| Subject Control (Multi-image Subject Only) | ✓ |
✓ | |
| Other | - | - |
Request Protocol
http
Header
| Parameter Name | Type | Description |
|---|---|---|
| anthorization | string | Authentication |
Video Interface
Create Video Generation Task Interface
Request URL
https://genaiapi-m2.cloudsway.net/v1/ai/{endpoinPath}/kling/videos/ omni-video
Request Method
POST
Request Parameters
| Field | Type | Required | Default Value | Description |
|---|---|---|---|---|
multi_shot |
boolean | Optional | false |
Whether to generate a multi-shot video ● When the current parameter is true, the prompt parameter is invalid● When the current parameter is false, the shot_type parameter and the multi_prompt parameter are invalid |
shot_type |
string | Optional | Empty | Storyboard Method ● Enumerated value: customize● When the multi_shot parameter is true, this parameter is required |
prompt |
string | Optional | Empty | Text prompt, which can include positive and negative descriptions ● The prompt can be templated to meet different video generation needs. The Omni model can achieve various capabilities through Prompt with content such as subjects, images, and videos: <<<>>> format to specify a certain subject, image, or video, for example: <<<element_1>>>, <<<image_1>>>, <<<video_1>>> ● The length cannot exceed 2,500 characters ● When the multi_shot parameter is false or the shot_type parameter is intelligence, the current parameter must not be emptyDifferent model versions support different ranges of capabilities. For details, please refer to the capability map above. |
multi_prompt |
array | Optional | Empty | Information for each shot, such as prompts, duration, etc. ● Define the shot number, corresponding prompt, and duration through the index, prompt, and duration parameters, where: ○ Supports up to 6 shots and at least 1 shot ○ The maximum length of each shot-related content does not exceed 512 characters. ○ The duration of each shot is no greater than the total duration of the current task and no less than 1 ○ The sum of the durations of all shots equals the total duration of the current task ● When the multi_shot parameter is true and the shot_type parameter is customize, the current parameter must not be empty |
image_list |
array | Optional | Empty | Reference Image List ● Includes reference images such as subject, scene, style, etc., which can also be used as the first or last frame to generate a video; when used as the first or last frame to generate a video: ○ Define whether the image is the first or last frame through the type parameter: first_frame is the first frame, end_frame is the last frame ■ Currently, only the end frame is not supported, i.e., when there is an end frame image, there must be a start frame image. ○ When generating a video using the start frame or both the start and end frames, video editing functions cannot be used; ● Supports passing in Base64-encoded images or image URLs (ensure they are accessible) ● Image format support .jpg / .jpeg / .png● The size of the image file cannot exceed 10MB, the width and height of the image must be no less than 300px, and the aspect ratio of the image should be between 1:2.5 and 2.5:1 ● The number of reference images is related to the presence or absence of reference videos and the number of reference subjects, where: ○ When there is a reference video, the sum of the number of reference images and the number of reference subjects shall not exceed 4; ○ When there is no reference video, the sum of the number of reference images and the number of reference subjects shall not exceed 7; ○ When the number of reference images exceeds 2, setting the end frame is not supported; ● image_url parameter value cannot be empty
Different model versions support different ranges of capabilities. For details, see the capabilities map above. |
element_list |
array | Optional | Empty | Reference Subject List ● Based on the ID configuration of the entities in the entity library, it is carried by key:value, as follows: ● The number of reference subjects is related to the presence of reference videos and the number of reference pictures, where: ○ When using the first frame to generate a video or the first and last frames to generate a video, it supports up to 3 subjects; ○ When there is a reference video, the sum of the number of reference images and the number of reference subjects must not exceed 4, and the use of video character subjects is not supported; ○ When there is no reference video, the sum of the number of reference images and the number of reference subjects shall not exceed 7 ● The main bodies are divided into video customization main bodies (abbreviated as: video character main bodies) and image customization main bodies (abbreviated as: multi-image main bodies), with different scopes of application. Please note the distinction. Different model versions support different ranges of capabilities. For details, see the capabilities map above. |
video_list |
array | Optional | Empty | Reference video, obtained via URL ● Can be used as a reference video for features or as a video to be edited, defaulting to a video to be edited; can optionally retain the original audio of the video. ○ Distinguish reference video types via the refer_type parameter: feature is the feature reference video, base is the video to be edited ○ When the reference video is the video to be edited, the first and last frames of the video cannot be defined. ○ Select whether to keep the original audio of the video via the keep_original_sound parameter, yes means to keep it, no means not to keep it; the current parameter also applies to the feature reference video (feature) ● When there is a reference video, sound parameter value can only be off● Use key:value to carry, as follows: ● Video formats only support MP4/MOV● Video duration should be no less than 3 seconds, with the upper limit related to the model version. For details, refer to the Capability Map. ● The width and height dimensions of the video must be between 720px (inclusive) and 2160px (inclusive) ● Video frame rate is based on 24fps to 60fps, and will be output at 24fps when generating the video. ● Supports uploading at most 1 video, with the video size not exceeding 200MB ● video_url parameter value cannot be emptyDifferent model versions support different ranges of capabilities, see the above Capability Map for details |
sound |
string | Optional | off |
Whether to generate sound simultaneously when generating a video ● Enumerated values: on,offOnly models of version V2.6 and later support the current parameters |
mode |
string | Optional | pro |
Mode for generating videos
|
aspect_ratio |
string | Optional | Empty | Aspect ratio (width:height) of the generated video ● Enumerated values: 16:9, 9:16, 1:1● When the first frame reference or video editing function is not used, the current parameter is required. After specifying the first and last frames, aspect_ratio does not take effect, and the ratio is consistent with that of the first frame. |
duration |
string | Optional |
5 |
Generated video duration, unit: s ● Enumerated values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, where: ○ When using the video editing feature ( "refer_type":"base"), the output duration is the same as the input video duration, and the current parameters are invalid; in this case, billing is calculated based on rounding the input video duration to the nearest whole number.Different model versions support different ranges of capabilities, see the above Capability Map for details |
watermark_info |
array | Optional | Empty | Whether to simultaneously generate watermarked results ● Defined by the enabled parameter ● Carried by key:value, as follows:: ● Custom watermarks are not currently supported |
external_task_id |
string | Optional | Empty | Custom Task ID ● User-defined task ID. Passing it in will not overwrite the system-generated task ID, but it supports task query via this ID. ● Please note that uniqueness must be ensured under single-user mode |
Request Example
curl --location --request POST 'https://genaiapi-m2.cloudsway.net/v1/ai/{Your endpoint}/kling/videos/omni-video' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"multi_shot": true,
"shot_type": "customize",
"prompt": "",
"multi_prompt": [
{
"index": 1,
"prompt": "A person sitting on a park bench, sunlight filtering through trees. Simple composition, no dialogue.",
"duration": "2"
},
{
"index": 2,
"prompt": "A car speeding down a rainy street, headlights glowing. Dynamic angle, focus on motion.",
"duration": "3"
}
],
"image_list": [],
"video_list": [],
"mode": "pro",
"sound": "on",
"aspect_ratio": "16:9",
"duration": 5,
"external_task_id": ""
}'
Return Value Example
{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "868928128835022925",
"task_status": "submitted",
"created_at": 1775197128602,
"updated_at": 1775197128602,
"task_info": {
"parent_video": null
}
},
"request_id": "d1f782a3-be03-46fc-9f53-a076d5c0cb43"
}
Query Video Task Interface
Request URL
https://genaiapi-m2.cloudsway.net/v1/ai/{endpoinPath}/kling/videos /omni-video/{id}
Request Method
GET
Request Parameters
| Field | Type | Required | Default Value | Description |
|---|---|---|---|---|
| task_id | string | Optional | None | The task ID request path parameter for text-to-video, directly fill in the value in the request path, and choose one of the two query methods with external_task_id |
| external_task_id | string | Optional | None | When creating a custom task ID for text-to-video, you can choose either the external_task_id filled in during task creation or task_id as the query method |
Return Value Example
{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "868928128835022925",
"task_status": "succeed",
"created_at": 1775197128602,
"updated_at": 1775197273897,
"task_status_msg": "",
"task_info": {
"parent_video": null
},
"task_result": {
"videos": [
{
"id": "868928128960864333",
"url": "https://v1-fdl.kechuangai.com/ksc2/78Bu8zqqtt8BvVYzSQJyvdTT8cXDcsf2l2qJcwzcoZAO23Gexgh_aWXSbIKKTud4MWrH3bWZZBJJAnnSyOejJVyJwPtevFHzp94Vj4cFuK9UjKKoYakSCeTgfl6HePBtj0p376KubNKD6J_Lzyv1C8PTz5rqHlqhtapd9LCLqf3N1aD4Tq3sTtDvCsYNUqm8aGiiQkrgUiCBunjnnInmtQ.mp4?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAHTBBOTkTWNGRvz5xTG0V28-Uq_QfOtUq4eGsTFRH0XGboJi1dI_XCj9OwEmUp7PRZ9a4IjmdF1km2p27yMyXgIIiG2XCZQIKNSaKuS8ZvCieMgxJviPQKg845UD39o2IA9162I6q4_tb4tG4SNQKKG2BmU-NHhuxB2EMK0tN7hNeT1qsBD5AdjGdld98KBw0Vk_NJSEcZ0OSO3B2pWvooQoG4O8d4UxuvgYimbgWyRbxoS0dDQ6WvEt8pqXaoyQyeDsp12IiAJ9zaeR6eoaHBvKGZpPW2onH-fp5fs1a9hhRqA5OOK0SgFMAE&x-kcdn-pid=112757&pkey=AAWyWoFyoVEsr4vdz3YL11tRkc-rMqwLU36FWc5M1u4o09zGmTpS7izTpBZZGAoLBffyoYFKWB0e2Jnq7wDd4DEW73rLytKoCBOyUCjzeZeK2G3N4U-hcMgln4JtmI0nPNc",
"duration": "5.041",
"watermark_url": null
}
]
},
"final_unit_deduction": "5"
},
"request_id": "cf05377c-7abc-4c69-8920-056b1801397d"
}
Image Generation
Create Image Generation Task Interface
Request URL
https://genaiapi-m2.cloudsway.net/v1/ai/{endpoinPath}/kling /images/omni-image
Request Method
POST
Request Parameters
| Field | Type | Required | Default Value | Description |
|---|---|---|---|---|
prompt |
string | must | None | Text prompt, which can include positive and negative descriptions ● Prompts can be templated to meet different image generation needs ● Must not exceed 2,500 characters |
image_list |
array | Optional | Empty | Reference Image List ● Supports passing in Base64-encoded images or image URLs (ensure they are accessible) ● Image formats supported:.jpg /.jpeg /.png ● Image file size cannot exceed 10MB ● Image width and height dimensions are not less than 300px ● The aspect ratio of the image should be between 1:2.5 and 2.5:1 ● The number of reference subjects is related to the number of reference images, and the sum of the number of reference subjects and the number of reference images shall not exceed 10. ● The value of the image_url parameter must not be empty |
element_list |
array | Optional | Empty | Subject Reference List ● Configuration based on the ID of the entity in the entity library ● The number of reference subjects is related to the number of reference images, and the sum of the number of reference subjects and the number of reference images shall not exceed 10. |
resolution |
string | Optional | 1k |
Clarity of generated images ● Enumerated values: 1k, 2k, 4k○ 1k: 1K SD○ 2k: 2K HD○ 4k: 4K Ultra HDDifferent model versions support different ranges of capabilities. For details, please refer to the capability map above. |
result_type |
string | Optional | single |
Toggle switch for single image/group image of generated results ● Enumerated values: single, seriesDifferent model versions support different ranges; for details, see the capabilities map above ● When the value of result_type is series, the current parameter is invalid |
n |
int | Optional | 1 |
Number of Generated Images ● Value range: [1, 9] ● When the value of result_type is series, the current parameter is invalid |
series_amount |
int | Optional | 4 |
Number of images in the generated group of images ● Value range: [2, 9] ● When the value of result_type is single, the current parameter is invalid Different model versions support different ranges; for details, see the capabilities map above |
aspect_ratio |
string | Optional | auto |
Aspect ratio (width:height) of the generated image ● Enumerated values: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, auto○ Among them: auto means intelligently generating videos based on the input content ○ When generating a new image based on the aspect ratio of the reference original image, the current parameters are invalid Different model versions support different ranges; for details, see the capabilities map above |
watermark_info |
array | Optional | Empty | Whether to generate watermarked results simultaneously ● Defined by the enabled parameter ● Custom watermarks are not currently supported |
external_task_id |
string |
Optional | None | Custom Task ID ● User-defined task ID. Passing it in will not overwrite the system-generated task ID, but it supports task query via this ID. ● Please note that uniqueness must be ensured under single-user mode |
Request Example
curl --location --request POST 'https://genaiapi-m2.cloudsway.net/v1/ai/{Your endpoint}/kling/images/omni-image' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "Generate a recommended cover for each subject <<object_1>>",
"element_list": [
{
"element_id": "171"
},
{
"element_id": "168"
}
],
"image_list": [],
"resolution": "2k",
"result_type": "series",
"series_amount": 2,
"aspect_ratio": "auto",
"external_task_id": ""
}'
Return Value Example
{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "868615970234318861",
"task_status": "submitted",
"created_at": 1775122704188,
"updated_at": 1775122704188,
"task_info": {
"parent_video": null
}
},
"request_id": "6bb3c153-ad42-4b77-b47e-c93d00a03179"
}
Query Image Task Interface
Request URL
https://genaiapi-m2.cloudsway.net/v1/ai/{endpoinPath}/kling /images/omni-image/{id}
Request Method
GET
Request Parameters
| Field | Type | Required | Default Value | Description |
|---|---|---|---|---|
| task_id | string | must | None | The task ID request path parameter for image generation, directly fill in the value in the request path |
Return Value Example
{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "868615970234318861",
"task_status": "succeed",
"created_at": 1775122704188,
"updated_at": 1775122766071,
"task_status_msg": "",
"task_info": {
"parent_video": null
},
"task_result": {
"images": [],
"result_type": "series",
"series_images": [
{
"index": 0,
"url": "https://p4-fdl.klingai.com/ksc2/P2jeE3JrM6UCR0MLPbcSG_OElXt6gSr72Wfi-L4vsxUvgLxXnZs0eP8Oxts_BBZLXG2eoUJBvUKOH9RThrmv-BZtYayxkftN6fLNhGLY-QYZ2AK4zb7r0N80SxVuF82GSrgxVnbXEeDi3717Ucnz4LvDScRkYZe_iK94BPIGbR2PqP2Xb_Q0r5cU_0yfG-cRU6DKpY4b4J0qZleVgxhoYA.png?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAErbj-MxhrC42eaBwiAFabiUDxdo4oPwHZj4fyXp7hy2AugqWxn_7BIFOrIwDPOCAFWYxW0AGXYxzZVV-weFNeMuo9ZLP87Vw4y5QnwVg0g3Hw1w0BwWxxVvYNp77Gu4Yvj4uSVFTGEkNHDwyFayg-PJ41PM91Q-tUqTOkywmpuj8yrw-Z9NGsENgAdg1EWMI8Fa4S6UEnSb4XePuapYFDj1yHMQOwNMHnY8geaOkPyFRoSiK-SiyTQu2yvu8rTuMxr8vOaIiByGdRNv26eAn05JPN7tpsT_GAOPSQCSiQfh5v7f6ZzCCgFMAE&x-kcdn-pid=112757&pkey=AAVfrrRgjxtQu-rmceEw-n0m_3cLATL0VcNxCqF284bWZVokIb81gAKv9-KI1EP0dryvzLoRkxwy6mMr4T7ozVkOFpv_a8XO9k9CA__o74abDYOYwFsJwmAjnKs-k_YlZhc",
"watermark_url": null
},
{
"index": 1,
"url": "https://p2-fdl.klingai.com/ksc2/rWCvCx30utVQ7Il_Ia-Ugi6OxLB67Ii0noJKbLFJUhhrmfzwYn7RkAAA6Sp2xxImPpjriq3I7Ct3iTdhHc_6-hUZovAyz8oDwuXRc6aj6Yosk7ZtxaPzRMFky0SFafLvQmjXDS8_ZSglduEt4BNENXpzCo59Tbu4IAUCO_26kki31hFKeur7z3ZyfQILr-lmBqs7Fa-F63letx8PbO4ydg.png?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAHkMh90rdQQhwgg4eOelxRQR4skORZKNFoDwetwxRhF0Af3S8-0R3aPKqBEcIjcxUFgb8n36zw_djxJrmzzZCZDJ_ZvMgcwDTBX7S00RroqUcqqgDKGKJc0NfmclhZ_rPORaUxBTpHU4WHXaMy6RXEyZani_US5j1ovkQ5UXXp7uQ0fgG6h8yiy4cqRPcXABKCW_XcFd6Kx8fviONzmSUGu0vDYD8l2caIikdJT8qghTRoSK9DDR3Zts0AO39BBzVqoebvyIiBweZWLMu6ROzdvh2fZy7SdA8CVNFVV4CBrwYu-d0YpgigFMAE&x-kcdn-pid=112757&pkey=AAUlNpWne92A40ir-FNQnVyToczCQXitXf685fF_A-x1bVrCHRhMUONbEUOgAhR3sfAYLyTVsfg_iCeSkqzuf5UCQGS59c7hlAflcQC82_rWHR8aDpq1PwWNXB9MmVzYtVA",
"watermark_url": null
}
]
},
"final_unit_deduction": "16"
},
"request_id": "75d3e7ec-1284-4419-9832-8607fda3096d"
}
Text-to-Sound Effect
Create a text-to-sound effect task
Request URL
POST v1/ai/{endpointPath}/kling/audio/text-to-audio
Request Parameters
| Field | Type | Required | Default Value | Description |
|---|---|---|---|---|
| prompt | string | Required | None | Text prompt • Content length does not exceed 200 characters |
| duration | float | Required | None | Duration of the generated audio • Value range: 3.0 seconds to 10.0 seconds, supporting one decimal place of precision |
| external_task_id | string | Optional | None | Custom Task ID • User-defined task ID. Passing it in will not overwrite the system-generated task ID, but it supports task querying via this ID. • Please note that uniqueness must be ensured for a single user. |
| callback_url | string | Optional | None | Callback notification address for the result of this task. If configured, the server will proactively notify when the task status changes. |
Request Example
curl -g 'https://genaiapi-m2.cloudsway.net/v1/ai/{{endpointPath}}/kling/audio/text-to-audio' \
-H 'Authorization: Bearer {Your AK}' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "The sound of fireworks during Spring Festival celebrations.",
"duration": 3,
"external_task_id": "",
"callback_url": ""
}'
Return Example
{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "871457979416604766",
"task_status": "submitted",
"created_at": 1775800291981,
"updated_at": 1775800291981,
"task_info": {}
},
"request_id": "828f9782-d2e1-4550-a36d-e715ae2ae037"
}
Query text-to-sound effect task
Request URL
GET v1/ai/{endpointPath}/kling/audio/text-to-audio/{id}
task_id
Text-to-audio task ID: Request path parameter, directly fill the value in the request path, choose one of the two query methods with external_task_id
external_task_id
User-defined task ID. When creating a task, fill in the external_task_id, which is an alternative query method to task_id
Request Example
curl -g 'https://genaiapi-m2.cloudsway.net/v1/ai/{{endpointPath}}/kling/audio/text-to-audio/{id}' \
-H 'Authorization: Bearer {Your AK}' \
-H 'Content-Type: application/json'
Return Example
{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "871457647223545935",
"task_status": "succeed",
"created_at": 1775800212780,
"updated_at": 1775800228263,
"task_status_msg": "",
"task_info": {},
"task_result": {
"audios": [
{
"id": "871457647265472604",
"url": null,
"duration": null,
"url_mp3": "https://v1-fdl.kechuangai.com/ksc2/ErHLIqeozb1WHdz1Izp1XGMBtJebQoG3Cp-2dvW1aWViY8RLKpP-tk5x7W6eeTn2b9GYO9YFP-o6znENuMnJ_gfCTlDfVz_FxCmXqGQ_q9-dhYwdNq2aZ8d7OHlPbYDwz0EsdeQnxcY_WktB6fbeiN5oHMdZZX8Uptz-fQGeBJWReQzcvLau7vxSQFcBf1rU1kGJZD3nRhuRJ-QT0NE0SA.mp3?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAFXEmxe-C5r1GsrJ4R_tFpMHnPrbjCJDG0KIp-dlRASzaKKVZPnTgDc4lOQw0tb7j0a6SuaZpiXsbq5v7GDhAdOjAaaMEFTIEhrKwILiBTZGoMM-l7cRD7Ak1Ijpt7KdddfiPC78jYKpRJEQVhp4DUtiyq8gzSrs6IOPskVBlbkMrhYZjRCYaJlswSacwFokyXfVoigHmoCox4tWOKtHuxwm5f_cNbqIxHkA6_Z19xqBhoSj4dfrTYhUzYe6jlYP2ZR__D3IiDmgbsrWNwPG28XCgRF7KfT3EKY6rUhktnmmeKY_OffqCgFMAE&x-kcdn-pid=112757&pkey=AAXEF3UtKZpRO5SOnZyIm1g87c3z1b0907OuSWpmsuDt4YCj95yjTniBUsV4LWeF5xlebOHfqK04MbbxPGXsyKVxpOqoVRq45ysb_TG_D6tKUSyb4zwibeQsYkSxRnmsFQw",
"url_wav": "https://v1-fdl.kechuangai.com/ksc2/ax60xYdmxPhWhrgqKcjG_R9nmqBtwZMYjs5jpC56Q5hVdN5Oae3O7d7kzmoEMhSJ-9Xv7-jrsi3v2DL0aHod0XOhTY8qoSofHRwh02DrXweWPL3JnQlUb13iVF2821muQ1O_-1-cbKUP1pg-QpQUOHvhd_FydZUe36F6bnvEW3E9AvbB95J6K0py-whjEerp2Z59LoNZAo2cHPtKS0ncHQ.wav?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAHMhoi-CYC9uUILiob74ZeXGkx3LSdWf7QCCBzpAdPiIjTaWxyhiErxhtb1mMQxCeT-YmlFsuqdVOJ73bXn5w7A6kLgO27kbl4uM5IjmZV5_dwTGhllwW_B2UXMdfwFxKIfRPu93U3-2M-Y3chNNOd0GhtUteZ9KIQn9Xc9bSpncu6HeNoMhIVm76XCDYyldt54EFfx8yLB51QV6LFCnnOtiAzbD-srIaG7HPJtH5j5tRoSqwnSbF-azU9cbKSOb8doGVG2IiAf7HRWbkMraGIU3pE62uCrWJoBkKaBwUWwUTOYw9nlhCgFMAE&x-kcdn-pid=112757&pkey=AAVm6lQUh6-ZOYrSRgFdt0zru0pJpiVxoeU820BANf98nNF4I4T8nG-q9lNdkw01UgQWYSR7L3cr6v6MVHiyN3UfBhNJJ9SFSS9f4E4z1eAlaLm8L8p3Ew6-nhILspq7oQU",
"duration_mp3": "3.056",
"duration_wav": "3.0"
}
]
},
"final_unit_deduction": "0.25"
},
"request_id": "5571ddf9-0c33-44cd-8087-300bb47688ab"
}
Video-generated sound effects
Request URL
POST
https://genaiapi-m2.cloudsway.net /v1/ai/{endpointPath}/kling/audio/video-to-audio
Request Parameters
| Field | Type | Required | Default Value | Description |
|---|---|---|---|---|
| video_id | string | Optional | Empty | ID of the video generated by Keling AI Choose one of the video_url parameters to fill in, cannot be empty at the same time, and cannot have values at the same time Only videos generated within 30 days and with a length of 3.0-20.0 seconds are supported |
| video_url | string | Optional | None | Either the acquisition link of the uploaded video or the video_id parameter must be filled in; they cannot both be empty, nor can they both have values. Video formats only support MP4/MOV, with a file size ≤100M and a video length between 3.0 seconds and 20.0 seconds |
| sound_effect_prompt | string | Optional | None | Sound effect generation prompt Must not exceed 200 characters |
| bgm_prompt | string | Optional | None | Music generation prompt • Must not exceed 200 characters |
| asmr_mode | boolean | Optional | false | Whether to enable ASMR mode; this mode enhances detailed sound effects and is suitable for highly immersive content scenarios • true indicates enabled, false indicates disabled (default value) |
| external_task_id | string | Optional | None | Custom Task ID The user-defined task ID, when passed in, will not overwrite the system-generated task ID, but supports task querying via this ID. Please note that uniqueness must be ensured for a single user. |
| callback_url | string | Optional | None | Callback notification address for the result of this task. If configured, the server will proactively notify when the task status changes. |
Request Example
curl -g 'https://genaiapi-m2.cloudsway.net/v1/ai/{{endpointPath}}/kling/audio/video-to-audio' \
-H 'Authorization: Bearer {Your AK}' \
-H 'Content-Type: application/json' \
-d '{
"video_id": "",
"video_url": "https://p1-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/20fps-7s.mov"
}'
Return Example
{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "891066533651845201",
"task_status": "submitted",
"created_at": 1780475335623,
"updated_at": 1780475335623,
"task_info": {}
},
"request_id": "1a15fb7e-55d5-4671-a225-9b1255ec9eb9"
}
Query video sound effect generation task
Request URL
GET
https://genaiapi-m2.cloudsway.net /v1/ai/{endpointPath}/kling/audio/video-to-audio/{taskId或external_task_id}
task_id
Task ID for video-to-audio conversion. Fill in the value directly in the request path, and choose one of the two query methods between this and external_task_id
external_task_id
Custom task ID for video-to-audio conversion. When creating a task, you can choose either the external_task_id filled in or the task_id as the query method
Request Example
curl -g 'https://genaiapi-m2.cloudsway.net/v1/ai/{endpointPath}/kling/audio/video-to-audio/{{taskId}}' \
-H 'Authorization: Bearer {Your AK}' \
-H 'Content-Type: application/json'
Return Example
{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "891066533651845201",
"task_status": "succeed",
"created_at": 1780475335623,
"updated_at": 1780475355352,
"task_status_msg": "",
"task_info": {},
"task_result": {
"videos": [
{
"id": "891066533727334406",
"url": "https://v4-fdl.kechuangai.com/ksc2/pIhYL3dVgRzIZjbr_mtXwSnO-mFMOYpBNRZvVQr0GObbHXhyQDhajJlnZDkqRV1alXtac_YgQx_uhH3uzJi-Rl2O3PhQRC53fiO2e6WMDXGhmi7g815ttCePgbBJr6z-RhMdYsp5wa-z2LveqRW3PlDOZvf0Qq-MNXz2t2FKFrOMK0vM_ga0eXj5aNKw1v8bDqWEwkWWBOMw1KiI52s22A.mp4?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAE9x8atRoTH5Mm8dJVTPBZLhBcw_Mha80H5f9nLqZSyyVkmt278Cch2OoGX5WnCRTxhguD962gNNRRJh6GqG95WeL62ZbH4OyVac5yt5MpZWFVvhGZ5o6nqzaKspXv1rYwUi_F5TtN8EyBuf7xjTdtXhqkwOgmepBa-RkNyOIlYbYX_WkO4oDUrQJ9iqhoDCVDkKLakqWjuHbF6HTPXL5_fo6wOKzMky-u-xHTN409ERhoSxWNjcgh9zqt_zDfpYBGATs3tIiAtyQZsAVrEbrbUcgDLmT_oKIC4RtWIWNxbGPb2F2cj7ygFMAE&x-kcdn-pid=112757&pkey=AAWuEugjCUBB1hUq-78WXlTOZGpcujQAVkYLVnQHcauNei3PUvAGL_VCp-ioa7VVyUG0jKk6_8Nsk0VbhED1q32NkhjekLVU3C6XEVEzsy8sn8ncl0gGvWpccqGXiHGnqiw",
"duration": "7.0",
"watermark_url": null
}
],
"audios": [
{
"id": "891066533727334406",
"url": null,
"duration": null,
"url_mp3": "https://v4-fdl.kechuangai.com/ksc2/PwKaNvs74inTwaGRNUdProeaqYxkIugHq5gxmpYuF6_Bq3Rf1mQXG6YFO1GWHpuux_M_Sq7eyygXymiWBdheb5RgOeIqzIjXUZp1n2vKXUmX8-_Ph8QY4EoO-4YXz-GCcnvRVuO3bfkMQRP5Sn9-wrlqb3RslzhBTR4RXz59YsudHcn9SMDt9n95pF0NvBQSMRDRD60d3FgziyO2FL00GQ.mp3?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAG0d3O0zrvQiT9L8RWEu1Muj6kvx9ZhRWtXfrK9GsRqNBMX2eHAvysY1TN-Gf5dFwZ3uTUcZhybVOpkbfjeCDsX8Jh0-xLczu5_bqqHjkLbE0Wq3x71Bg7wsD_LQULOa8H4paXWWeUQlnaHXfxZkUB1_0As-dTlO2Ay4qcuJfXs0EW0-CebKhss1hQ5_VpICcBUdDRBOwSZpQbc0WLtLKaExEUNm_4AUH0-Sag647P_-RoSMiIwzDkRLkXJDo0Gm30rVg5KIiAN9uUf-XIGCdk1R8J4MqPpc55XNjt2SAtWpGTkV-gSUSgFMAE&x-kcdn-pid=112757&pkey=AAWOvU4t_N2wGKGQnrz3Ojf_BAd8-paIRypiG16RNAmNKtLtuJfto1n4jb2O0DJtbmmYqD8AnFnHbNKbqPMQEvmv9FqQb04E2xWJ4RajKLQQ6GtG_BtFZNGbl-NQm3f0VXY",
"url_wav": "https://v4-fdl.kechuangai.com/ksc2/YoIKDuPlFzX1I-Cf6yKRsdfPqYSvtuuJyzK5zsPA9bjATb_bgqLvuVSiYA624nFvL5P791zgra7sZReQtXkKMDxrpkdSAxUzSXvaRshlICsS-bgPPL8PmsY_1Zb2C-u2-qaxtkyZxlVx9wxtPKDwtSsjCJzf8PgrpuQ69gs2qWKwdAyx0m8xSgyDVn5QIYm0SXQjBxalEgjS25gTqcbhJQ.wav?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAHyi8EXBD7LRGhnJQdr6JITxQVXu_UtDsMQlW_9wM0dngCmRBmK7WHZ7xhHfCsenk9l2DBVCNDSUmmNLI00mdJV6R4hmpVezOL4VSn4cNfA81oXGh9e4K51V2n8aJSeA34cBmp9FZqGpk9rQqSMVPYkOeMWDV_iu71__JP7McV2WIp2RujV8gH1vFZNdHFxtB39rULDv6Kzuv9QuyfHKtnQP4OEgHtRcqWh4C1wd3s1mxoS0TR4h_eyjkvDOmDeFijUb3cSIiCeTEUvJvuOmrYlWCnVkBacBuPhJJB2DczaSedIuGK0xygFMAE&x-kcdn-pid=112757&pkey=AAVg69bYbOPqLaRAif2WQE6bdN5BPIg7AlrRmVkHQhSGCXjOaMgWZXZIXvWpHMM4yTW3pJv1iDHJBKFLqANBJ8CAUxI8gn3N4y2ht52AEL1GLHkZ6hYIUrq81xQPnNBcK8Y",
"duration_mp3": "7.026",
"duration_wav": "6.96"
}
]
},
"final_unit_deduction": "0.25"
},
"request_id": "7753c14c-26d0-4e3e-a12a-9bfff2737bef"
}