Skip to main content
POST
cURL
使用此端点可从源视频生成音频结果。

调用前准备

  • 发送 video_idvideo_url 其中之一,但不要同时发送两者
  • 当源片段最初并非来自 Kling 时,请使用 video_url
  • 除非你的集成需要,否则将 callback_urlexternal_task_id 保持为可选

任务流程

1

提交源视频

发送 Kling video_id 或可访问的 video_url,然后保存返回的任务 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
必填