Skip to main content
GET
创建 Kling 任务后,使用此端点系列。这是 Kling 异步媒体任务的通用轮询步骤。
查询可以直接返回任务对象,也可以将其置于标准的 data 封装中。读取任务字段之前,先使用 task = payload.data ?? payload 对每个响应进行规范化, 再读取任务字段。

首先检查什么

  • task.task_status;运动控制任务使用 submittedprocessingsucceedfailed
  • task.task_result.videos[0].url 来判断视频任务何时成功
  • task.task_status_msg ;当任务提前停止时,则检查其他返回的详细字段
  • code, message;当响应使用标准 request_id 时, 检查封装。

轮询模式

1

从匹配的端点创建任务

先从适用于您的工作流的 Kling 创建页面开始,例如 文本转视频, 图像转视频,或 运动控制.
2

轮询直到任务进入终态

将响应结构规范化,然后使用返回的任务 ID 持续查询 直至其进入终态。对于运动控制,终态 为 succeedfailed
3

继续执行下一工作流步骤

直接使用完成的输出;如果您的工作流支持链式操作,也可以进入下一个适用的操作页面。

常见路径配对

如需完整参数参考,请参阅 Kling 官方文档.

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

路径参数

action
string
必填

Resource type. One of: images, videos, audio.

action2
string
必填

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
string
必填

Task ID

响应

200 - application/json

Current Kling task state.

A query can return the task object directly or inside the standard response envelope. Normalize both shapes before reading task fields.

task_id
string
必填

Kling task ID.

task_status
string
必填

Current task state. Compatible Motion Control tasks use submitted, processing, succeed, or failed.

task_status_msg
string

Failure or status detail when returned.

task_info
object

Additional task metadata. The object can be empty.

task_result
object

Absent on an initial submitted task, commonly empty while processing or after failure, and populated when a task succeeds.

watermark_info
object

Watermark information when returned by a compatible workflow.

created_at
integer<int64>

Task creation timestamp in milliseconds.

updated_at
integer<int64>

Last task update timestamp in milliseconds.

final_unit_deduction
string

Final unit deduction value, when returned.

final_balance_deduction
object

Final balance deduction values, when returned.

最后修改于 2026年7月31日