Skip to content

MaaS_KeLing_O3 Interface Document

Request Protocol

http

Request Header

Parameter Name Type Description
anthorization string Authentication

Video Generation

Create Video Generation Task Interface

Request URL

https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/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 Shot segmentation method
● Enumerated values: customize
● This parameter is required when the multi_shot parameter is true
prompt
string Optional Empty Text prompt, which can include positive and negative descriptions
● Prompts can be templated to meet different video generation needs. The Omni model can achieve multiple capabilities through Prompt with subjects, images, videos and other content: Specify a subject, image, video, etc., in the format of <<<>>>, such as: <<<element_1>>>, <<<image_1>>>, <<<video_1>>>
● The length cannot exceed 2500 characters
● This parameter cannot be empty when the multi_shot parameter is false or the shot_type parameter is intelligence

Different model versions support different scopes of capabilities, see the capability map above for details
multi_prompt
array Optional Empty Information of each shot, such as prompt, duration, etc.
● Define the shot sequence number and corresponding prompt and duration through the index, prompt, and duration parameters, where:
○ A maximum of 6 shots and a minimum of 1 shot are supported
○ The maximum length of the content related to each shot does not exceed 512
○ The duration of each shot is not greater than the total duration of the current task and not less than 1
○ The sum of the durations of all shots is equal to the total duration of the current task
● This parameter cannot be empty when the multi_shot parameter is true and the shot_type parameter is customize
image_list
array Optional Empty Reference image list
● Including reference images for subjects, scenes, styles, etc., which can also be used as the first or last frame to generate videos; when used as the first or last frame to generate videos:
○ Define whether the image is the first/last frame through the type parameter: first_frame for the first frame, end_frame for the last frame
■ Only the last frame is not supported temporarily, that is, if there is a last frame image, there must be a first frame image ○ When generating videos using the first frame or the first and last frames, the video editing function cannot be used;
● Supports passing in image Base64 encoding or image URL (ensure accessibility)
● Supported image formats are .jpg / .jpeg / .png
● The size of the image file cannot exceed 10MB, the width and height of the image are not less than 300px, and the aspect ratio of the image is between 1:2.5 ~ 2.5:1
● The number of reference images is related to the presence of reference videos and the number of reference subjects, among which:
○ 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 last frame is not supported;
● The image_url parameter value cannot be empty
  • Carried by key:value, as follows:
"image_list":[
        {
          "image_url":"image_url",
    "type":"first_frame"
  },
  {
          "image_url":"image_url",
    "type":"end_frame"
  }
]
Different model versions support different scopes of capabilities, see the capability map above for details
element_list array Optional Empty Reference subject list
● Configured based on the ID of the subject in the subject library, carried by key:value, as follows:
"element_list":[
        {
           "element_id":long
  },
  {
           "element_id":long
  }
]
● The number of reference subjects is related to the presence of reference videos and the number of reference images, among which:
○ When generating videos using the first frame or the first and last frames, a maximum of 3 subjects are supported;
○ When there is a reference video, the sum of the number of reference images and the number of reference subjects shall not exceed 4, and video character subjects are 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
● Subjects are divided into video customized subjects (referred to as: video character subjects) and image customized subjects (referred to as: multi-image subjects), with different scopes of application, please distinguish carefully

Different model versions support different scopes of capabilities, see the capability map above for details
video_list array Optional Empty Reference video, obtained through URL
● Can be used as a feature reference video or a video to be edited, default is the video to be edited; the original sound of the video can be optionally retained
○ Distinguish the type of reference video through the refer_type parameter: feature for feature reference video, base for 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 retain the original sound of the video through the keep_original_sound parameter, yes for retention, no for non-retention; this parameter also takes effect for feature reference videos (feature)
● When there is a reference video, the value of the sound parameter can only be off
● Carried by key:value, as follows:
"video_list":[
        {
          "video_url":"video_url",
    "refer_type":"base",
    "keep_original_sound":"yes"
  }
]
● Supported video formats are only MP4/MOV
● The video duration is not less than 3 seconds, and the upper limit is related to the model version, see the capability map above for details
● The video width and height dimensions must be between 720px (inclusive) and 2160px (inclusive)
● The video frame rate is based on 24fps~60fps, and the generated video will be output at 24fps
● Only one video can be uploaded at most, and the video size does not exceed 200MB
● The video_url parameter value cannot be empty

Different model versions support different scopes of capabilities, see the capability map above for details
sound string Optional off Whether to generate sound while generating the video
● Enumerated values: on, off
Only models of version V2.6 and later support this parameter
mode string Optional pro Mode of video generation
● Enumerated values: std, pro
● Among them, std: Standard Mode (Standard), basic mode, generates 720P video with high cost performance
● Among them, pro: Expert Mode (High Quality), high-performance mode, generates 1080P video with better video quality

Different model versions support different scopes of capabilities, see the capability map above for details
aspect_ratio string Optional Empty Aspect ratio (width:height) of the generated video
● Enumerated values: 16:9, 9:16, 1:1
● This parameter is required when the first frame reference or video editing function is not used
duration string Optional
5 Duration of the generated video, unit: s
● Enumerated values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, among which:
○ When using the video editing function ("refer_type":"base"), the output result is the same as the duration of the incoming video, and this parameter is invalid at this time; at this time, the measurement and billing are rounded to the nearest integer according to the duration of the input video

Different model versions support different scopes of capabilities, see the capability map above for details
watermark_info array Optional Empty Whether to generate watermarked results at the same time
● Defined by the enabled parameter
● Carried by key:value, as follows:
"watermark_info": {
         "enabled": boolean // true for generation, false for non-generation
}
● Custom watermarks are not supported temporarily
external_task_id string Optional Empty Custom task ID
● User-defined task ID, passing it in will not overwrite the task ID generated by the system, but supports task query through this ID
● Please note that uniqueness must be guaranteed under a single user
Request Example
curl --location --request POST 'https://genaiapi.cloudsway.net/v1/ai/{Your endpoint}/kling/videos/omni-video' \
--header 'Authorization: Bearer {YOUR_API_KEY}' \
--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": "kling-v3-omni-video-test001"
  }'
Return Value Example

{
  "code": 0, //Error code
  "message": "string", //Error message
  "request_id": "string", //Request ID, generated by the system, used to track requests and troubleshoot problems
  "data":{
        "task_id": "string", //Task ID, generated by the system
        "task_info":{ //Parameter information when the task is created
            "external_task_id": "string"//Customer-defined task ID
        }, 
    "task_status": "string", //Task status, enumerated values: submitted (Submitted), processing (Processing), succeed (Succeeded), failed (Failed)
    "created_at": 1722769557708, //Task creation time, Unix timestamp, unit: ms
    "updated_at": 1722769557708 //Task update time, Unix timestamp, unit: ms
  }
}

Query Video Task Interface

Request URL

https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/kling/videos/omni-video/{id}

Request Method

GET

Return Value Example

{
    "code": 0,
    "message": "SUCCEED",
    "data": {
        "task_id": "868616892989575248",
        "task_status": "succeed",
        "created_at": 1775122924191,
        "updated_at": 1775123026539,
        "task_status_msg": "",
        "task_info": {
            "parent_video": null
        },
        "task_result": {
            "videos": [
                {
                    "id": "868616893207679062",
                    "url": "{video}",
                    "duration": "5.041",
                    "watermark_url": null
                }
            ]
        },
        "final_unit_deduction": "5"
    },
    "request_id": "7eee6cf0-4870-469c-ba6e-48df0fa5c396"
}

Image Generation

Create Image Generation Task Interface

Request Method

POST

Request URL

https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/kling/images/omni-image

Request Parameters

Field Type Required Default Value Description
prompt string Required None Text prompt, which can include positive and negative descriptions
● Prompts can be templated to meet different image generation needs
● Cannot exceed 2500 characters
The Omni model can achieve multiple capabilities through Prompt with images and other content: Specify an image in the format of <<<>>>, such as: <<\>>
image_list
array Optional Empty Reference image list
• Carried by key:value, as follows:
"image_list":[
{ "image":"image_url" }
]
• Supports passing in image Base64 encoding or image URL (ensure accessibility)
• Supported image formats are .jpg / .jpeg / .png
• The size of the image file cannot exceed 10MB, the width and height of the image are not less than 300px, and the aspect ratio of the image is between 1:2.5 ~ 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 image_url parameter value cannot be empty
▾Hide sub-propertiesimage string Required: Image URL or Base64 string
element_list
array Optional Empty Subject reference list, configured based on the ID of the subject in the subject library
• Carried by key:value, as follows:
"element_list":[
{ "element_id": 829836802793406551 }
]
• 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
▾Hide sub-propertieselement_id long Required: ID of the subject in the subject library
resolution string Optional 1k Clarity of the generated image
● Enumerated values: 1k, 2k, 4k
1k: 1K Standard Definition
2k: 2K High Definition
4k: 4K Ultra High Definition

Different model versions support different scopes of capabilities, see the capability map above for details
result_type string Optional single Switch for single image/group image of generation results
● Enumerated values: single, series
Different model versions support different scopes, see the capability map above for details
n int Optional 1 Number of generated images
● Value range: [1,9]
● This parameter is invalid when the result_type value is series
series_amount
int Optional 4
Number of images in the generated group
● Value range: [2, 9]
● This parameter is invalid when the result_type value is single

Different model versions support different scopes, see the capability map above for details
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 generate video according to the incoming content
○ This parameter is invalid when generating new images with reference to the aspect ratio of the original image

Different model versions support different scopes, see the capability map above for details
watermark_info
array Optional Empty Whether to generate watermarked results at the same time
• Defined by the enabled parameter, the specific format is as follows:
"watermark_info": { "enabled": boolean }
• true for generation, false for non-generation
• Custom watermarks are not supported temporarily
callback_url string Optional None Callback notification address for the results of this task. If configured, the server will actively notify when the task status changes
external_task_id string
Optional None Custom task ID
● User-defined task ID, passing it in will not overwrite the task ID generated by the system, but supports task query through this ID
● Please note that uniqueness must be guaranteed under a single user
Request Example 1 (Introducing Images)
curl --location --request POST 'https://genaiapi.cloudsway.net/v1/ai/{Your endpoint}/kling/images/omni-image' \
--header 'Authorization: Bearer {YOUR_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt": "Fuse the characters in all images into the <<<object_1>>> image",
    "element_list": [
        {
            "element_id": 829836802793406551
        }
    ],
    "image_list": [
        {
            "image": "https://v1-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/multi-4.png"
        },
        {
            "image": "https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/video_effects/1.png"
        },
        {
            "image": "https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/video_effects/4.png"
        }
    ],
    "resolution": "2k",
    "n": 1,
    "aspect_ratio": "3:2"
  }'
Request Example 2 (Introducing Images + Subjects)
curl --location --request POST 'https://genaiapi.cloudsway.net/v1/ai/{Your endpoint}/kling/images/omni-image' \
--header 'Authorization: Bearer {YOUR_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt": "Generate a recommended cover for each subject <<element_1>> based on the style of the reference image <<image_1>>",
    "element_list": [
      {
        "element_id": "160"
      },
      {
        "element_id": "161"
      }
    ],
    "image_list": [
      {
        "image": "xxx"
      },
      {
        "image": "xxx"
      }
    ],
    "resolution": "2k",
    "result_type": "series",
    "series_amount": 2,
    "aspect_ratio": "auto",
    "external_task_id": "",
    "callback_url": ""
  }'
Return Value Example
{
  "code": 0, // Error code; see error codes for specific definitions
  "message": "string", // Error message
  "request_id": "string", // Request ID, generated by the system, used to track requests and troubleshoot problems
  "data": {
    "task_id": "string", // Task ID, generated by the system
    "task_info": { //Parameter information when the task is created
      "external_task_id": "string" //Customer-defined task ID
    },
    "task_status": "string", // Task status, enumerated values: submitted (Submitted), processing (Processing), succeed (Succeeded), failed (Failed)
    "created_at": 1722769557708, // Task creation time, Unix timestamp, unit: ms
    "updated_at": 1722769557708 //Task update time, Unix timestamp, unit: ms
  }
}

Query Image Task Interface

Request URL

GET

Request Method

https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/kling/images/omni-image/{id}

Return Value Example
{
  "code": 0, // Error code; see error codes for specific definitions
  "message": "string", // Error message
  "request_id": "string", // Request ID, generated by the system, used to track requests and troubleshoot problems
  "data": {
    "task_id": "string", // Task ID, generated by the system
    "task_status": "string", // Task status, enumerated values: submitted (Submitted), processing (Processing), succeed (Succeeded), failed (Failed)
    "task_status_msg": "string", // Task status information, displays the reason for failure when the task fails (such as triggering the platform's content risk control, etc.)
    "task_info": { //Parameter information when the task is created
      "external_task_id": "string" //Customer-defined task ID
    },
    "task_result": {
      "result_type": "single",
      "images": [
        {
          "index": 0, // Image number
          "url": "string", // URL of the generated image, anti-leech format (please note that for information security, generated images/videos will be deleted after 30 days, please transfer and save in a timely manner)
          "watermark_url": "string" // Watermarked image download URL, anti-leech format
        }
      ],
      "series_images": [
        {
          "index": 0, // Group image sequence number
          "url": "string", // URL of the generated image, anti-leech format (please note that for information security, generated images/videos will be deleted after 30 days, please transfer and save in a timely manner)
          "watermark_url": "string" // Watermarked image download URL, anti-leech format
        }
      ]
    },
    "watermark_info": { "enabled": boolean }, // Whether to contain watermark
    "final_unit_deduction": "string", // Final point deduction value of the task
    "created_at": 1722769557708, // Task creation time, Unix timestamp, unit: ms
    "updated_at": 1722769557708 //Task update time, Unix timestamp, unit: ms
  }
}

text-to-audio Effect

Create a text-to-audio effect task

Request URL

POST v1/ai/{endpointPath}/kling/audio/text-to-audio

Request parameters

Request Example

curl -g 'https://genaiapi.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 firecrackers celebrating Christmas",
    "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-audio effect task

Request URL

GET v1/ai/{endpointPath}/kling/audio/text-to-audio/{id}

task_id

Task ID for text-to-audio: a request path parameter, directly fill in 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 one of two query methods, either external_task_id or task_id

Request Example

curl -g 'https://genaiapi.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"
}

Digital Human

Create Task

Request URL

https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/kling/videos/avatar/image2video

Request Method

POST

Request Parameters

Field Type Required Default Value Description
image string Required None Digital human reference image
  • Supports passing image Base64 encoding or image URL (ensure accessibility)
Please note that if you use the base64 method, ensure that all your image data parameters are in Base64 encoding format. When submitting data, do not add any prefixes before the Base64 encoded string, such as data:image/png;base64,. The correct parameter format should be the Base64 encoded string directly. Example: Correct Base64 encoded parameter:
1
iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==
Incorrect Base64 encoded parameter (contains data: prefix):
1
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==
Please provide only the Base64 encoded string part so that the system can process and parse your data correctly.
  • Supported image formats: .jpg / .jpeg / .png
  • Image file size cannot exceed 10MB, image width and height are not less than 300px, and the aspect ratio is between 1:2.5 ~ 2.5:1
audio_id string Optional Empty Audio ID generated through the audition interface
  • Only supports audio generated within 30 days, with a duration of no less than 2 seconds and no more than 300 seconds
  • One of the audio_id and sound_file parameters must be selected; they cannot be empty at the same time, nor can they have values at the same time
sound_file string Optional Empty Audio file
  • Supports passing audio Base64 encoding or audio URL (ensure accessibility)
  • Supported audio formats: .mp3/.wav/.m4a/.aac (standard audio/aac format). Files that do not match the format or are too large will return error codes and other information. The file size cannot exceed 5MB.
  • Only supports audio with a duration of no less than 2 seconds and no more than 300 seconds
  • One of the audio_id and sound_file parameters must be selected; they cannot be empty at the same time, nor can they have values at the same time
  • The system will verify the audio content, and return error codes and other information if there are any issues
prompt string Optional Empty Positive text prompt
  • Can define digital human movements, emotions, camera movements, etc.
  • Cannot exceed 2500 characters
mode string Optional std Generated video mode
  • Enumerated values: std, pro
  • std: Standard mode (basic mode), cost-effective
  • pro: Pro mode (high quality), high-performance mode, generates videos with better quality
callback_url string Optional None Callback notification address for the results of this task. If configured, the server will actively notify when the task status changes
  • See "Callback Protocol" for the specific notification message schema
external_task_id string Optional Empty Custom task ID
  • User-defined task ID. Passing it in will not overwrite the task ID generated by the system, but querying tasks through this ID is supported
  • Please note that uniqueness must be guaranteed under a single user

Request Example

curl --location --request POST 'https://genaiapi.cloudsway.net/v1/ai/{Your endpoint}/kling/videos/avatar/image2video' \
--header 'Authorization: Bearer {YOUR_AK}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt": "An ancient-style girl singing an ancient-style song",
    "image": "https://p4-fdl.klingai.com/ksc2/TYBZGeCy2X-AlFG2BzHJ99DxeGPQbOjXamDu3v9Ecq_e1eVlu7H6D_7IaorVJr3aH2UyymnOb_3CRnbu2QnLT3C1hFoLUFPb3j6cJSPP_PIcVEtEEDaSrmRLy50znof-z86Vbg9peLFFbQd9aXFM4h3q3DjVzXP22cgxCkJKzJ-GxXn9qQOm8P_Qd-rVy_CbUL6j_X5lriXPkG9YE1WUaQ.png?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAEAMvnTk2zeXWfHeE0x9-pJh5qSzTyipQE_qi7aNWPgsddpyhPpG1XOFZN8VC6pYGtcInKWCqBjsY_Zl1MnQaGffyadf_kRG2g781a0d3ikEVHJeZiCt0gJrQCv6mWm8HgW53FZ1UXtupVe1FJnkLMa5JCneEIJbHkXnms2Y2UwuMl4n9fzbdM6MhKVFmIkwu2saYsguXLHUBAkSspuTQa2_S00cGfMA68qPJQeFlgp5BoSiLisQ3JW5QwpPz64VCCZ6-c0IiAUG1fwWBGOMfuSHLam2QirUp0YC0HTBFqFSZnYSqQIgSgFMAE&x-kcdn-pid=112757&pkey=AAX9eJQ7p7gVFmiSYauqc3rcObOQZTQe4Z-HxAnAq7xbot2_iV48hlKJKUvAsvHQVak75dca3mJ5SippG1VL4HWbOJmksckSyffvVHVKk-p-q19Vkc1JZ9sK2aaYeDFVLBI",
    "sound_file":"https://cdn.mureka.ai/cos-prod/open/song/20251229/113366463152129-9DDrRrRu26n4iifY3Rgbyb.mp3"
}'

Return Value Example

{
  "code": 0, //Error code; see error codes for specific definitions
  "message": "string", //Error message
  "request_id": "string", //Request ID, generated by the system, used to track requests and troubleshoot problems
  "data":{
    "task_id": "string", //Task ID, generated by the system
    "task_info":{ //Parameter information at task creation
       "external_task_id": "string" //Customer-defined task ID
    }, 
    "task_status": "string", //Task status, enumerated values: submitted (submitted), processing (processing), succeed (succeeded), failed (failed)
    "created_at": 1722769557708, //Task creation time, Unix timestamp, unit: ms
    "updated_at": 1722769557708 //Task update time, Unix timestamp, unit: ms
  }
}

Query Task

Request URL

https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/kling/videos/avatar/image2video/{task_id}

Request Method

GET

Request Parameters

Field Type Required Default Value Description
task_id string Optional None Digital human task ID
Request path parameter, fill the value directly in the request path

Return Value Example

{
  "code": 0, //Error code; see error codes for specific definitions
  "message": "string", //Error message
  "request_id": "string", //Request ID, generated by the system, used to track requests and troubleshoot problems
  "data":{
          "task_id": "string", //Task ID, generated by the system
    "task_status": "string", //Task status, enumerated values: submitted (submitted), processing (processing), succeed (succeeded), failed (failed)
    "task_status_msg": "string", //Task status information, displays the reason for failure when the task fails (such as triggering platform content risk control, etc.)
    "task_info": { //Parameter information at task creation
      "external_task_id": "string"//Customer-defined task ID
    },
    "task_result":{
      "videos":[
        {
                "id": "string", //Generated video ID; globally unique
                      "url": "string", //URL of the generated video, e.g., https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_46554461/-2878350957757294165/output.mp4 (Please note that for information security, generated images/videos will be deleted after 30 days, please transfer and save them in a timely manner)
                      "duration": "string" //Total video duration, unit: s
        }
      ]
    },
    "created_at": 1722769557708, //Task creation time, Unix timestamp, unit: ms
    "updated_at": 1722769557708 //Task update time, Unix timestamp, unit: ms
  }
}