Skip to main content
POST
Bir kaynak görsel ve bir prompt ile bir Grok image-to-video işi başlatmak için bu endpoint’i kullanın. Hemen bir request_id döndürür, bu yüzden bunu async bir iş akışının ilk adımı olarak ele alın.

Küçük bir istekle başlayın

  • model: grok-imagine-video-1.5 kullanın
  • image.url değerini herkese açık bir JPEG, PNG veya WebP URL’si olarak ayarlayın
  • İlk istek için duration değerini 1, resolution değerini 720p olarak tutun
  • Animasyon yönünün net olması için prompt değerini açık ve net tutun
  • Base64 gönderiyorsanız, dokümanlarda ve OpenAPI örnek biçiminde şu formu koruyun: data:image/png;base64,<BASE64_IMAGE_DATA>

Süre ve çözünürlük

Görev akışı

1

İşi oluşturun

Prompt ve kaynak görseli gönderin, ardından dönen request_id değerini kaydedin.
2

Tamamlanmayı sorgulayın

İç içe geçmiş sağlayıcı durumu done olana kadar xAI video sonuçlarını alın çağrısı yapın.
3

Çıktıyı kalıcı olarak saklayın

Sağlayıcının geçici teslim penceresinden sonra da ihtiyacınız olacaksa, son video.url değerini kendi depolamanıza kopyalayın.

Yetkilendirmeler

Authorization
string
header
gerekli

Bearer token authentication. Use your CometAPI key.

Gövde

application/json
prompt
string
gerekli

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

Örnek:

"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.

Mevcut seçenekler:
1:1,
16:9,
9:16,
4:3,
3:4,
3:2,
2:3
duration
integer
varsayılan: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
varsayılan:grok-imagine-video-1.5

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

Örnek:

"grok-imagine-video-1.5"

output
object
resolution
enum<string>
varsayılan:720p

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

Mevcut seçenekler:
480p,
720p,
1080p
size
string

Deprecated size field. Prefer aspect_ratio and resolution.

user
string

Optional end-user identifier.

Yanıt

200 - application/json

Request accepted.

request_id
string
gerekli

Deferred request id used for polling.