跳轉到主要內容
GET
建立 Kling 任務後,請使用此端點系列。這是 Kling 非同步媒體作業的常見輪詢步驟。
查詢可直接傳回任務物件,或將其置於標準的 data 封套中。請先使用 task = payload.data ?? payload 正規化每個回應,再 讀取任務欄位。

首先檢查的項目

  • task.task_status;動作控制任務在視訊任務成功時會使用 submitted、processing, succeed或 failed
  • task.task_result.videos[0].url 。
  • task.task_status_msg 或在任務提前停止時傳回的其他詳細欄位
  • code, message,以及當回應使用標準的 request_id 封套時

輪詢模式

1

從相應端點建立任務

請從適用於您工作流程的 Kling 建立頁面開始,例如 文字轉影片, 圖像轉影片,或 動作控制.
2

輪詢直到任務進入終止狀態

將回應結構正規化,然後持續使用傳回的任務 ID 查詢 直到它進入終止狀態。對於動作控制,終止狀態 為 succeed 和 failed。
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.

status
string

Optional compatibility response status. For a direct legacy Kling task response, synthesized values are PENDING, RUNNING, SUCCEEDED, or FAILED; use task_status as the canonical task state.

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日