Chuyển đến nội dung chính
POST
/
kling
/
v1
/
videos
/
multi-elements
/
init-selection
curl --request POST \ --url https://api.cometapi.com/kling/v1/videos/multi-elements/init-selection \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "video_id": "784912347344945152", "task_id": "784912347277836288" } '
{
  "code": 123,
  "message": "<string>",
  "data": {
    "session_id": "<string>"
  }
}
Sử dụng endpoint này để mở một phiên chỉnh sửa video và lấy session_id cần thiết cho tất cả các bước chỉnh sửa multimodal tiếp theo.

Chọn một đường dẫn đầu vào

  • Video do Kling tạo: gửi video_id cùng với task_id cha
  • Video bên ngoài hoặc đã được lưu trữ sẵn: gửi video_url
  • Không gửi đồng thời cả hai đường dẫn đầu vào

Vai trò trong quy trình

1

Khởi tạo phiên

Gửi clip nguồn và lưu session_id được trả về.
2

Đánh dấu các điểm chọn

Tiếp tục với Thêm vùng chọn video để xác định vùng bạn muốn chỉnh sửa.
3

Gửi tác vụ chỉnh sửa cuối cùng

Sau khi vùng chọn đã sẵn sàng, tiếp tục với Tạo tác vụ.
Để xem tài liệu tham chiếu tham số đầy đủ, hãy xem tài liệu Kling API.

Ủ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:784912347344945152
bắt buộc

The video ID generated by Kling; choose either this or video_url, they cannot be passed simultaneously. Select the video to be edited from historical works using the video ID. Only supports video works generated within the last 30 days; only supports videos with a duration of ≥2 seconds and ≤5.5 seconds, or ≥7 seconds and ≤10.5 seconds. Related to the video_url parameter, they cannot both be empty or both have values.

task_id
string
mặc định:784912347277836288
bắt buộc

When passing video_id, the task_id from when the video was generated must also be passed.

video_url
string
mặc định:https://v15-kling.klingai.com/bs2/upload-ylab-stunt-sgp/se/stream_lake_m2v_img2video_multi_id_v16_std/aa12ae6e-450d-4f36-b2d0-74376b313268_raw_video.mp4?x-kcdn-pid=112372

The URL to get the video. When uploading, pass the video download link. When editing a selection, pass the video URL returned by the interface.

Only supports MP4 and MOV formats. Only supports videos with a duration of ≥2 seconds and ≤5.5 seconds, or ≥7 seconds and ≤10.5 seconds. The width and height dimensions of the video must be between 720px (inclusive) and 2160px (inclusive). Only supports uploading videos at 24, 30, or 60 fps. Related to the video_id parameter, they cannot both be empty or both have values.

Phản hồi

200 - application/json

Session initialized.

code
integer
bắt buộc
message
string
bắt buộc
data
object
bắt buộc