获取 Kling 任务
按 task_id 查询 Kling 视频生成任务,并返回其状态、进度和结果元数据以供轮询。
首先检查什么
task.task_status;运动控制任务使用submitted、processing,succeed或failedtask.task_result.videos[0].url来判断视频任务何时成功task.task_status_msg;当任务提前停止时,则检查其他返回的详细字段code,message;当响应使用标准request_id时, 检查封装。
轮询模式
轮询直到任务进入终态
succeed 和 failed。继续执行下一工作流步骤
常见路径配对
授权
Bearer token authentication. Use your CometAPI key.
路径参数
Resource type. One of: images, videos, audio.
Sub-action matching the resource type. For images: generations, kolors-virtual-try-on. For videos: text2video, image2video, motion-control, lip-sync, effects, multi-image2video, multi-elements. For audio: text-to-audio, video-to-audio.
Task ID
响应
Current Kling task state.
- Option 1
- Option 2
A query can return the task object directly or inside the standard response envelope. Normalize both shapes before reading task fields.
Kling task ID.
Current task state. Compatible Motion Control tasks use submitted, processing, succeed, or failed.
Failure or status detail when returned.
Additional task metadata. The object can be empty.
Absent on an initial submitted task, commonly empty while processing or after failure, and populated when a task succeeds.
Watermark information when returned by a compatible workflow.
Task creation timestamp in milliseconds.
Last task update timestamp in milliseconds.
Final unit deduction value, when returned.
Final balance deduction values, when returned.