الانتقال إلى المحتوى الرئيسي
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": {}
}
استخدم هذا endpoint لتحديد منطقة الفيديو التي تريد أن يعمل عليها المحرر متعدد الوسائط.

كيف يعمل التحديد

  • session_id يأتي من Initialize Video for Editing
  • frame_index يحدد الإطار الذي تضع فيه النقاط
  • points هي إحداثيات مُطبّعة بين 0 و 1
  • توثّق Kling حاليًا ما يصل إلى 10 إطارات محددة وما يصل إلى 10 نقاط لكل إطار

دور ذلك في سير العمل

1

Initialize first

ابدأ بـ Initialize Video for Editing للحصول على session_id صالح.
2

Add or refine points

استدعِ هذا endpoint أثناء إنشاء المنطقة التي تريد تحريرها.
3

Preview the area

استخدم Preview Selected Video Area قبل الإرسال النهائي.
للاطلاع على المرجع الكامل للمعلمات، راجع وثائق Kling API.

التفويضات

Authorization
string
header
مطلوب

Bearer token authentication. Use your CometAPI key.

الجسم

application/json
session_id
string
افتراضي:784914037360041984
مطلوب

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

frame_index
integer
افتراضي:1
مطلوب

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[]
مطلوب

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.

الاستجابة

200 - application/json

Selection updated.

code
integer
مطلوب
message
string
مطلوب
data
object