Overview
Grok Imagine Video is the official channel for xAI’s video models: requests are relayed by APIYI to the official xAI API, pricing matches xAI’s list price, and billing follows generated seconds and resolution. The API is an OpenAI Videos-compatible asynchronous task endpoint (/v1/videos) supporting text-to-video and image-to-video, and every video comes with an audio track.
Three models are available:
grok-imagine-video: the base model, 480p / 720pgrok-imagine-video-1.5: the newer model, 480p / 720p / 1080pgrok-imagine-video-1.5-lite: lightweight 1.5, the lowest price at 480p / 720p
Video Generation API
Grok Imagine Official Images
GrokOfficial group — image generation priced the same as xAI, by tier.Let an AI Agent Integrate It
Copy this prompt and paste it into Codex / Claude Code / Cursor
It fetches the plain-text version of this page first (append .md to any docs URL), then writes code for your stack — the async three-step flow, the 480p / 8-second default, billed moderation blocks, and saving the video right away are already baked into the requirements.
Integrate / troubleshoot Grok Imagine video generation (text-to-video + image-to-video) in this project.
Read the docs before writing code: fetch https://docs.apiyi.com/en/api-capabilities/grok-imagine-video/overview.md for the plain-text version of this page; …
- Pick one model:
grok-imagine-video,grok-imagine-video-1.5, orgrok-imagine-video-1.5-lite…
8 requirements in total — use the button below to copy the full version
Models & Pricing
Pricing matches xAI’s list price and is charged per second of generated video; the rate depends on model and resolution:- Cost = seconds × per-second rate + input images × per-image fee. Example: a 1-second 480p image-to-video job on
grok-imagine-video= 1 × $0.05 + 1 × $0.002 = $0.052 (matches the bill in our tests). - Defaults are billed too: without
size/secondsthe job runs at 480p for 8 seconds — $0.40 ongrok-imagine-video. - Audio is not billed separately: videos include an audio track by default, and turning it off does not lower the price.
- Moderation blocks are billed: xAI charges for videos its moderation blocks, and we bill on the same basis — see the FAQ.
- Tiered top-up bonuses apply on top; high-volume business customers can contact sales about dedicated pricing.
Group Setup
Who can get access
How to apply
Contact WeCom support
GrokOfficial (Grok Imagine Official).Describe your use case and moderation controls
Switch your Token group once approved
GrokOfficial on your account. Go to the Token page in the console, switch the Token you use for this channel to GrokOfficial, and set the billing mode to Pay-as-you-go Priority or Pay-as-you-go.GrokOfficial group returns 503 (no available channel in the current group). Retrying will not help — the group has to be enabled first.Do not use the Pay-per-request billing mode: this channel is billed per second, so a pay-per-request Token cannot be routed and also returns 503.Technical Specs
Endpoints
End-to-end flow (Python)
Key Parameters
size (resolution and aspect ratio)
size uses WIDTHxHEIGHT pixels; the gateway picks the resolution tier from the shorter side and snaps the aspect ratio to the nearest supported one:
"480p" / "720p" / "1080p" directly, or skip size and send xAI’s native fields resolution (480p / 720p / 1080p) plus aspect_ratio (such as 9:16); when both are present, resolution / aspect_ratio win. With neither, the video is generated at 480p.
seconds (duration)
An integer from 1 to 15, as a string ("5") or a number (5); default 8. Out-of-range values return 400: duration must be an integer between 1 and 15. Cost scales with seconds, so use 1–2 seconds while testing.
input_reference (image-to-video)
Pass one input image to turn the job into image-to-video. Any of three forms works:
- Public image URL:
"input_reference": "https://example.com/first-frame.jpg" - base64 data URI:
"input_reference": "data:image/jpeg;base64,/9j/4AAQ..." - Multipart file upload:
-F "[email protected]"
prompt to describe motion and camera (such as “the cat slowly turns its head”); the output frame follows the input image. Each input image costs an extra $0.002 (grok-imagine-video) or $0.01 (1.5 / 1.5-lite).
Best Practices
Test prompts at 1–2 seconds and 480p
grok-imagine-video-1.5-lite has the lowest 480p / 720p rate and suits batch exploration.Always pass size and seconds
Poll every 5–10 seconds with an overall timeout
Handle moderation blocks
error.code in the status response: moderation_blocked means the job was blocked, has no video, and was billed. Rephrase before resubmitting rather than retrying as is.Store the video right away
/content as soon as the job is completed; do not keep the download link long-term or hand it to end users.Error Codes & Retries
FAQ
Every call returns 503 — is the channel down?
Every call returns 503 — is the channel down?
GrokOfficial, or the Token’s billing mode is pay-per-request. For the former, apply via Group Setup; for the latter, switch the billing mode to Pay-as-you-go Priority or Pay-as-you-go.Why is my video 480p and 8 seconds?
Why is my video 480p and 8 seconds?
size and seconds, the job is generated and billed at 480p for 8 seconds. Pass size (such as "1280x720") and seconds explicitly.The task says completed, but there is no video to download?
The task says completed, but there is no video to download?
error.code: "moderation_blocked". If it is there, xAI’s content moderation blocked the video: the task still reports completed, but there is no video, and it is billed (xAI charges for blocked videos too). Adjust the prompt or input image and resubmit.Is it cheaper without audio?
Is it cheaper without audio?
Why doesn't the image-to-video output match the size I sent?
Why doesn't the image-to-video output match the size I sent?
Are video editing, extension, or multiple reference images supported?
Are video editing, extension, or multiple reference images supported?
Which of the three models should I pick?
Which of the three models should I pick?
- Need 1080p →
grok-imagine-video-1.5(best quality) orgrok-imagine-video-1.5-lite(cheaper) - Batch 480p / 720p on a budget →
grok-imagine-video-1.5-lite($0.02 / $0.03 per second) - Already on the base model and only need 480p / 720p →
grok-imagine-video
Related Docs
- Grok Imagine Video Generation API - submit endpoint reference with Playground
- Grok Imagine Official Images - same group, priced the same as xAI by tier
- Grok Model Guide - xAI text models
- Top-up Bonuses