跳转到主要内容
POST
/
kling
/
v1
/
videos
/
multi-elements
Create a Kling multimodal edit task
curl --request POST \
  --url https://api.cometapi.com/kling/v1/videos/multi-elements \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "session_id": "784914037360041984",
  "edit_mode": "replace",
  "prompt": "Replace the selected object with a red paper boat."
}
'
{
  "code": 123,
  "message": "<string>",
  "data": {
    "task_id": "<string>",
    "task_status": "<string>",
    "created_at": 123,
    "updated_at": 123
  }
}
使用此端点可在你的会话和选择内容准备就绪后,提交最终的多模态视频编辑任务。

完整工作流

1

初始化编辑会话

先使用 初始化编辑视频 获取你想编辑的片段对应的 session_id
2

构建选区

使用 添加视频选区,并在需要时使用 预览所选视频区域 来优化编辑区域。
3

提交最终任务

通过此端点发送 session_idedit_mode 和最终的 prompt,然后保存返回的任务 id 以便检查状态。

调用前说明

  • 确保选区会话已经初始化
  • 在消耗一次生成调用前,确认你的区域选择是正确的
  • 将此路由视为最终生成步骤,而不是配置步骤
完整参数说明请参阅 Kling API 文档

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求体

application/json
session_id
string
默认值:784914037360041984
必填

Session id returned by the video initialization endpoint.

edit_mode
string
默认值:replace
必填

Editing operation to apply. Options: replace, remove.

prompt
string
默认值:Replace the selected object with a red paper boat.
必填

Text prompt describing the desired edit for the selected region.

响应

200 - application/json

Task accepted.

code
integer
必填
message
string
必填
data
object
必填