curl --request POST \
--url https://api.aiid.edu.kg/image-to-video/kling-4.0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"settings": {
"resolution": "720p",
"duration": 10
},
"options": {},
"contents": [
{
"type": "prompt",
"text": "A cinematic product shot with natural motion"
},
{
"type": "first_frame",
"url": "https://example.com/first-frame.jpg"
}
]
}
'{
"code": 0,
"message": "SUCCEED",
"request_id": "request_example",
"data": {
"id": "task_example",
"status": "submitted",
"create_time": 1792710000000,
"update_time": 1792710000000,
"external_id": ""
}
}Kling 图生视频
该系列支持OpenAI视频生成格式(详见链接 视频生成Sora兼容格式)。
Kling 4.0 原生任务接口。使用本站 Bearer API Key 鉴权。请求体无需 model;settings.resolution=720p 使用 kling-4.0,1080p 使用 kling-4.0-1080p,默认1080p。创建成功后使用返回的 data.id 调用 GET /tasks?task_ids=任务ID;多个ID用逗号分隔。查询的 data 为数组,结果视频位于 data[].outputs[].url。
当前支持提示词、first_frame、last_frame、refer_image、feature_video 的对应生成场景。不支持 middle_frame、base_video、element、voice、音频参考、回调或自定义外部任务ID;非空options.callback_url、非空options.external_task_id、非空contents.id及其它未支持字段会返回400。options 可省略或传空对象,也可传 watermark_info.enabled=false;开启水印暂不支持。当前时长支持4至30秒,默认10秒;3秒暂不支持。文生与参考场景画幅默认16:9,显式adaptive会返回400。首尾帧场景不接受显式settings.aspect_ratio,画幅按首张frame图尺寸确定。
图生视频的 contents 必须包含非空prompt与first_frame,可同时传last_frame;首尾帧各最多1张。首尾帧不能与refer_image参考图或feature_video参考视频混用,混用会返回400。不接受settings.aspect_ratio。
curl --request POST \
--url https://api.aiid.edu.kg/image-to-video/kling-4.0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"settings": {
"resolution": "720p",
"duration": 10
},
"options": {},
"contents": [
{
"type": "prompt",
"text": "A cinematic product shot with natural motion"
},
{
"type": "first_frame",
"url": "https://example.com/first-frame.jpg"
}
]
}
'{
"code": 0,
"message": "SUCCEED",
"request_id": "request_example",
"data": {
"id": "task_example",
"status": "submitted",
"create_time": 1792710000000,
"update_time": 1792710000000,
"external_id": ""
}
}授权
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
请求体
响应
成功
