Kling Video O3 API
快手 Kling Video O3 模型完整 API 參考文件。
模型版本
此 API 支援八種模型版本:
快速對比
支援的長寬比
16:9, 9:16, 1:1
Kling Video O3 文字生成影片(Std & Pro)
API 位址
POST /api/v1/video/task
請求參數
必填
可選
@ (AT) 引用佔位符
@ (AT) 引用功能透過帶編號的 <<<...>>> 佔位符將參考媒體連結至提示詞。圖像編號從 1 開始,並依照 images 陣列的順序。由於此模型接受一個參考影片 URL,<<<video_1>>> 會引用 video_url。
請求示例
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'kling-video-o3-std-text-to-video',
prompt: 'A drone flying over a mountain range at sunrise',
duration: 5,
aspect_ratio: '16:9'
})
});
const { data } = await response.json();
const taskId = data.task_id;
Kling Video O3 圖像轉影片(Std & Pro)
請求參數
必填
可選
請求示例
{
model_name: 'kling-video-o3-pro-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Camera slowly pulls back revealing the landscape',
duration: 5,
image_end_url: 'https://example.com/end-frame.jpg'
}
Kling Video O3 參考引導影片(Std & Pro)
請求參數
必填
可選參數
請求示例
{
model_name: 'kling-video-o3-std-reference-to-video',
video_url: 'https://example.com/source.mp4',
images: ['https://example.com/reference-a.jpg', 'https://example.com/reference-b.jpg'],
prompt: 'Character walking through a forest',
duration: 8,
aspect_ratio: '16:9',
keep_original_sound: true
}
Kling Video O3 影片編輯(Std & Pro)
請求參數
必填
可選參數
請求示例
{
model_name: 'kling-video-o3-pro-video-edit',
video_url: 'https://example.com/source.mp4',
duration: 5,
images: ['https://example.com/ref.jpg'],
prompt: 'Add falling snow throughout the scene',
keep_original_sound: true
}
@ (AT) 參考影片生成請求示例
{
model_name: 'kling-video-o3-std-reference-to-video',
video_url: 'https://example.com/motion-reference.mp4',
images: [
'https://example.com/athlete-reference.jpg',
'https://example.com/uniform-reference.jpg'
],
prompt: 'Make the athlete from <<<image_1>>> follow the motion in <<<video_1>>> while preserving the uniform details from <<<image_2>>>',
duration: 8,
aspect_ratio: '16:9',
keep_original_sound: true
}
回應格式
初始回應
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
輪詢回應
透過 GET /api/v1/video/{taskId} 輪詢查詢狀態:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
狀態值
submitted:任務已提交,等待處理
processing:影片生成中
succeed:影片生成完成
failed:影片生成失敗
處理時長
- Standard:2-5 分鐘
- Pro:3-8 分鐘
最佳實踐
- 版本選擇:迭代階段使用 Std,最終輸出使用 Pro
- 運動說明:包含具體的鏡頭與主體運動細節
- 參考輸入:使用清晰、高品質的參考圖或參考影片以保持角色一致性
- 影片編輯提示詞:明確指出修改內容,同時保留原始畫面