Create a Grok video task
Submit a Grok Imagine text/image/reference video task; resolution is set by the model name
Available models
Key: resolution is chosen by the model name
Grok video is priced per resolution tier, and the resolution is selected via the model-name suffix: use...-720p for 720p and
...-480p for 480p. Do not pass a resolution parameter (it has
no effect). Each resolution has its own price — see the
models & pricing page.
size only sets the aspect ratio
size (e.g. 1280x720, 720x1280) is used only to determine the
aspect ratio (landscape 16:9 / portrait 9:16, etc.); it does
not set the resolution. Do not use 1792x1024 / 1024x1792
(they are rejected).
Flow
POST /v1/videos— submit the task and getid(thetask_id)GET /v1/videos/{task_id}— poll untilstatus=completed- Read the video URL from
metadata.url, or download the stream viaGET /v1/videos/{task_id}/content
Image-to-video and reference-to-video
- Image-to-video: pass
imageorinput_reference(URL or Base64 data URI); the model animates the image as the first frame.grok-imagine-video-1.5-previewrequires an input image. - Reference-to-video (
grok-imagine-videoonly): pass animagesarray of reference images to guide generation;imageandimagesare mutually exclusive. A compatibility aliasref_images(a root-level array equivalent toimages; use one or the other, not both) also works; new integrations should preferimages.
Duration
Specify withseconds (recommended, a string like "5") or
duration (a number). The allowed range is 1–15 seconds.Authorizations
Body
Grok Imagine video generation request. model and prompt are required.
Resolution is determined by the model-name suffix (-480p / -720p); do
not pass resolution. size only sets the aspect ratio.
Model ID. Resolution is determined by the suffix (-480p /
-720p) and is priced per resolution tier. grok-imagine-video
supports text/image/reference to video;
grok-imagine-video-1.5-preview is image-to-video only (input image required).
grok-imagine-video-480p, grok-imagine-video-720p, grok-imagine-video-1.5-preview-480p, grok-imagine-video-1.5-preview-720p "grok-imagine-video-720p"
Text prompt describing the video content, motion, scene, camera, and style. For image-to-video, describe the desired motion and changes.
"A crystal-powered rocket lifts off from the red dunes of Mars, cinematic, stable shot"
Frame size, e.g. 1280x720. Used only to determine the aspect
ratio (landscape 16:9 / portrait 9:16, etc.); it does not
set the resolution (resolution comes from the model-name suffix).
Do not use 1792x1024 / 1024x1792 (rejected).
"1280x720"
Recommended. Video duration in seconds, preferably a string (e.g.
"5"). Allowed range 1–15 seconds. Do not combine with duration.
"5"
Compatibility field. Video duration in seconds, allowed range 1–15.
New integrations should use the top-level seconds; do not combine
with seconds.
1 <= x <= 155
Single input image, URL or Base64 data URI. Setting it triggers
image-to-video mode. grok-imagine-video-1.5-preview requires an
input image. Mutually exclusive with images.
"https://example.com/image.jpg"
Input image (Sora-style field), URL or Base64 data URI, equivalent
to image. Used for image-to-video; provide either image or this.
"https://example.com/image.jpg"
Multiple reference images, URL or Base64. Used for reference-to-video
mode (grok-imagine-video only). Mutually exclusive with image.
The recommended field for multi-image reference.
Compatibility alias for the reference-images array, equivalent to
images (use one or the other, not both). For clients that follow
this convention; new integrations should prefer images.
End-user identifier for auditing and risk control; not used in generation.
"user-1234"
Response
Grok video task created successfully
Grok video task object, compatible with the OpenAI / Sora video task format.
Video task ID.
"video_abc123"
Object type, always video.
video "video"
The model used to run the task.
grok-imagine-video-480p, grok-imagine-video-720p, grok-imagine-video-1.5-preview-480p, grok-imagine-video-1.5-preview-720p "grok-imagine-video-720p"
Task status.
queued, in_progress, completed, failed "queued"
Task progress percentage (0–100).
0 <= x <= 1000
Task creation timestamp (milliseconds).
1764347090922
Video duration in seconds.
"10"
Task completion timestamp (milliseconds), filled once complete.
1764347170000
Expiration timestamp (milliseconds) of the task and the video file.
1764433570000
Actual output size, e.g. 1280x720. The actual resolution comes
from the model-name suffix; the aspect ratio comes from the request size.
"1280x720"
Grok video task error info.
Extra metadata; usually contains a url field once complete.