Yes — Grok Imagine generates video through a real, documented API. xAI exposes two video model IDs today, grok-imagine-video and grok-imagine-video-1.5, behind a submit-and-poll REST endpoint, an official Python SDK, and aggregator routes. If you search for “grok imagine video api” because you need to know whether it is callable, what it costs per second, and what working code looks like, this guide answers all three with numbers pulled from xAI and Modellix on August 28, 2026.
Here is the honest framing before the code: Modellix is an API aggregator and has a commercial interest in this article. We expose Grok Imagine video routes through our unified API, but the pricing tables below show that xAI’s direct route is the cheaper per-call option on this specific model — and we are not going to pretend otherwise. The comparison exists so you can budget correctly, not so we can win a row.
What the Grok Imagine video API can do (and the models behind it)
The Grok Imagine API launched in January 2026 as xAI’s unified image-and-video generation bundle, and the video side has grown into two distinct model IDs:
grok-imagine-video— the original text-to-video model. It accepts text, image, or video input and generates clips up to 15 seconds at 480p or 720p, with native audio.grok-imagine-video-1.5— the current flagship. It adds native 1080p text-to-video and image-to-video, plus reference-to-video with preset voice options viareference_audios. It also renders sharper motion and is the model you want for anything that will be watched on a large screen.
Both models support the same request modes — text-to-video, image-to-video, reference-to-video, video editing, and video extension — selected by which fields you send. The video generation documentation defines duration from 1 to 15 seconds, aspect ratios from 1:1 to 9:16 (default 16:9), and resolutions 480p / 720p / 1080p, with two boundaries worth remembering: 1080p is only available on grok-imagine-video-1.5, and reference-to-video is capped at 720p. Video editing keeps the input clip’s duration (capped at 8.7 seconds) and aspect ratio rather than accepting new ones.
Generated clips include an audio track by default; you can pass generate_audio=False for a silent video. xAI’s announcement cited a #1 ranking on the Artificial Analysis text-to-video leaderboard as of January 2026 — useful context, but benchmark positions change, so treat them as directional. The same family also covers still images through grok-imagine-image and grok-imagine-image-2.0; for the full model list and capability matrix, see our Grok Imagine API model guide.
Grok Imagine video API pricing: live rates and a worked example
xAI bills video by the second of generated output, plus separate input components (images or input video). The table below was read from the official xAI pricing page on August 28, 2026:
| Model | Input cost | 480p | 720p | 1080p |
|—|—|—|—:|—:|—:|
| grok-imagine-video | $0.01/sec input video + $0.002/image | $0.05/sec | $0.07/sec | — |
| grok-imagine-video-1.5 | $0.01/image | $0.08/sec | $0.14/sec | $0.25/sec |
A pure text-to-video request has no image or video input, so the output rate is the whole bill. A worked example, using a 5-second clip:
- 5s at 720p on
grok-imagine-video: 5 × $0.07 = $0.35 - 5s at 1080p on
grok-imagine-video-1.5: 5 × $0.25 = $1.25 - Same 1080p clip, but image-to-video with one starting image: $1.26 ($0.01 input + $1.25 output)
At scale, resolution dominates the budget: 1080p costs roughly 3.5× the 480p rate on the same 1.5 model. That is the single most useful planning number in this article. For a deeper breakdown of the whole Grok Imagine pricing family, including the image models, see our Grok Imagine pricing guide.
Step 1: Create an xAI API key
Video generation requires an API key, not a consumer account. Sign in to the xAI console, pick (or create) a team, open API Keys, and click Create API Key. Copy the key and export it in your shell:
1 | export XAI_API_KEY="your-key-here" |
You can also store it in a .env file for the Python examples later.
Step 2: Generate a video with the REST API (curl + polling)
Video generation is asynchronous. You submit a request and get a request_id, then poll until the video is ready. There is no synchronous “return the file” call.
Submit the generation request:
1 | curl -X POST https://api.x.ai/v1/videos/generations \ |
The response is a request ID, not a video:
1 | {"request_id": "d97415a1-5796-b7ec-379f-4e6819e08fdf"} |
Poll for the result every few seconds:
1 | curl -X GET "https://api.x.ai/v1/videos/d97415a1-5796-b7ec-379f-4e6819e08fdf" \ |
While the job runs you get "status": "pending". When it finishes:
1 | { |
Possible status values are pending, done, expired, and failed. The returned video.url is a temporary, xAI-hosted URL — download it promptly if you need a permanent copy.
The submit–poll–retrieve lifecycle is the same shape on the xAI REST API and on most aggregator APIs. Diagram generated August 28, 2026.
Grok Imagine Video REST Reference
See the full xAI-style submit and poll contract, plus every request mode and parameter.
View DocsStep 3: Generate video from Python with the xAI SDK
The official SDK hides the polling entirely. Install it, load your key, and call client.video.generate():
1 | pip install xai-sdk python-dotenv |
1 | import os |
generate() submits the request, polls internally (default timeout 10 minutes, interval 100 ms), and returns the completed response. For image-to-video, pass the starting image through the image field alongside the prompt. Two things to know for production:
- Concurrency: use
xai_sdk.AsyncClientwithasyncio.gather(...)to run several generations in parallel — the docs include a ready-to-run example. - Errors: failures raise
VideoGenerationErrorfromxai_sdk.video(withcodeandmessageattributes), and a poll that exceeds the timeout raisesTimeoutError. Handle both, as shown in the next section.
The full SDK patterns, including manual polling with start() and get(), live in the official video generation documentation.
Step 4: Call Grok Imagine video through an aggregator (Modellix)
An aggregator wraps the same underlying models behind one account and one API contract. Modellix currently exposes six Grok Imagine video routes on its xAI provider page: grok-imagine-video (text-to-video), grok-imagine-video-i2v, grok-imagine-video-r2v, grok-imagine-video-1.5-i2v, grok-imagine-video-edit, and grok-imagine-video-extend. One honest limitation up front: the 1.5 text-to-video model is not exposed as a standalone route on Modellix — its 1.5 offering is the image-to-video variant. If you need 1080p from a text prompt only, xAI direct is the route.
The call shape is the same submit-and-poll pattern, scoped to a model path. From the Modellix API docs:
1 | curl -X POST https://api.modellix.ai/api/v1/xai/grok-imagine-video \ |
1 | { |
Then poll GET https://api.modellix.ai/api/v1/tasks/{task_id} until the task reports a completed result.
Modellix prices for xai/grok-imagine-video, pulled from the model page on August 28, 2026, display as $0.0840–$0.1080 per second (the range maps across output resolutions). For the same 5-second 720p clip used above, that is $0.42–$0.54, versus $0.35 on xAI direct. On this model, direct is cheaper per call — that is the honest reading of the table.
The same model family is reachable through the xAI direct API, aggregator APIs, and consumer apps. Diagram generated August 28, 2026.
So what is the aggregator actually for? Operational surface area, not per-second discounts. One key and one bill across 210+ image and video models, including Chinese models that normally require a local account, per-task cost logging, and a consistent submit-poll-retrieve contract whether you call Grok Imagine or Kling or Veo. If you are already on a multi-model pipeline, that is the one-API, many-video-models setup this platform exists for — and if your work is mostly image-to-video, our image-to-video API guide compares the routes that matter.
Start Generating with Grok Imagine
Log in to Modellix to run Grok Imagine video and 200+ other models on one key.
LoginCommon Grok Imagine video API errors (and fixes)
When a generation fails asynchronously, the polled result carries an error object with a code. xAI’s documentation defines these values:
error.code |
Meaning | Fix |
|---|---|---|
invalid_argument |
Bad input: unsupported duration, invalid media, conflicting modes, or moderation block | Fix the request parameters or media, resubmit |
permission_denied |
Key or team lacks access to this operation | Confirm the key belongs to the right team with the capability enabled |
failed_precondition |
Operation not available for this model/settings (e.g. 1080p on the base model) | Change model, mode, or resolution |
service_unavailable |
Generation temporarily overloaded | Retry later |
internal_error |
Service-side failure | Retry; if persistent, contact xAI with the request_id |
Synchronous HTTP errors surface before a job is created: 400 (most commonly image + reference_images sent together, which is not allowed), 401 (bad key), and 429 (rate limit). The model metadata embedded in xAI’s pricing page lists 10 requests/second and 480 requests/minute for both video models as of August 28, 2026 — your team’s effective limits are shown in the console, and Modellix’s task API documents its own per-minute ceiling on its error pages. Two boundaries cause most real-world failures: requesting 1080p on grok-imagine-video (only 1.5 supports it), and passing duration/aspect_ratio to video editing (it preserves the input clip’s values).
Frequently Asked Questions
Can Grok Imagine generate videos?
Yes. xAI’s Grok Imagine family includes two video models, grok-imagine-video and grok-imagine-video-1.5, covering text-to-video, image-to-video, reference-to-video, editing, and extension, with clips up to 15 seconds and native audio.
Is there an API for Grok Imagine?
Yes — three routes. The xAI REST API (POST /v1/videos/generations + polling), the official xai-sdk Python package, and aggregator APIs such as Modellix’s POST /api/v1/xai/grok-imagine-video. All three are covered with code above.
Is the Grok Imagine API free?
There is no published free tier for the video generation API. xAI bills per second of generated output against a prepaid account balance, and the pricing page shows no free allowance — consumer-side free access on grok.com is a separate product from the API. Check the official pricing page for any promotional credits before committing.
How much does Grok Imagine video cost per second?
As of August 28, 2026: grok-imagine-video is $0.05/sec at 480p and $0.07/sec at 720p; grok-imagine-video-1.5 is $0.08/sec at 480p, $0.14/sec at 720p, and $0.25/sec at 1080p. Input images and input video are billed separately.
How do I prompt Grok Imagine for video?
Write a descriptive scene prompt — subject, action, setting, lighting — and control the output with the parameters instead of the words: duration (1–15s), aspect_ratio (e.g. 16:9), and resolution (480p/720p/1080p). For character consistency, use reference-to-video with up to seven reference images.
Can I use the Grok Imagine video API with Python?
Yes. Install xai-sdk, then call client.video.generate(prompt=..., model=..., duration=..., aspect_ratio=..., resolution=...). The SDK handles submission and polling, and AsyncClient runs multiple generations concurrently.
How do I download the video?
The completed response contains video.url, a temporary xAI-hosted URL. Download it with curl -O or requests as soon as the job completes, because the URL expires; if you need durable storage, move the file to your own bucket. For alternatives to Grok Imagine across vendors, our Grok Imagine alternatives roundup is the starting point.
Model capabilities and pricing reflect public information as of August 28, 2026 and change frequently. Validate against xAI’s live pricing page and the Modellix model page before committing budget. Access image and video models, including the leading Chinese models, through a single API key at modellix.ai.