Skip to main content
POST
cURL
استخدم نقطة النهاية هذه لإنشاء مهمة Wan لتحويل النص إلى فيديو. تُرجع واجهة API معرّف مهمة فورًا، لذا خزّن قيمة id المُعادة واستطلع المهمة حتى تصل إلى حالة نهائية. يستخدم POST /v1/videos النوع multipart/form-data؛ مرّر عناصر التحكم العددية والنصية كحقول في النموذج.

اختر model

اضبط المدة والحجم

اضبط size على إحدى قيم WxH أدناه بحسب model المستهدف.

قيم الحجم لـ Wan 2.7

قيم الحجم لـ Wan 2.6

تدفق المهمة

1

إنشاء المهمة

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

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

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

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

عندما تكون المهمة في حالة completed، استدعِ استرجاع محتوى فيديو Wan لتنزيل ملف MP4.

التفويضات

Authorization
string
header
مطلوب

Bearer authentication. Use your CometAPI API key.

الجسم

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

Wan model ID for this endpoint.

الخيارات المتاحة:
wan2.6,
wan2.7
مثال:

"wan2.6"

prompt
string
مطلوب

Text prompt that describes the video to generate.

مثال:

"A small robot walks through a bright greenhouse with smooth camera movement."

seconds
string

Requested clip duration in seconds. For wan2.6, use 5, 10, or 15. For wan2.7, use an integer from 2 through 15. Default is 5.

مثال:

"5"

size
string

Supported WxH size values. For wan2.6: 1280x720, 720x1280, 1088x832, 832x1088, 1920x1080, 1080x1920, 1440x1440, 1632x1248, 1248x1632. For wan2.7: 1280x720, 720x1280, 1920x1080, 1080x1920, 1440x1440. Default is 1920x1080.

مثال:

"1280x720"

الاستجابة

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.

مثال:

"wan2.6"

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.