Chuyển đến nội dung chính
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
  }
}
Sử dụng endpoint này để tạo kết quả âm thanh từ một video nguồn.

Trước khi gọi

  • Gửi video_id hoặc video_url, nhưng không gửi cả hai
  • Dùng video_url khi đoạn video nguồn ban đầu không được tạo từ Kling
  • Giữ callback_urlexternal_task_id là tùy chọn trừ khi tích hợp của bạn cần chúng

Luồng tác vụ

1

Gửi video nguồn

Gửi video_id của Kling hoặc một video_url có thể truy cập được, sau đó lưu task id được trả về.
2

Thăm dò task

Tiếp tục với Truy vấn riêng lẻ bằng cách sử dụng đường dẫn truy vấn audio của Kling cho đến khi task đạt trạng thái kết thúc.
3

Lưu trữ đầu ra

Lưu tài sản audio cuối cùng nếu bạn cần duy trì ổn định hoặc xử lý ở bước tiếp theo.
Để xem tài liệu tham chiếu tham số đầy đủ, hãy xem tài liệu Kling chính thức.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer token authentication. Use your CometAPI key.

Nội dung

application/json
video_id
string
mặc định:861034216165875784
bắt buộc

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
mặc định: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
mặc định:https://example.com/webhook

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

video_url
string
mặc định: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.

Phản hồi

200 - application/json

Task accepted.

code
integer
bắt buộc

Error code; specific error code definition

message
string
bắt buộc

Error message

data
object
bắt buộc