Skip to content

MaaS_KL_3.0_turbo

Text-to-Video

Request URL

POST

https://genaiapi-m2.cloudsway.net/v1/ai/{endpointPath}/kling/videos/text-to-video/kling-3.0-turbo

Request Parameters

Field Type Required Default Value Description
prompt string Required None Text prompt, which can include positive and negative descriptions
  • The content length cannot exceed 3072 characters, and it is recommended that the content length not exceed 2500 characters
  • Prompt templates can be used to meet different video generation requirements
The Keling Video 3.0 Turbo model can achieve multiple capabilities through content such as Prompt
  1. Multi-shot videos can be generated using a fixed format, which is "Shot n, m, words; Shot n, m, words;", separated by half-width symbols; where:

    1. n: Storyboard number; supports up to 6 storyboards and at least 1 storyboard
    2. m: Duration of each shot; the duration of each shot is not less than 1, and the sum of the durations of all shots equals the total duration of the currently generated video
    3. words: Storyboard prompt; Maximum length 512
  2. For more information, please refer to:KeLing Video 3.0 Model User Guide

settings object Optional Empty Output configuration-related parameters, such as clarity, duration, etc.
settings.resolution string Optional 720p Clarity of the generated video
  • Enumerated values: 720p, 1080p. Among them:

    • 720p: Output video with a resolution of 720P
    • 1080p: Output video with a resolution of 1080P
settings.aspect_ratio string Optional 16:9 The aspect ratio (width:height) of the generated video
  • Enumerated values: 16:9, 9:16, 1:1
settings.duration int Optional 5 Generated video duration, unit: s
  • Enumerated values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
options object Optional Empty General configuration, such as callback address, whether it contains a watermark, etc.
"options": {
  "callback_url": "https://example.com/cb", // Callback notification URL for this task's results. If configured, the server will actively notify when the task status changes. See "Callback Protocol" for the notification message schema.
  "external_task_id": "string", // Custom task ID, can be used for querying. It will not overwrite the system-generated task ID. Uniqueness must be ensured within the account scope.
  "watermark_info": {
    "enabled": false // Whether to generate watermarked results. true = generate, false = do not generate; default is false.
  }
}
options.callback_url string Optional Empty Callback notification address for the results of this task. If configured, the server will actively notify when the task status changes.
  • The message schema of the specific notification can be found in the "Callback Protocol"
options.external_task_id string Optional Empty Custom Task ID
  • User-defined task ID. Passing it 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
options.watermark_info object Optional
Empty Whether to generate watermarked results simultaneously
  • Defined by the enabled parameter, the specific object format is as follows:
"watermark_info": {
         "enabled": boolean // Whether to generate watermarked results. true = generate, false = do not generate; default is false.
}
  • Custom watermark is not currently supported

Request Example

curl -g 'https://genaiapi-m2.cloudsway.net/v1/ai/{endpointPath}/kling/videos/text-to-video/kling-3.0-turbo' \
-H 'Authorization: Bearer {Your AK}' \
-H 'Content-Type: application/json' \
-d '{
  "prompt": "A golden retriever running on a sunny beach, cinematic lighting, slow motion",
  "settings": {
    "resolution": "1080p",
    "aspect_ratio": "16:9",
    "duration": 5
  },
  "options": {
    "watermark_info": {
      "enabled": false
    }
  }
}'

Return Example

{
    "code": 0,
    "message": "SUCCEED",
    "data": {
        "id": "901930004609634393",
        "status": "submitted",
        "message": "",
        "create_time": 1783065388949,
        "update_time": 1783065388949
    },
    "request_id": "ed6ce13d-7c9b-48cc-ba5c-e4ba5c260a60"
}

Image-to-Video

Request URL

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

Request Parameters

Field Type Required Default Value Description
contents array Required None Collection of reference creatives, such as prompts, images, etc.
  • Related fields of the same creative should be placed in the same directory structure
  • The reference format is as follows, and the parameter descriptions are detailed below:
 "contents": [
   {
      "type": "prompt",
      "text": "string"
   },
   {
      "type": "first_frame",
      "url": "https://your-cdn.com/start-frame.jpg"
   }
 ]
contents.type string Required None Creative types supported: prompts, first frame images
  • Enumerated values: prompt,first_frame; where:

    • prompt: identifier for creative prompt material;
    • first_frame: Identifier for the first frame creative;
contents.type=prompt string Optional Empty Text prompts, which can include positive and negative descriptions
  • Defined through the JSON format, specifically as follows:
{
  "type": "prompt", // Material type, fixed parameter value: prompt; required
  "text": "string" // Text prompt, can include positive and negative descriptions, content must not exceed 2500 characters; required
}
  • Prompt templates can be used to meet different video generation requirements
The Keling Video 3.0 Turbo model can achieve multiple capabilities through content such as Prompt
  1. Multi-shot videos can be generated using a fixed format, which is "Shot n, m, words; Shot n, m, words;", separated by half-width symbols; where:

    1. n: Storyboard number; supports up to 6 storyboards and at least 1 storyboard
    2. m: Duration of each shot; the duration of each shot is not less than 1, and the sum of the durations of all shots equals the total duration of the currently generated video
    3. words: Storyboard prompt; Maximum length 512
  2. For more information, please refer to:KeLing Video 3.0 Model User Guide

contents.type=first_frame object Required None Reference creatives for the first frame image
  • Defined through the JSON format, specifically as follows:
{
  "type": "first_frame", // First frame material identifier, fixed parameter value: first_frame; required
  "url": "string", // Material content, supports providing via URL or base64; simply fill in the relevant information; required. For large files, URL is recommended as base64 may cause long API wait times.
}
  • Image formats supported:.jpg /.jpeg /.png
  • The size of the image file cannot exceed 50MB
  • The width and height of the image should be no less than 300px, and the aspect ratio of the image should be between 1:2.5 and 2.5:1
  • Only the first frame is supported; currently, the first frame + last frame and only the last frame are not supported
settings object Optional Empty Output configuration-related parameters, such as clarity, duration, etc.
settings.resolution string Optional 720p Clarity of the generated video
  • Enumerated values: 720p, 1080p. Among them:

    • 720p: Output video with a resolution of 720P
    • 1080p: Output video with a resolution of 1080P
settings.duration int Optional 5 Generated video duration, unit: s
  • Enumerated values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
options object Optional Empty General configuration, such as callback address, whether it contains a watermark, etc.
"options": {
  "callback_url": "https://example.com/cb", // Callback notification URL for this task's results. If configured, the server will actively notify when the task status changes. See "Callback Protocol" for the notification message schema.
  "external_task_id": "string", // Custom task ID, can be used for querying. It will not overwrite the system-generated task ID. Uniqueness must be ensured within the account scope.
  "watermark_info": {
    "enabled": false // Whether to generate watermarked results. true = generate, false = do not generate; default is false.
  }
}
options.callback_url string Optional Empty Callback notification address for the results of this task. If configured, the server will actively notify when the task status changes.
  • The message schema of the specific notification can be found in the "Callback Protocol"
options.external_task_id string Optional Empty Custom Task ID
  • User-defined task ID. Passing it 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
options.watermark_info object Optional Empty Whether to generate watermarked results simultaneously
  • Defined by the enabled parameter, the specific object format is as follows:
"watermark_info": {
         "enabled": boolean // Whether to generate watermarked results. true = generate, false = do not generate; default is false.
}
  • Custom watermark is not currently supported

Request Example

curl -g 'https://genaiapi-m2.cloudsway.net/v1/ai/{{endpointPath}}/kling/videos/image-to-video/kling-3.0-turbo' \
-H 'Authorization: Bearer {Your AK}' \
-H 'Content-Type: application/json' \
-d '{
    "contents": [
      {
        "type": "first_frame",
        "url": "https://p0.ssl.img.360kuai.com/dmfd/__60/t018b8fd959340b4f00.jpg"
      },
      {
        "type": "prompt",
        "text": "A golden retriever running on a sunny beach, cinematic lighting, slow motion"
      }
    ],
    "settings": {
      "resolution": "1080p",
      "duration": 8
    },
    "options": {
      “”
      "watermark_info": {
        "enabled": false
      }
    }
  }'

Return Example

{
    "code": 0,
    "message": "SUCCEED",
    "data": {
        "id": "901930004609634393",
        "status": "submitted",
        "message": "",
        "create_time": 1783065388949,
        "update_time": 1783065388949
    },
    "request_id": "ed6ce13d-7c9b-48cc-ba5c-e4ba5c260a60"
}

Query Task

Request URL

GET v1/ai/{endpointPath}/kling/tasks

Request Parameters

Field Type Required Default Value Description
task_ids string
Optional Empty System-defined task ID to be queried
  • When querying tasks:

    • Request path parameters, directly fill in the values in the request path
    • At least and only one of task_ids and external_task_ids can be selected, and they cannot be used simultaneously
  • Supports batch queries

external_task_ids string Optional Empty Custom task ID to be queried
  • When querying tasks:

    • Request path parameters, directly fill in the values in the request path
    • At least and only one of task_ids and external_task_ids can be selected, and they cannot be used simultaneously
  • Supports batch queries

Request Example

curl -g 'https://genaiapi-m2.cloudsway.net/v1/ai/{{endpointPath}}/kling/tasks?task_ids=899322227844730894&external_task_ids=' \
-H 'Authorization: Bearer {Your AK}' \
-H 'Content-Type: application/json' \

Return Example

{
    "code": 0,
    "message": "SUCCEED",
    "data": [
        {
            "id": "901930004609634393",
            "status": "succeeded",
            "message": "",
            "outputs": [
                {
                    "type": "video",
                    "id": "901930006506119262",
                    "url": "https://v16-kling-fdl.klingai.com/bs2/upload-ylab-stunt-sgp/muse/883866880053346352/VIDEO/20260703/94a3076d1a66898e3a3a72d01b4f2016-701d1905-6ece-42a4-9911-b048e59bbecb.mp4?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAFZz2jGsYSosbSWIP3R2XC-GYayNpXyFD3QJI6oBd0THyzVqA6pNW7qLVAiOYOK5ibt3ZOnlrrL9T6nH8GARsuFQBjFHbjH-ufnoUvlFUJ3jSKC34LLXDrqZ_TqEKI0W_ng2qL1TndbgTQcz6zd7GjkdFa8mByHjwuEIOAvw7JU3aJKNIPs4yl-F5APlBPB97XPOspwX5-jlreTRS7LqSG0CD5DHIvBa0uv6VfX4arL7xoSBJLSFVs3h7NB0bSL9MQcdiMhIiDEUHKJ1Ka4p2DZgIHNu7l8JSrFv_6vaIaPGk3K0J4o3SgFMAE&x-kcdn-pid=112781&ksSecret=8004a4f0fb0d97309d0549abd6d5f54e&ksTime=6a6ef86e",
                    "duration": "5.041"
                }
            ],
            "billing": [
                {
                    "amount": "5",
                    "charge_type": "unit",
                    "package_type": "video"
                }
            ],
            "create_time": 1783065388949,
            "update_time": 1783065455355
        }
    ],
    "request_id": "e508ec0e-feb7-4d18-815d-47b52a57cad7"
}