الانتقال إلى المحتوى الرئيسي
POST
أنشئ فيديو HappyHorse من نص أو صور مرجعية أو إطار افتتاحي. تعيد API معرّف المهمة فورًا. احفظ قيمة id المُعادة لاستطلاع المهمة وتنزيل الفيديو المكتمل. POST /v1/videos يستخدم multipart/form-data. أرسل عناصر التحكم كحقول نموذج والصور المرجعية كحقول input_reference، مع عنوان URL واحد عبر HTTPS أو ملف صورة مرفوع لكل حقل.

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

توجّه الصور المرجعية الموضوعات والتفاصيل البصرية في الفيديو. أرسل من 1 إلى 9 عناوين URL لصور متاحة علنًا عبر HTTPS أو من 1 إلى 9 ملفات صور، مع تكرار input_reference مرة لكل صورة وفق ترتيب الصور. استخدم عناوين URL فقط أو ملفات فقط ضمن هذا الحقل. أرسل كل عنوان URL على حدة بدلًا من ضم عناوين URL بفواصل. بالنسبة إلى input_reference، يجب ألا يتجاوز حجم كل صورة مرجعية 10 MB مع happyhorse-1.0. مع happyhorse-1.1، يجب ألا يتجاوز حجم كل صورة مرجعية 20 MB. تنطبق حدود النموذج هذه على كلٍّ من عناوين URL للصور والملفات المرفوعة. استخدم صور JPEG أو JPG أو PNG أو WEBP بحيث لا يقل أقصر ضلع فيها عن 400 px. حد الرفع لـinput_reference هو 20 MiB ‏(20 × 1024 × 1024 بايت) لكل ملف. يجب أن تستوفي الصور المرفوعة أيضًا الحد الخاص بالنموذج المذكور أعلاه. تعرض عينات الطلبات أعلى هذه الصفحة عدة عناوين URL للصور لـ HappyHorse 1.1 وعمليات رفع ملفات متعددة لكلا النموذجين. لتعيين الإطار الافتتاحي، أرسل first_frame مرة واحدة مع عنوان URL واحد لصورة متاحة علنًا عبر HTTPS أو ملف صورة واحد. استخدم هذا الحقل في طلب منفصل عن input_reference.

تعيين المدة والحجم

اختر قيمة WxH مطابقة تمامًا لـsize من الجدول أدناه. بالنسبة إلى طلبات الإطار الأول، تحدد الصورة التأطير ونسبة العرض إلى الارتفاع، بينما يحدد size مستوى دقة الإخراج.

تدفق المهمة

1

إنشاء المهمة

أرسل طلب نموذج متعدد الأجزاء واحفظ قيمة id المُعادة.
2

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

استدعِ استرداد فيديو HappyHorse إلى أن تصبح قيمة status هي completed أو failed أو error.
3

تنزيل النتيجة

عندما تصبح المهمة completed، استدعِ استرداد محتوى فيديو HappyHorse لتنزيل ملف MP4.

التفويضات

Authorization
string
header
مطلوب

Bearer authentication. Use your CometAPI API key.

الجسم

multipart/form-data
model
enum<string>
مطلوب

HappyHorse model ID for this endpoint.

الخيارات المتاحة:
happyhorse-1.0,
happyhorse-1.1
مثال:

"happyhorse-1.1"

prompt
string
مطلوب

Text prompt that describes the video to generate. For image inputs, describe the motion and visual details to preserve.

مثال:

"Use the uploaded reference image as the visual guide. Create a short cinematic shot with gentle natural motion."

seconds
integer
افتراضي:5

Requested clip duration in whole seconds. Send an integer from 3 through 15 as a form field. The default is 5.

النطاق المطلوب: 3 <= x <= 15
مثال:

3

size
string

Output size as an exact WxH value. Use one of the documented size values for the selected HappyHorse model. For first-frame requests, size selects the resolution tier; the image determines the framing and aspect ratio.

مثال:

"1920x1080"

input_reference

Reference images for reference-to-video. Send 1–9 publicly accessible HTTPS image URLs or 1–9 uploaded image files by repeating input_reference once per image. Use only URLs or only files within this field; do not join URLs with commas. Reference images guide subjects and visual details. CometAPI preserves image order. Use JPEG, JPG, PNG, or WEBP images with a shortest side of at least 400 px. Each reference image must be at or below 10 MB for happyhorse-1.0 or 20 MB for happyhorse-1.1. These model limits apply to both image URLs and uploaded files. The input_reference file upload limit is 20 MiB (20 x 1024 x 1024 bytes) per file. Keep uploads within the model limit as well. Keep this field separate from first_frame.

Pattern: ^https://
first_frame

Opening-frame image as one publicly accessible HTTPS URL or one image file. Send this field once, using either a URL or a file. Use JPEG, JPG, PNG, or WEBP images up to 20 MB. Do not combine first_frame with input_reference.

Pattern: ^https://

الاستجابة

Task created. Store the returned id and poll GET /v1/videos/{task_id}.

id
string
مطلوب

Task ID. Use this value with retrieve and content endpoints.

مثال:

"task_example"

object
string
مطلوب

Object type. Video tasks return video.

مثال:

"video"

model
string
مطلوب

Model ID used for the task.

مثال:

"happyhorse-1.1"

status
enum<string>
مطلوب

Task lifecycle status. Poll until the value is completed, failed, or error.

الخيارات المتاحة:
queued,
in_progress,
completed,
failed,
error
مثال:

"queued"

progress
integer
مطلوب

Task progress as a coarse percentage.

النطاق المطلوب: 0 <= x <= 100
مثال:

0

created_at
integer
مطلوب

Task creation time as a Unix timestamp in seconds.

مثال:

1779938152

task_id
string

Compatibility alias for id when present.

مثال:

"task_example"

completed_at
integer

Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.

مثال:

1779938219

video_url
string

Temporary video delivery URL. This field appears on completed tasks.

مثال:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.

آخر تعديل في ٩ سبتمبر ٢٠٢٦