Skip to main content
POST
استخدم نقطة النهاية هذه لبدء مهمة Grok لتحويل صورة إلى فيديو انطلاقًا من صورة مصدر واحدة وPrompt. وهي تُرجع request_id فورًا، لذا تعامل معها على أنها الخطوة الأولى في سير عمل غير متزامن.

ابدأ بطلب صغير

  • استخدم model: grok-imagine-video-1.5
  • اضبط image.url على رابط URL عام بصيغة JPEG أو PNG أو WebP
  • في أول طلب، أبقِ duration عند 1 وresolution عند 720p
  • اجعل prompt واضحًا بحيث يكون اتجاه التحريك مفهومًا
  • إذا أرسلت base64، فأبقِ صيغة المستندات ومثال OpenAPI كما هي: data:image/png;base64,<BASE64_IMAGE_DATA>

المدة والدقة

تدفق المهمة

1

إنشاء المهمة

أرسل Prompt وصورة المصدر، ثم احفظ request_id المُعاد.
2

استطلاع الاكتمال

استدعِ الحصول على نتائج فيديو xAI إلى أن تصبح حالة المزوّد المتداخلة done.
3

الاحتفاظ بالمخرجات

انسخ video.url النهائي إلى مساحة التخزين الخاصة بك إذا كنت تحتاج إليه بعد نافذة التسليم المؤقتة الخاصة بالمزوّد.

التفويضات

Authorization
string
header
مطلوب

Bearer token authentication. Use your CometAPI key.

الجسم

application/json
prompt
string
مطلوب

Prompt describing how the source image should animate. CometAPI requires this field for this route.

مثال:

"Animate the still image with a slow camera move and natural motion."

aspect_ratio
enum<string>

Output aspect ratio. Combine with resolution to choose the target frame; for example 480p with 1:1 targets 480x480, 720p with 16:9 targets 1280x720, and 720p with 9:16 targets 720x1280. This endpoint does not expose an exact size field.

الخيارات المتاحة:
1:1,
16:9,
9:16,
4:3,
3:4,
3:2,
2:3
duration
integer
افتراضي:8

Output duration in seconds. Use an integer from 1 through 15. If omitted, CometAPI treats the request as an 8-second generation for billing and default handling.

image
object

Source image for image-to-video. Use a public JPEG, PNG, or WebP URL, or a data URI such as data:image/png;base64,<BASE64_IMAGE_DATA>.

model
string
افتراضي:grok-imagine-video-1.5

xAI video model id. The default example uses Grok Imagine 1.5 for image-to-video.

مثال:

"grok-imagine-video-1.5"

output
object
resolution
enum<string>
افتراضي:720p

Output resolution. Use 720p for a small image-to-video test, or 1080p when you need a higher resolution tier.

الخيارات المتاحة:
480p,
720p,
1080p
size
string

Deprecated size field. Prefer aspect_ratio and resolution.

user
string

Optional end-user identifier.

الاستجابة

200 - application/json

Request accepted.

request_id
string
مطلوب

Deferred request id used for polling.