Skip to content

Keling Universal Protocol API (Text-to-Image / Image-to-Image / Motion Control / Omni)

Model Description

ability MaaS_KeLing_3.0_turbo MaaS_KeLing_3.0_video
MaaS_KeLing_V2.6
MaaS_KeLing_V2.5_turbo MaaS_KeLing_3O_video MaaS_KeLing_O1_video
Text-to-Video
Image-to-Video
Motion Control
Omni Video

Functional Interface Details

Text-to-Video

Request URL

POST 
https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/videos/text-to-video

Applicable models (endpoints): MaaS_KeLing_3.0_turbo / MaaS_KeLing_3.0_video / MaaS_KeLing_V2.6 / MaaS_KeLing_V2.5_turbo.

Request Body Parameters

Parameter Name Field Type Required or not default value Description
prompt
string Yes - Text prompts, which can include positive descriptions and negative descriptions. Length:
MaaS_KeLing_3.0_turbo/ MaaS_KeLing_3.0_videomust not exceed 3072 characters, and it is recommended to keep it under 2500;
MaaS_KeLing_V2.6/ MaaS_KeLing_V2.5_turbomust not exceed 2500 characters
settings object No
- Output configuration-related parameters, such as definition, duration, etc.
settings.multi_shot
boolean
No
true Whether to generate a multi-camera video. Only MaaS_KeLing_3.0_videosupports this feature; When set to false, multi-camera videos cannot be generated even if a prompt in multi-camera format is used. MaaS_KeLing_3.0_turbodoes not have this field, but multi-Camera functionality can still be achieved via a fixed prompt format (see supplementary instructions).
MaaS_KeLing_V2.6/ MaaS_KeLing_V2.5_turbonot supported
settings.audio string No
off Whether to generate a video with audio. Supported values: native, off.
Only MaaS_KeLing_3.0_video/ MaaS_KeLing_V2.6is supported;
MaaS_KeLing_3.0_turbo/ MaaS_KeLing_V2.5_turboare not supported.
MaaS_KeLing_V2.6: Only 1080P resolution is supported when generating audio videos.
settings.resolution string No 720p The clarity of the generated video. Optional values: MaaS_KeLing_3/ MaaS_KeLing_V2/ MaaS_KeLing_V2for 720p, 1080p; MaaS_KeLing_3for 720p, 1080p, 4k
settings.aspect_ratio string No 16:9 Specifies the aspect ratio (width: height) of the generated video. Supported values: 16:9, 9:16, 1:1 (all the above text-to-video models support these values)
settings.duration int No 5 Set the video duration in seconds. Available values: MaaS_KeLing_3.0_turbo/ MaaS_KeLing_3.0_videorange from 3 to 15;MaaS_KeLing_V2.6/ MaaS_KeLing_V2.5_turbosupport 5 and 10 only
options object No - General configurations, such as callback address, whether to include watermark, etc.
options.callback_url string No - This is the callback notification address for the result of this task. If configured, the server will actively send a notification when the task status changes. For the specific message schema of the notification, please refer to the Kling Callback Protocol.
options.external_task_id
string No - Custom task ID. Passing this parameter will not overwrite the system-generated task ID, but you can use this ID to query the task. Please note that this ID must be unique for a single user.
options.watermark_info object No - Specifies whether to generate a watermarked result simultaneously. Custom watermarks are not supported for now.
options.watermark_info.enabled boolean No false true means to generate, false means not to generate

Supplementary Notes:

Keling Video 3.0 / 3.0 Turbo models can deliver a wide range of capabilities via prompts and other inputs:

  1. Multi-shot videos can be generated in a fixed format as "Shot n, m, words; Shot n, m, words;", separated by half-width symbols, where:

  2. n: Storyboard serial number; a maximum of 6 storyboards are supported, and a minimum of 1 storyboard is supported

  3. m: Duration of each storyboard panel; the duration of a single storyboard panel shall not be less than 1, and the sum of the durations of all storyboard panels shall be equal to the total duration of the currently generated video

  4. words: storyboard prompt; maximum length 512

  5. Prompt templating can be adopted to meet diverse video generation requirements.

3) For more information, please refer to the official Kling "Kling Video 3.0 Model User Guide"

Response Parameters (Create)

Parameter Name Field Type Description
code int Error code; for specific definitions, please refer to the error code
message string Error Message
request_id string Request ID, generated by the system, for request tracking and troubleshooting
data.id string System-generated Task ID / Queried Task ID
data.status string Task status, enumerated values: submitted, processing, succeeded, failed
data.create_time long Task creation time, Unix timestamp, in milliseconds
data.update_time long Task update time, Unix timestamp, in milliseconds
data.external_id string Custom task ID of this task (if any)

Request Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/videos/text-to-video' \
--header 'Authorization: Bearer {YOUR_AK}' \
--header 'Content-Type: application/json' \
--data '{
    "prompt": "A girl sat on the train, looking out the window with a melancholic expression, her head swaying with the train.",
    "settings": {
        "resolution": "720p",
        "aspect_ratio": "9:16",
        "duration": 5
    },
    "options": {
        "callback_url": "https://your.domain/callback",
        "external_task_id": "",
        "watermark_info": { "enabled": false }
    }
}'

Response Example

{
  "code": 0,
  "message": "string",
  "request_id": "string",
  "data": {
    "id": "893605946402811985",
    "status": "submitted",
    "create_time": 1781080778802,
    "update_time": 1781080794151,
    "external_id": "string"
  }
}

Image-to-Video

Request URL

POST 
https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/videos/image-to-video

Applicable models (endpoints): MaaS_KeLing_3.0_turbo/ MaaS_KeLing_3.0_video/ MaaS_KeLing_V2.6/ MaaS_KeLing_V2.5_turbo.

Request Body Parameters

Parameter Name Field Type Required or not default value Description
contents array Yes - Refer to the creatives collection, such as prompts, images, subjects, timbres, etc. Relevant fields of the same creative shall be placed in the same directory structure
contents[].type
string Yes - Creatives type. Optional values by model: MaaS_KeLing_3.0_turbo: prompt, first_frame;

MaaS_KeLing_3.0_videopromptfirst_framelast_frameelement

MaaS_KeLing_V2.6promptfirst_framelast_framevoice

MaaS_KeLing_V2.5_turbopromptfirst_framelast_frame
contents[].text string No - type= prompt: the text prompt. Length: MaaS_KeLing_3.0_videomust not exceed 3072 (recommended to be no more than 2500);

MaaS_KeLing_3.0_turbo/ MaaS_KeLing_V2.6/ MaaS_KeLing_V2.5_turbomust not exceed 2500
contents[].url string No - type= first_frame/ last_frameReference image, supports URL or Base64. Supported image formats:. jpg /. jpeg /. png; file size must not exceed 50MB; width and height dimensions must be no less than 300px; aspect ratio must be between 1:2.5 and 2.5:1
contents[].element_id string No - type= elementsubject ID (generated by the system and returned by querying subject-related APIs). Only MaaS_KeLing_3.0_videois supported; a maximum of 3 subjects can be specified.
contents[].voice_id string No - type= voicespecifies the timbre ID (custom or preset) when this parameter is set. This feature is only supported on MaaS_KeLing_V2.6;a maximum of 2 timbres can be referenced; when a timbre is specified, settings. audiocannot be set to off; specifying a timbre is not supported when generating a silent video.
contents[].id string No - Creatives index ID, used for specifying in the prompt via @xxx; this parameter cannot be duplicated within the same task. Applicable to the scenarios of subject (MaaS_KeLing_3.0_video) and voice (MaaS_KeLing_V2.6)
settings object No - Output configuration-related parameters, such as definition, duration, etc.
settings.multi_shot boolean No
true Whether to generate multi-scene videos. Only MaaS_KeLing_3.0_videosupports this feature; when set to false, multi-scene videos cannot be generated even if a multi-scene format prompt is used. MaaS_KeLing_3.0_turbodoes not have this field, but multi-scene videos can still be generated via a fixed prompt format (see supplementary instructions). MaaS_KeLing_V2.6/ MaaS_KeLing_V2.5_turbodo not support this feature.
settings.audio string No off Whether to generate a video with audio. Optional values: native, off. Only MaaS_KeLing_3.0_video/ MaaS_KeLing_V2.6are supported;

MaaS_KeLing_3.0_turbo/ MaaS_KeLing_V2.5_turboare not supported.
MaaS_KeLing_V2.6: Only 1080P resolution is supported when generating audio videos; specifying a voice timbre is not supported when generating silent videos
settings.resolution string No 720p The clarity of the generated video. Optional values: MaaS_KeLing_3.0_turbo/ MaaS_KeLing_V2.6/ MaaS_KeLing_V2.5_turbosupport 720p, 1080p;

MaaS_KeLing_3.0_video720p1080p4k

MaaS_KeLing_V2.6/ MaaS_KeLing_V2.5_turbo:When generating a video using the first and last frames, only 1080P video generation is supported;
MaaS_KeLing_V2.6only supports 1080P when audio is present
settings.duration int No 5 Set the video duration in seconds. Available values: MaaS_KeLing_3.0_turbo/ MaaS_KeLing_3.0_videorange from 3 to 15;
MaaS_KeLing_V2.6/ MaaS_KeLing_V2.5_turboare 5 and 10
options object No - General configurations, such as callback address, whether to include watermark, etc.
options.callback_url string No - This is the callback notification address for the result of this task. If configured, the server will actively send a notification when the task status changes. For the specific message schema of the notification, please refer to the Kling Callback Protocol.
options.external_task_id string No - Custom task ID. Passing this parameter will not overwrite the system-generated task ID, but you can use this ID to query the task. Please note that this ID must be unique for a single user.
options.watermark_info object No - Specifies whether to generate a watermarked result simultaneously. Custom watermarks are not supported for now.
options.watermark_info.enabled boolean No false true means to generate, false means not to generate

Supplementary Note (Excerpted from Official Sources):

Frame Mode:

  • MaaS_KeLing_3.0_turbo: supports image-to-video generation with only the first frame, and does not currently support first frame + last frame or only last frame

  • MaaS_KeLing_3.0_video/ MaaS_KeLing_V2.6/ MaaS_KeLing_V2.5_turbo: Support video generation from only the first frame image and from both the first and last frame images, do not support video generation from only the last frame image; the first frame is a required field, and the last frame is an optional field

Keling Video 3.0 / 3.0 Turbo models can deliver a wide range of capabilities via prompts and other inputs:

  1. Multi-shot videos can be generated in a fixed format as "Shot n, m, words; Shot n, m, words;", separated by half-width symbols, where:

  2. n: Storyboard serial number; a maximum of 6 storyboards are supported, and a minimum of 1 storyboard is supported

  3. m: Duration of each storyboard panel; the duration of a single storyboard panel shall not be less than 1, and the sum of the durations of all storyboard panels shall be equal to the total duration of the currently generated video

  4. words: storyboard prompt; maximum length 512

  5. (MaaS_KeLing_3.0_video) You can specify a specific subject in the format of @xxx, for example:@Zhang

3) (MaaS_KeLing_3.0_video) Please avoid having an inclusive relationship between different subject names, for example:@Zhangand @ZhangSan

4) (MaaS_KeLing_3.0_video) Please avoid the subject name being identical to part of the content in the Prompt, for example:@gmailand My email address is wang@gmail. com

  1. Prompt templating can be adopted to meet diverse video generation requirements.

  2. For more information, please refer to the official Kling "Kling Video 3.0 Model User Guide"

MaaS_KeLing_V2.6: You can specify a specific timbre in the format of @xxx, for example:@sweet.

Request Example (First Frame)

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/videos/image-to-video' \
--header 'Authorization: Bearer {YOUR_AK}' \
--header 'Content-Type: application/json' \
--data '{
    "contents": [
        { "type": "prompt", "text": "A girl sat on the train, looking out the window with a melancholic expression, her head swaying with the train." },
        { "type": "first_frame", "url": "https://example.com/start-frame.jpg" }
    ],
    "settings": {
        "resolution": "1080p",
        "duration": 10
    },
    "options": {
        "callback_url": "https://your.domain/callback",
        "watermark_info": { "enabled": false }
    }
}'

Motion Control

Request URL

POST https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/motion-control

Applicable models (endpoints): MaaS_KeLing_3.0_video/ MaaS_KeLing_V2.6. The new protocol is contents + settings + options; the path is aligned with the official one, with no /videosprefix.

Request Body Parameters

Parameter Name Field Type Required or not default value Description
contents array Yes - Reference creatives collection, such as prompt words, image reference images, action reference videos, and subjects
contents[].type
string Yes - Creatives type. Supported values: MaaS_KeLing_3.0_videoinclude prompt, image, video, element;

MaaS_KeLing_V2.6promptimagevideo(无 element
contents[].text string No - type= promptis the text prompt. You can use prompts to add elements to the scene, achieve camera movement effects, etc. ; the content length must not exceed 2500 characters
contents[].url
string No - type= imageindicates an image reference (supports URL or base64); when type= video, it refers to an action reference video (only URL is supported, base64 is not supported)
contents[].element_id
string
No - type= elementthe subject ID at this time. Only MaaS_KeLing_3.0_videois supported; a maximum of 1 subject can be specified; when referencing a subject, the generated video can only temporarily refer to the character orientation in the video (character_orientationmust be video)
contents[].id string No - Creatives index ID; must not be duplicated within the same task (for main scenario usage)
settings object No - Output relevant configuration parameters, such as character orientation, clarity, etc.
settings.character_orientation
string Yes - Specify the orientation of the character in the generated video. Supported values: image (consistent with the character's orientation in the source image; the reference video duration must not exceed 10 seconds), video (consistent with the character's orientation in the reference video; the reference video duration must not exceed 30 seconds). The minimum duration of the reference video is no less than 3 seconds.
settings.audio string No original Whether to generate a video with audio. Optional values: original (retain the original audio of the reference video), off (no audio). Note: Motion control is not a native feature of text-to-video/image-to-video native
settings.resolution string No 720p The resolution of the generated video. Optional values: 720p, 1080p (MaaS_KeLing_3.0_video/ MaaS_KeLing_V2.6are the same)
options object No - General configurations, such as callback address, whether to include watermark, etc.
options.callback_url
string
No - This is the callback notification address for the result of this task. If configured, the server will actively send a notification when the task status changes. For the specific message schema of the notification, please refer to the Kling Callback Protocol.
options.external_task_id string
No - Custom task ID. Passing this parameter will not overwrite the system-generated task ID, but you can use this ID to query the task. Please note that this ID must be unique for a single user.
options.watermark_info object No - Specifies whether to generate a watermarked result simultaneously. Custom watermarks are not supported for now.
options.watermark_info.enabled boolean No false true means to generate, false means not to generate

Supplementary Note (Excerpted from Official Sources):

Content requirements for the reference image (image):

  • Try to keep the character proportions in the image consistent with those in the reference video as much as possible, and avoid generating images by driving a half-body character with full-body motions.

  • The subject must have clear upper body or full-body limbs and head exposed, with no occlusion.

  • Avoid extreme orientations of the person in the frame, such as handstands, lying flat, etc. ; the proportion of the person in the frame shall not be too low.

  • Supports realistic/stylized characters (including human characters, anthropomorphic animals, some pure animals, and characters with partially anthropomorphic limb proportions)

  • Supported image formats:. jpg /. jpeg /. png; file size must not exceed 50MB; width and height dimensions shall be no less than 300px; aspect ratio shall be within the range of 1:2.5 to 2.5:1

Content requirements for action reference video (video):

  • The subject must have clear upper body or full body including all limbs and head, with no occlusion.

  • It is recommended to upload a video of a single person performing an action; if there are two or more people in the video, the action of the person occupying the largest proportion of the frame will be used for generation.

  • It is recommended to use real human motions, and the stylized proportions of characters/human-like limbs can be adjusted via

  • Action videos must be shot in a single continuous take, with the character always present in the frame; avoid any shot cuts or camera movements, otherwise the footage will be intercepted.

  • Avoid overly fast movements; relatively smooth movements yield better generation results.

  • If the action is highly difficult and fast-paced, there is a certain probability that the generated result will be shorter than the duration of the uploaded video; the model only extracts the duration of valid actions; generation can be completed as long as a minimum of 3 seconds of usable continuous actions are extracted;Points will be deducted based on the duration of the output video

  • The system will verify the video content

  • Supported video formats:. mp4 /. mov; file size must not exceed 100MB; width and height range from 340 to 3850px; duration ≥ 3s, the upper limit varies with character_orientation (video→ 30s / image→ 10s)

Response / Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/motion-control' \
--header 'Authorization: Bearer {YOUR_AK}' \
--header 'Content-Type: application/json' \
--data '{
    "contents": [
        { "type": "prompt", "text": "smooth dance motion" },
        { "type": "image", "url": "https://example.com/character.jpg" },
        { "type": "video", "url": "https://example.com/motion.mp4" }
    ],
    "settings": {
        "character_orientation": "video",
        "resolution": "1080p",
        "audio": "original"
    },
    "options": {
        "callback_url": "https://your.domain/callback"
    }
}'

Omni Video Generation

Request URL

POST https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/omni-video

Applicable models (endpoints): MaaS_KeLing_3.0_video-omni/ MaaS_KeLing_O1_video.

Request Body Parameters

Parameter Name Field Type Required or not default value Description
contents
array Yes - Reference creatives collection, such as prompts, images, subjects, videos, etc.
contents[].type
string Yes - Creatives type. Optional values (same for both models): prompt, first_frame, last_frame, refer_image, feature_video, base_video, element
contents[].text string No - type= promptspecifies the text prompt. Length requirements: MaaS_KeLing_3.0_video-omnimust not exceed 3072 (recommended to stay under 2500);MaaS_KeLing_O1_videomust not exceed 2500
contents[].url string No - Image type (first_frame/ last_frame/ refer_image) supports URL or base64; for constraints on video type (feature_video/ base_video), please refer to the supplementary instructions
contents[].element_id string
No - type= elementthe subject ID at this time. MaaS_KeLing_3.0_video-omnisupports video character subjects + multi-image subjects;MaaS_KeLing_O1_video only supports multi-image subjects, and does not support video character subjects. For the quantity upper limit and whether it is paired with a reference video/first and last frames, please refer to the supplementary instructions
contents[].id string No - Creatives index ID, used to specify in the prompt via @xxx (e. g. image @image_1, subject @Zhang, video @video_1); must not be duplicated within the same task
settings object No - Output configuration-related parameters, such as definition, duration, etc.
settings.multi_shot boolean No true Whether to generate a multi-camera video. Only MaaS_KeLing_3.0_video-omnisupports this feature; when set to false, a multi-camera video cannot be generated even if a multi-camera format prompt is used. MaaS_KeLing_O1_videodoes not support this feature
settings.audio string No off Whether to generate a video with audio. Supported values: MaaS_KeLing_3.0_video-omnican be native, original, off;

MaaS_KeLing_O1_videooriginaloff(无 native)。

When using feature_video, simultaneous audio and video output is not supported, and audiocan only be set to off;

When using base_video, audiocannot be native
settings.resolution string No 720p The resolution of the generated video. Optional values: MaaS_KeLing_3.0_video-omnisupports 720p, 1080p, 4k;

MaaS_KeLing_O1_videosupports 720pand 1080p
settings.aspect_ratio string No 16:9 The aspect ratio (width: height) of the generated video. Supported values: 16:9, 9:16, 1:1. MaaS_KeLing_3.0_video-omni: This parameter is required when no first frame image or reference video is provided;MaaS_KeLing_O1_video: This parameter is required when neither a first frame image nor a reference video is provided
settings.duration int No 5 Generate the video duration, in seconds (s). Available values: MaaS_KeLing_3.0_video-omni: 3~15;MaaS_KeLing_O1_video: 3~10, and only values 5 or 10 are supported when only the first frame is provided and no other reference images/videos are available.
options object No - General configurations, such as callback address, whether to include watermark, etc.
options.callback_url string No - This is the callback notification address for the result of this task. If configured, the server will actively send a notification when the task status changes. For the specific message schema of the notification, please refer to the Kling Callback Protocol.
options.external_task_id string No - Custom task ID. Passing this parameter will not overwrite the system-generated task ID, but you can use this ID to query the task. Please note that this ID must be unique for a single user.
options.watermark_info object No - Specifies whether to generate a watermarked result simultaneously. Custom watermarks are not supported for now.
options.watermark_info.enabled boolean No false true means to generate, false means not to generate

Supplementary Note (Excerpted from Official Sources):

Kling Video 3.0 Omni model can realize multiple capabilities through content such as prompts:

  1. Multi-shot videos can be generated in a fixed format as "Shot n, m, words; Shot n, m, words;", separated by half-width symbols, where:

  2. n: Storyboard serial number; a maximum of 6 storyboards are supported, and a minimum of 1 storyboard is supported

  3. m: Duration of each storyboard panel; the duration of a single storyboard panel shall not be less than 1, and the sum of the durations of all storyboard panels shall be equal to the total duration of the currently generated video

  4. words: storyboard prompt; maximum length 512

  5. You can specify a specific image, subject, or video in the format of @xxx, for example:@image_1, @Zhang, @video_1

3) Please avoid having an inclusive relationship between the names of different entities, for example:@Zhangand @ZhangSan

4) Please avoid the subject name being identical to part of the content in the Prompt, for example:@gmailand the identical segment in email-related text

  1. For more information, please refer to the official Kling Omni User Guide

Kling Video O1 model can realize multiple capabilities through content such as prompts:

  1. You can specify a specific image, subject, or video in the format of @xxx, for example:@image_1, @Zhang, @video_1

  2. Please avoid an inclusive relationship between the names of different entities; please avoid the entity name being identical to part of the content in the Prompt.

3) O1 None No fixed multi-camera format specifications; for more details, please refer to the official Kling O1 user guide

图片(first_frame / last_frame / refer_image):

  • Format .jpg/.jpeg/.png; ≤ 50MB; width and height ≥ 300px; aspect ratio 1:2.5\~ 2.5:1; supports url or base64

  • First/last frame: Supports only the first frame, and first + last frame; does not support only the last frame

  • MaaS_KeLing_O1_video: When using the start and end frames, adding additional reference images is not supported; the subject function is not supported when using the start and end frames.

  • Maximum Number of Reference Images (in combination with the main subject):

  • MaaS_KeLing_3.0_video-omni: When there is no reference video and only multi-image subjects are involved, the total number of reference images plus multi-image subjects shall be no more than 7; when there is no reference video but both video character subjects and multi-image subjects are involved, the total number shall be no more than 4; when there is a reference video and only multi-image subjects are involved, the total number shall be no more than 4;When a reference video is provided, video character subjects and reference images are not supported simultaneously.

  • MaaS_KeLing_O1_video: When there is no reference video but multiple image subjects, the total number of reference images plus multiple image subjects shall be ≤7; when there is a reference video plus multiple image subjects, the total number shall be ≤4

视频(feature_video / base_video):

  • Format:. mp4 /. mov; File size ≤ 200MB; Maximum 1 reference video

  • Duration: MaaS_KeLing_3.0_video-omniis 3~15.5s;MaaS_KeLing_O1_videois 3~10s

  • Resolution: MaaS_KeLing_3Width and height 700\~ 4553px, total pixel area ≤ 8294400, aspect ratio 0.4\~ 2; MaaS_KeLing_O1_videoWidth and height 700\~ 2160px

  • Frame rate: Input 24~60fps, Output 24fps

  • feature_video: For multi-camera scenarios, multi_shotcan only be set to true; simultaneous audio and video output is not supported, and audiocan only be set to off. MaaS_KeLing_O1_videoonly supports defining the first frame of a video, and does not support defining the last frame.

  • base_video: does not support defining the first/last frame; does not support multi-camera shots;audiocannot be native

Subject (element):

  • MaaS_KeLing_3.0_video-omni: For the first frame or the first and last frame scenarios, the maximum number of subjects is 3; when there is no video and only multiple images, the number shall be ≤7; when there is no video and only video characters, the number shall be ≤3; when there is no video and both exist, the number of video characters shall be ≤3 and the total number of images plus multiple images shall be ≤4; when there is a video and only multiple images, the number shall be ≤4; when there is a video and only video characters, the number shall be ≤1;When a reference video is provided, video character subjects and multi-image subjects are not supported simultaneously

  • MaaS_KeLing_O1_video: Supports multi-image subjects only; subject specification is not supported when using the first and last frames; when no reference video is provided, the total number of images + subjects shall be ≤7; when a reference video is provided, the total number shall be ≤4

Response / Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/omni-video' \
--header 'Authorization: Bearer {YOUR_AK}' \
--header 'Content-Type: application/json' \
--data '{
    "contents": [
        { "type": "prompt", "text": "cinematic shot of the character walking in the rain" },
        { "type": "refer_image", "url": "https://example.com/ref.jpg", "id": "img1" }
    ],
    "settings": {
        "resolution": "1080p",
        "duration": 5,
        "aspect_ratio": "16:9",
        "audio": "off"
    },
    "options": {
        "callback_url": "https://your.domain/callback"
    }
}'

Query Task (General Protocol)

Request URL

GET https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/general/tasks?task_id={id}

Or:

GET https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/general/tasks?external_task_id={id}

Request Query Parameters

Parameter Name Field Type Required or not default value Description
task_id string No - The task ID defined by the system to be queried (single). Either this or external_task_idis required.
external_task_id string No - The custom task ID to be queried (single). Either this parameter or task_idis required.

Response Parameters (Successful Task Summary)

Parameter Name Field Type Description
code int Error code; for specific definitions, please refer to the error code
message string Error Message
request_id string Request ID, generated by the system, for request tracking and troubleshooting
data array Task list
data[].id string Queried task ID
data[].status string Task status, enumerated values: submitted, processing, succeeded, failed
data[].create_time long Task creation time, Unix timestamp, in ms
data[].update_time long Task update time, Unix timestamp, in milliseconds (ms)
data[].external_id string Custom task ID of this task (if any)
data[].outputs array Generate result list (on success)
data[].outputs[].type string Content type of the generation result; enumeration values: image, video, audio, element, voice; the returned fields will vary for different content types
data[].outputs[].url string URL of the generated result (Please note that for information security purposes, the generated images/videos will be cleared after 30 days, so please save them in time)
data[].outputs[].duration string Duration of the generated video, unit: seconds
data[].billing array For deduction details, see §2.1
data[].billing[].amount string Deduction amount; in the quota consumption scenario (charge_type= cash), it represents the discounted price deducted from the quota; in the resource package consumption scenario (charge_type= unit), it represents the points deduction amount; decimal

Request Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/kling/general/tasks?task_id=893605946402811985' \
--header 'Authorization: Bearer {YOUR_AK}'