跳轉到主要內容
POST
/
kling
/
v1
/
audio
/
video-to-audio
Create a Kling video-to-audio task
curl --request POST \
  --url https://api.cometapi.com/kling/v1/audio/video-to-audio \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "video_url": "https://xxxxx.mp4"
}
'
{
  "code": 123,
  "message": "<string>",
  "data": {
    "task_id": "<string>",
    "task_status": "<string>",
    "created_at": 123,
    "updated_at": 123
  }
}
使用此端點可從來源影片產生音訊結果。

呼叫前須知

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

任務流程

1

提交來源影片

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

輪詢任務

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

保存輸出

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

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

主體

application/json
video_id
string
預設值:861034216165875784
必填

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
預設值:audio-video-task-001

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
預設值:https://example.com/webhook

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

video_url
string
預設值:http://runwaycdn.rixapi.com/attachments/video/runway/20241015/82bc23c83b5c32e75059c8328df5cffb.mp4

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