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
主體
回應
成功
