Grok Imagine API
xAI's Grok Imagine image generation. Fast, 300 RPM.
$0.022 per image · priced before it runs · no subscription
About xAI Grok Imagine
Grok Imagine is an image model from xAI. It renders 1 size and is billed per image at the size you ask for, $0.022 per image. The image comes back on a hosted URL that does not expire. You can call it without an account, an API key or a subscription.
Use Grok Imagine for
- Product shots, ad creative and social images generated per request
- Illustrations and diagrams an agent produces alongside its written answer
- Concept art and mood boards, several variations from one prompt
- Placeholder and test imagery inside an app's own pipeline
Grok Imagine specs
- Endpoint
- POST /api/v1/images/generations
- Price
- $0.022 per image
- Sizes
- 1024×1024
- Output
- A hosted image URL that does not expire
How to call Grok Imagine
Pass xai/grok-imagine-image as the model field. The first request returns a 402 with the exact price; a signed retry runs it, and the client libraries fold the two into one call — how the payment works. Request and response shapes are in the docs.
curl -X POST https://blockrun.ai/api/v1/images/generations \
-H "Content-Type: application/json" \
-d '{"model": "xai/grok-imagine-image", "prompt": "a lighthouse at dawn, watercolor", "size": "1024x1024"}'Grok Imagine or another image model
Every image model here takes the same request on the same endpoint, so trying another is a one-line change to the model field. The AI Image Generator page lists all of them side by side.
- xAI Grok Imagine (this page)$0.022 per image
- xAI Grok Imagine 2.0$0.043 per image
- xAI Grok Imagine Pro$0.0535 per image
- ByteDance Seedream 5.0 Profrom $0.0483 per image
- Z.ai CogView-4from $0.0168 per image
Grok Imagine API questions
How much does the Grok Imagine API cost?
$0.022 per image, including the per-call transaction fee. The exact price is quoted in the 402 response before anything is generated, and you pay per request with no subscription.
Do I need an API key to use Grok Imagine?
No. Each request carries its own payment, so an agent or script can call Grok Imagine with no account and no key. Teams that prefer one can use an API key with card or invoice billing instead.
How do I call Grok Imagine?
Send a POST to /api/v1/images/generations with "model": "xai/grok-imagine-image". The request shape is shown above, and the same endpoint serves every image model on the catalog, so switching models is a one-line change.
What sizes does Grok Imagine support?
1024×1024. Each size has its own price, and the one you request is the one you pay for.
Grok Imagine or another model — which should I use?
Compare it with Grok Imagine 2.0 ($0.043 per image), Grok Imagine Pro ($0.0535 per image), Seedream 5.0 Pro (from $0.0483 per image) in the table above. They take the same request on the same endpoint, so you can try two on one prompt and keep the one you prefer.
Two ways to run this
Get an API key
Sign in, get a key, and call the same endpoints with usage billed to your account. For teams that want one invoice instead of one wallet.
Get an API keyOr let your agent pay per call, in USDC
No account, no API key. Three steps, and the last one is the request this page is about.
- Point your agent at BlockRun
Install ClawRouter, or add the BlockRun MCP server to Claude Code, Cursor, Codex or OpenClaw. Any OpenAI-compatible client works too — change the base URL, nothing else.
curl -fsSL https://blockrun.ai/ClawRouter-update | bash - Fund a wallet with USDC
Send USDC to a wallet on Base, Solana or Arc. There is no account to create and no API key to issue: the wallet is the account, and it pays per call.
- Call Grok Imagine
The first call returns HTTP 402 with the exact price, your agent signs it, and the answer comes back. Payment settles on-chain; nothing is charged if the call fails.
curl -X POST https://blockrun.ai/api/v1/images/generations \ -H "Content-Type: application/json" \ -d '{"model": "xai/grok-imagine-image", "prompt": "a lighthouse at dawn, watercolor", "size": "1024x1024"}'
Explore everything on BlockRun
- GPT-6 Astra
- GPT-6.1 Sol
- GPT-6 Sol
- GPT-6 Luna
- GPT-5.6 Sol
- GPT-5.6 Terra
- GPT-5.6 Luna
- GPT-5.6 Sol Pro
- GPT-5.6 Terra Pro
- GPT-5.6 Luna Pro
- GPT-5.5
- GPT-5.5 Pro
- ChatGPT Instant (GPT-5.5)
- GPT-5.4
- GPT-5.4 Pro
- GPT-5.1
- GPT-5.2
- GPT-5.4 Mini
- GPT-5 Mini
- GPT-5.4 Nano
- GPT-5.2 Pro
- GPT-5.3 Codex
- GPT-4.1
- GPT-4.1 Mini
- GPT-4.1 Nano
- GPT-4o
- GPT-4o Mini
- o1
- o3
- o3-mini
- All models →