Saltar para o conteúdo principal
POST
/
kling
/
v1
/
videos
/
multi-elements
/
add-selection
Add selection points to a Kling multimodal session
curl --request POST \
  --url https://api.cometapi.com/kling/v1/videos/multi-elements/add-selection \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "session_id": "784914037360041984",
  "frame_index": 1,
  "points": [
    {
      "x": 0,
      "y": 1
    }
  ]
}
'
{
  "code": 123,
  "message": "<string>",
  "data": {}
}
Use este endpoint para marcar a região do vídeo na qual você deseja que o editor multimodal atue.

Como a seleção funciona

  • session_id vem de Initialize Video for Editing
  • frame_index seleciona o frame onde você posiciona os pontos
  • points são coordenadas normalizadas entre 0 e 1
  • A documentação atual da Kling indica até 10 frames marcados e até 10 pontos por frame

Papel no fluxo de trabalho

1

Initialize first

Comece com Initialize Video for Editing para obter um session_id válido.
2

Add or refine points

Chame este endpoint enquanto constrói a região a ser editada.
3

Preview the area

Use Preview Selected Video Area antes do envio final.
Para a referência completa de parâmetros, consulte a documentação da API da Kling.

Autorizações

Authorization
string
header
obrigatório

Bearer token authentication. Use your CometAPI key.

Corpo

application/json
session_id
string
padrão:784914037360041984
obrigatório

Session ID, generated based on the video initialization task, does not change with selection editing actions.

frame_index
integer
padrão:1
obrigatório

Frame number

Supports adding up to 10 marked frames, meaning video selections can be marked based on a maximum of 10 frames. Only 1 frame can be marked at a time.

points
object[]
obrigatório

Click coordinates, represented by x and y. Value range: [0,1], expressed as a percentage; [0,1] represents the top-left corner of the frame. Supports adding multiple marked points simultaneously, with a maximum of 10 points per frame.

Resposta

200 - application/json

Selection updated.

code
integer
obrigatório
message
string
obrigatório
data
object