الانتقال إلى المحتوى الرئيسي
POST
/
kling
/
v1
/
videos
/
omni-video
curl --request POST \
  --url https://api.cometapi.com/kling/v1/videos/omni-video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "The boy in <<<image_1>>> is wearing <<<element_1>>> and, together with the girl in <<<image_2>>>, sits side by side in <<<element_2>>>, playfully and intimately chatting, close-up shot."
}
'
{}
استخدم نقطة النهاية التجريبية هذه لسير عمل Kling Omni، بما في ذلك التحويل من نص إلى فيديو، والتوليد بالاستناد إلى الصور، وتدفّقات تحويل الفيديو.

اختر وضع الإدخال

  • من نص إلى فيديو: أرسل prompt وmode وaspect_ratio وduration
  • توليد بالاستناد إلى الصور: أضف image_list
  • توليد موجّه بالعناصر: أضف element_list
  • تحويل الفيديو: أضف video_list مع refer_type: base

المدة ونسبة الأبعاد

الإعدادالقيم المدعومةالافتراضيسلوك الحدود
duration للنص أو لفيديو الإطار الأول5, 105استخدم أحد طولي التوليد الثابتين.
duration مع إدخال فيديو مرجعيطول فيديو الإدخال من 3 إلى 10 ثوانٍطول الإدخالتتبع مدة التوليد الفيديو الأساسي وتتجاهل قيمة الطلب.
aspect_ratio16:9, 9:16, 1:116:9مطلوب عندما لا تتحكم صورة الإطار الأول أو الفيديو الأساسي في الإطار.
modestd, propropro هو الافتراضي لـ Omni Video.
لا يوفّر Kling Omni حقل size دقيقًا. تعامل مع aspect_ratio على أنه طلب لشكل الإطار؛ إذ يمكن لطلب تحويل النص إلى فيديو بنسبة 16:9 أن يُعرَض بدقة full-HD 1920x1080.

تدفق المهمة

1

إنشاء مهمة Omni

أرسل الطلب واحفظ قيمة task_id المُعادة.
2

استطلاع مهمة Omni

تابع باستخدام Omni Query حتى تكتمل المهمة.
3

الاحتفاظ بالفيديو المكتمل

انقل رابط MP4 المُعاد إلى وحدة التخزين الخاصة بك إذا كنت بحاجة إلى وصول دائم.

التفويضات

Authorization
string
header
مطلوب

Bearer token authentication. Use your CometAPI key.

الترويسات

Content-Type
string

Content type of the request body.

الجسم

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

Text prompt describing the desired video. Max 2500 characters. Reference images or elements inline using <<<image_1>>>, <<<element_1>>>, <<<video_1>>> syntax.

model_name
string

Model to use for Omni Video. Use kling-video-o1 for this endpoint.

image_list
object[]

Reference images for the generation. Each entry can optionally include a type field set to first_frame or end_frame to pin the image as the video's start or end frame. Accepts URLs or Base64 strings. Formats: JPG, JPEG, PNG. Max 10 MB per image, minimum 300 px per side, aspect ratio 1:2.5-2.5:1. When used with reference videos, image + element count must not exceed 4; without reference videos, the limit is 7.

element_list
object[]

Pre-registered element references by ID. Combined with images, the total count must not exceed 4 (with reference video) or 7 (without).

mode
string

Generation mode. std (standard, faster and more cost-effective) or pro (professional, higher quality output). The default is pro.

aspect_ratio
string

Aspect ratio request for beta Kling Omni generation. The endpoint does not expose an exact size field; a 16:9 text-to-video request can render as 1920x1080.

duration
string

Video length in seconds. Values: 3-10. Text-to-video and first-frame-to-video only support 5 and 10. When editing an existing video, duration matches the input and this parameter is ignored.

video_list
string[]

Reference video for style transfer or the base video to edit. Use refer_type to distinguish: feature for style reference, base for the video to modify. Set keep_original_sound to yes or no to control audio retention. Only MP4/MOV, 3-10 seconds, 720-2160 px, 24-60 fps, max 200 MB. Only one video is accepted.

callback_url
string

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

external_task_id
string

Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.

الاستجابة

200 - application/json

Success

The response is of type object.