MaaS_KL_3.0_turbo
文生视频
请求URL
POST
https://genaiapi-m2.cloudsway.net/v1/ai/{endpointPath}/kling/videos/text-to-video/kling-3.0-turbo
请求参数
| 字段 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| prompt | string | 必填 | 无 | 文本提示词,可包含正向描述和负向描述
|
| settings | object | 选填 | 空 | 输出配置相关参数,如清晰度、时长等 |
| settings.resolution | string | 选填 | 720p | 生成视频的清晰度
|
| settings.aspect_ratio | string | 可选 | 16:9 | 生成视频的画面纵横比(宽:高)
|
| settings.duration | int | 选填 | 5 | 生成视频时长,单位s
|
| options | object | 选填 | 空 | 通用配置,如回调地址、是否含水印等 |
| options.callback_url | string | 选填 | 空 | 本次任务结果回调通知地址,如果配置,服务端会在任务状态发生变更时主动通知
|
| options.external_task_id | string | 选填 | 空 | 自定义任务ID
|
| options.watermark_info | object | 选填 |
空 | 是否同时生成含水印的结果
|
请求示例
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
}
}
}'
返回示例
{
"code": 0,
"message": "SUCCEED",
"data": {
"id": "901930004609634393",
"status": "submitted",
"message": "",
"create_time": 1783065388949,
"update_time": 1783065388949
},
"request_id": "ed6ce13d-7c9b-48cc-ba5c-e4ba5c260a60"
}
图生视频
请求URL
POST https://genaiapi-m2.cloudsway.net/v1/ai/{{endpointPath}}/kling/videos/image-to-video/kling-3.0-turbo
请求参数
| 字段 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| contents | array | 必填 | 无 | 参考素材合集,如提示词、图片等
|
| contents.type | string | 必填 | 无 | 素材类型,支持:提示词、首帧图
|
| contents.type=prompt | string | 选填 | 空 | 文本提示词,可包含正向描述和负向描述
|
| contents.type=first_frame | object | 必填 | 无 | 首帧图参考素材
|
| settings | object | 选填 | 空 | 输出配置相关参数,如清晰度、时长等 |
| settings.resolution | string | 选填 | 720p | 生成视频的清晰度
|
| settings.duration | int | 选填 | 5 | 生成视频时长,单位s
|
| options | object | 选填 | 空 | 通用配置,如回调地址、是否含水印等 |
| options.callback_url | string | 选填 | 空 | 本次任务结果回调通知地址,如果配置,服务端会在任务状态发生变更时主动通知
|
| options.external_task_id | string | 选填 | 空 | 自定义任务ID
|
| options.watermark_info | object | 选填 | 空 | 是否同时生成含水印的结果
|
请求示例
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
}
}
}'
返回示例
{
"code": 0,
"message": "SUCCEED",
"data": {
"id": "901930004609634393",
"status": "submitted",
"message": "",
"create_time": 1783065388949,
"update_time": 1783065388949
},
"request_id": "ed6ce13d-7c9b-48cc-ba5c-e4ba5c260a60"
}
查询任务
请求URL
GET v1/ai/{endpointPath}/kling/tasks
请求参数
| 字段 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| task_ids | string |
选填 | 空 | 需要查询的系统定义的任务ID
|
| external_task_ids | string | 选填 | 空 | 需要查询的自定义的任务ID
|
请求示例
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' \
返回示例
{
"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"
}