v4

latestOpenAPI 3.1.02026-08-0143190206.8 KB
v1

Generate a video from a text prompt and optionally an image. This is an asynchronous operation that returns a request_id for polling.

post/v1/videos/generations

Request body

aspect_ratio'1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '3:2' | '2:3'

Aspect ratio for video generation.

durationinteger nullable

Video duration in seconds. Range: [1, 15]. Default: 8. Also accepts seconds for OpenAI API compatibility. Accepts both number (8) and string ("8") values.

modelstring nullable

Model to be used.

promptstring

Prompt for video generation. Required for text-to-video (T2V) and reference-to-video (R2V). Optional for image-to-video (I2V) — when omitted, the model generates a video from the image alone.

resolution'480p' | '720p' | '1080p'

Resolution for video generation.

userstring nullable

A unique identifier representing your end-user.

Example request

{
  "model": "grok-imagine-video"
}

Response

Video generation started successfully

request_idstring required

A unique request ID to poll for the result.