Grok Imagine Image
/install grok-imagine-image
xAI Image Generation
Generate images from text with Grok Imagine models. Supports batch, aspect ratio, resolution, base64, and concurrent requests.
When to Use
- User asks to generate an image
- User wants AI art or visuals
- User needs batch image generation
- User wants images for social media, marketing, or content
Quick Start
curl -X POST https://api.x.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-d '{
"model": "grok-imagine-image-quality",
"prompt": "A futuristic city skyline at night"
}'
Models
| Model | Status | Use Case |
|---|---|---|
grok-imagine-image-quality |
✅ Current | All new requests |
grok-imagine-image-pro |
⚠️ Deprecated May 2026 | Legacy, migrate to quality |
Parameters
prompt(required) — Text descriptionmodel(required) —grok-imagine-image-qualityn(optional) — Number of images (1-4)response_format(optional) —url(default) orb64_json
Examples
Single Image
curl -X POST https://api.x.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-d '{
"model": "grok-imagine-image-quality",
"prompt": "A collage of London landmarks in stenciled street-art style"
}'
Multiple Variations
curl -X POST https://api.x.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-d '{
"model": "grok-imagine-image-quality",
"prompt": "A futuristic city skyline at night",
"n": 4
}'
Base64 Output
curl -X POST https://api.x.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-d '{
"model": "grok-imagine-image-quality",
"prompt": "A serene Japanese garden",
"response_format": "b64_json"
}'
Response Format
{
"data": [
{
"url": "https://...",
"b64_json": "..."
}
]
}
Python SDK
import xai_sdk
client = xai_sdk.Client()
response = client.image.sample(
prompt="A futuristic city skyline",
model="grok-imagine-image-quality",
)
print(response.url)
OpenAI SDK Compatible
from openai import OpenAI
client = OpenAI(
base_url="https://api.x.ai/v1",
api_key="YOUR_XAI_API_KEY",
)
response = client.images.generate(
model="grok-imagine-image-quality",
prompt="A futuristic city skyline",
)
print(response.data[0].url)
Tips
- URLs are temporary — download promptly
- Use
b64_jsonfor embedding - Use
nparameter for batch variations - Use async for concurrent different prompts
- Check
respect_moderationfor content filtering
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install grok-imagine-image - After installation, invoke the skill by name or use
/grok-imagine-image - Provide required inputs per the skill's parameter spec and get structured output
What is Grok Imagine Image?
Generate images with xAI Grok Imagine models — batch generation, aspect ratios, base64 output, concurrent requests. Use when user wants AI image generation v... It is an AI Agent Skill for Claude Code / OpenClaw, with 38 downloads so far.
How do I install Grok Imagine Image?
Run "/install grok-imagine-image" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Grok Imagine Image free?
Yes, Grok Imagine Image is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Grok Imagine Image support?
Grok Imagine Image is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Grok Imagine Image?
It is built and maintained by Maliot100X (@maliot100x); the current version is v1.0.0.