Grok Imagine Video Generation
Grok Imagine (grok-imagine-video series) is xAI's video generation model, served through the unified OpenAI-style /v1/videos endpoint. The platform transparently translates Sora-style parameters into xAI official fields (e.g. size → resolution), so both styles work out of the box.
Models
grok-imagine-video: standard tier, text/image/video input;grok-imagine-video-1.5: latest tier with native audio output, up to 1080p;grok-imagine-video-1.5-preview: 1.5 preview, priced the same as the GA model.
Endpoints
- Create task:
POST $URL/v1/videos - Query task:
GET $URL/v1/videos/{task_id} - Download video:
GET $URL/v1/videos/{task_id}/content
Supported Models
| Model | Positioning | Resolutions | Input |
|---|---|---|---|
grok-imagine-video | Standard | 480p / 720p | text / image / video |
grok-imagine-video-1.5 | Latest (native audio) | 480p / 720p / 1080p | text / image / audio |
grok-imagine-video-1.5-preview | 1.5 preview (same price) | 480p / 720p / 1080p | text / image / audio |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | One of the models above |
prompt | string | Yes | Video description (optional for image-to-video) |
seconds | string | number | No | Duration in seconds, 1–15, default 8; duration (integer) is equivalent |
resolution | string | No | xAI tiers: 480p / 720p (default) / 1080p |
size | string | No | Sora/OpenAI style: 480p / 1280x720 / 720x1280 etc. — translated to resolution and removed automatically (ignored if resolution is also set) |
image_url | string | No | Image-to-video: reference image URL or base64 data URL; Sora-style image / input_reference are auto-normalized to image_url |
reference_images | array | No | Multi-image reference: [{"url": "..."}] at the top level, up to 7 images; reference each one in the prompt with <IMAGE_1>…<IMAGE_N> tags. Supported on all three models; a single image can also use image_url, and both may coexist |
aspect_ratio | string | No | 16:9 / 9:16 / 1:1 etc. (passed through to xAI) |
Constraints
- Durations outside
1–15seconds are rejected with 400 before any billing occurs; - 4K is not supported:
sizevalues2k/4kare blocked; oversized pixel sizes fall back to1080p.
Request Example
bash
curl $URL/v1/videos \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5",
"prompt": "A lantern floating into the night sky",
"seconds": "4",
"size": "480p"
}'Image-to-Video (image_url)
bash
curl $URL/v1/videos \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5",
"prompt": "Bring the scene to life",
"seconds": "4",
"resolution": "720p",
"image_url": "https://example.com/photo.jpg"
}'Multi-Image Reference (reference_images)
Pass multiple reference images in the top-level reference_images array (up to 7) and reference each one in the prompt with <IMAGE_N> tags:
bash
curl $URL/v1/videos \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5",
"prompt": "The character in <IMAGE_1> slowly turns their head, with the scene from <IMAGE_2> as the background. Slow push-in.",
"seconds": "4",
"resolution": "720p",
"reference_images": [
{ "url": "https://example.com/character.jpg" },
{ "url": "https://example.com/scene.jpg" }
]
}'Notes
reference_imagesworks identically ongrok-imagine-video/grok-imagine-video-1.5/grok-imagine-video-1.5-preview— just change themodelname;- When multiple images are passed via the Sora-style unified entry
images/input_reference, the platform automatically merges images 2+ intoreference_images, and billing follows the actual count; - Each reference image is billed at the "Input image" rate above (frozen at submit time).
Query and Download
bash
# queued / processing / completed / failed
curl $URL/v1/videos/{task_id} \
-H "Authorization: Bearer $YOUR_API_KEY"
curl -o video.mp4 $URL/v1/videos/{task_id}/content \
-H "Authorization: Bearer $YOUR_API_KEY"Pricing
Billed by output seconds × resolution, plus official media input fees for reference images/videos (frozen at submit time):
| Model | 480p | 720p | 1080p | Input image | Input video |
|---|---|---|---|---|---|
grok-imagine-video | $0.05/s | $0.07/s | — | $0.002/image | $0.01/s |
grok-imagine-video-1.5 | $0.08/s | $0.14/s | $0.25/s | $0.01/image | — |
grok-imagine-video-1.5-preview | $0.08/s | $0.14/s | $0.25/s | $0.01/image | — |
Example: grok-imagine-video-1.5, 4 s at 480p = 4 × $0.08 = $0.32; with 3 reference images add 3 × $0.01 = $0.03, for a total of $0.35.
Notes
- Videos expire upstream: downloading an expired artifact returns 410 Gone — download promptly after completion;
- Default duration is 8 seconds (xAI default) — requests without
seconds/durationare billed for 8 s; - Task statuses:
queued→processing(0–99%) →completed/failed; - Group multipliers apply on top of the base prices above.
