Skip to main content
POST
cURL
使用此端點可從來源視訊產生音訊結果。

呼叫前須知

  • 傳送 video_idvideo_url 其中之一,但不要同時傳送兩者
  • 當來源片段原本不是來自 Kling 時,請使用 video_url
  • 除非你的整合需求需要,否則請將 callback_urlexternal_task_id 保持為選填

任務流程

1

提交來源視訊

傳送 Kling 的 video_id 或可存取的 video_url,然後儲存回傳的 task id。
2

輪詢任務

透過 Kling 音訊查詢路徑持續使用 取得 Kling 任務,直到任務進入終止狀態。
3

保存輸出

如果你需要穩定保存或下游處理,請儲存最終的音訊資產。
如需完整的參數參考,請參閱 Kling 官方文件

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

主體

application/json
video_id
string
必填

ID of a Kling-generated video. Only videos created within the last 30 days with a duration of 3–20 seconds are supported. Mutually exclusive with video_url — exactly one must be provided.

external_task_id
string

Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.

callback_url
string

Webhook URL for task status notifications. The server sends a callback when the task status changes.

video_url
string

Accessible URL of the source video. Accepted formats: MP4, MOV. Max 100 MB, 720p or 1080p resolution, duration 3–20 seconds. Mutually exclusive with video_id — exactly one must be provided.

回應

200 - application/json

Task accepted.

code
integer
必填

Error code; specific error code definition

message
string
必填

Error message

data
object
必填