Grok Imagine API Tutorial: Limits, Pricing & Free Quota (2026)
Integrate xAI's Grok Imagine API for image & video: curl/Python code, daily limits, official pricing from $0.05/sec, free quota, plus pay-as-you-go access via GetModel with no single-account cap.
Want to generate images and short videos in code instead of tapping them out one by one in the Grok app? This guide takes xAI’s Grok Imagine from “what it is” to “how to call it, what it costs, and how many you can run per day” — full code and rate-limit rules included, plus free quota and common error fixes.
In a hurry? You can also line up a single unified Key first: use GetModel’s OpenAI-compatible endpoint to call Claude / GPT / Gemini pay-as-you-go, with a balance shared across all models and no single-account daily cap. See models and live prices on the Claude Fable 5 and other model pages.
What is Grok Imagine
Grok Imagine is xAI’s image + short-video generation capability. On the consumer side it lives in the Grok app (iOS / Android) and grok.com, and requires a SuperGrok or X Premium subscription. On the developer side it’s exposed through xAI’s official API: generate an image straight from text, or turn an image/text into a short video with audio.
It’s not the same thing as the earlier grok-2-image (text-to-image only): this Imagine generation leads with native video + audio and is notably cheap for its class — roughly $4.2/minute with audio, about a third of Google Veo and a fraction of the Sora line.
Remember the split up front: the consumer side (app) runs on a daily quota tied to your subscription, while the developer side (API) is pay-as-you-go. The two billing models are fully independent. Both are covered below.
API Access + Code
xAI’s endpoint is OpenAI-SDK compatible — just point base_url at https://api.x.ai/v1 and reuse your existing code. First grab a Key starting with xai-... from the xAI console.
Text-to-image (curl)
Image generation hits POST /v1/images/generations and returns jpg:
curl https://api.x.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-d '{
"model": "grok-2-image",
"prompt": "A shiba inu in an astronaut helmet, cyberpunk neon backdrop",
"n": 1
}'
Text-to-image (Python / OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="your-xai-key",
base_url="https://api.x.ai/v1",
)
resp = client.images.generate(
model="grok-2-image",
prompt="A shiba inu in an astronaut helmet, cyberpunk neon backdrop",
n=1,
)
print(resp.data[0].url)
The
grok-2-imageused above is the image model currently documented by xAI; xAI updates model IDs between releases, so check the official image docs before integrating.
Generating video
Video uses the grok-imagine-video model, supports text / image / video → video, is billed per second ($0.05/sec), and is available in us-east-1 and us-west-2. Video is a long-running job — you typically submit it as an async task and poll for the result. For the exact request body and polling endpoint, follow the official xAI docs, which change with each release.
The API-side limit is requests per second (~10 req/s for the video model) — a different thing from the “images per day” quota on the consumer side below. Don’t conflate them.
Daily Limits & Rate Limiting
This is where most people get tripped up — it’s usually not about money, it’s about hitting a daily quota or peak-hour throttling. Two layers:
Consumer side (Grok app / X) daily quota
xAI does not publish exact per-tier numbers. The values below are community-observed approximations and will shift between releases:
| Plan | Price (approx) | Images / day | Videos / day |
|---|---|---|---|
| Free | $0 | Basically none (text chat only) | — |
| SuperGrok Lite | ~$10/mo | ~20 | A few |
| X Premium | in subscription | — | ~50 |
| X Premium+ | in subscription | — | ~100 |
| SuperGrok (Heavy) | ~$30/mo | ~50 (claimed unlimited) | ~500 |
A few universal rules:
- Reset time: quota refreshes at 00:00 UTC, and unused generations don’t roll over to the next day.
- Peak throttling: xAI runs a “fair use” algorithm that slows heavy users during peak hours; many SuperGrok users hit a soft cap after 50–100 rapid generations.
- Free tier tightened: free users on X are now mostly limited to lightweight text models — Imagine’s image/video generation sits behind the paywall.
API-side rate limit
The developer side isn’t “N per day” — it’s requests per second (RPS), around 10 req/s for the video model, with concurrency and quota tracked per Key. For batch jobs, build a queue with exponential backoff instead of firing every request at once.
Pricing
The official API is pay-as-you-go (see the x.ai site for live prices):
| Capability | Notes | Price (approx) |
|---|---|---|
| Image · standard | Imagine basic | $0.02 / image |
| Image · high-res | Imagine pro | $0.07 / image |
| Video | grok-imagine-video | $0.05 / sec (~$4.2 / min with audio) |
The table above lists Imagine-series API prices; the
grok-2-imageused in the code samples is the image model currently in the docs, priced close to the high-res tier. Always defer to x.ai for exact model names and live prices.
The consumer side is subscription-based: SuperGrok at $30/mo bundles image generation plus a daily video quota, which suits high-frequency personal use — whereas pay-as-you-go API fits batch, production, and per-project cost accounting.
If your scenario is bulk image generation, production, or per-project cost accounting, a single account’s daily quota and peak throttling get in the way — that’s exactly where pay-as-you-go fits. An aggregation gateway like GetModel gives you an OpenAI-compatible endpoint that’s pay-as-you-go with a balance shared across all models, with no per-account daily quota to begin with. See available models and live prices on the model pages and pricing page. To call Claude / GPT / Gemini from the same code, see one API key for multiple LLMs.
FAQ
Is Grok Imagine free? Consumer-side image/video generation is largely paywalled (SuperGrok / X Premium and up); the free tier is mainly text chat. The developer API has no free quota — it’s purely pay-as-you-go.
How often do limits reset? The consumer side refreshes daily at 00:00 UTC with no rollover. The API side isn’t a daily quota — it’s a per-second request limit.
What’s the difference between the official API and Grok Imagine in the app? Same models, two billing models: the app runs on a subscription daily count and suits manual creation; the API is pay-as-you-go and suits programmatic batch calls. For production integration, always use the API.
Getting 429 (Too Many Requests)? You’ve hit a rate limit. On the consumer side, wait for the reset or avoid peak hours; on the API side, lower concurrency and add exponential backoff. For batch work, smooth the load with an upstream queue or spread it across channels via an aggregation gateway.
Can I use the output commercially? Follow xAI’s terms of service and content policy. Confirm the license scope and compliance limits before commercial use — especially with people’s likenesses or brand elements.
Ready to start? Sign up for GetModel and grab a Key — one OpenAI-compatible endpoint to call Claude / GPT / Gemini pay-as-you-go, with a balance shared across all models and no single-account daily cap. See unit prices on the model pages and pricing page.
References: xAI API · Grok Imagine Video docs · Image generation docs