Grok Imagine API

x-ai/grok-imagine-image
The Grok Imagine Image API is xAI's most capable image generation and editing model, delivering photorealistic output, multi-style mastery, and best-in-class prompt adherence through a single, developer-friendly REST endpoint.
Output
$0.026 / gen
Released
Mar 3, 2026

Overview

What Is the Grok Imagine API?

The Grok Imagine Image API is xAI's flagship visual generation model, built to handle the full creative lifecycle from a blank text prompt to a polished, production-ready image. Developed by the same team behind the Grok family of foundation models, it was engineered with a dual mandate: exceptional output quality and real-world developer economics.

Under the hood, Grok Imagine Image draws on an autoregressive architecture, originally code-named Aurora, that builds images patch by patch, much like a language model builds text token by token. The result is remarkably coherent output, with tightly controlled composition, accurate anatomical rendering, and legible in-image text that many diffusion-based models struggle with.

Unlike most image generation tools that bolt generation capabilities onto a general-purpose assistant, Grok Imagine Image was purpose-built for visual creation. The model interprets natural language with strong prompt fidelity, which means what you describe is genuinely close to what you get, even for complex, multi-element scenes.

API Pricing

  • $0.026 per image

Everything You Need to Build Visual AI Products

Text-to-Image Generation

Transform natural language descriptions into high-fidelity images across dozens of visual styles from hyperrealistic photography to anime, oil painting, pencil sketch, stenciled street art, and cinematic renders.

The model's prompt adherence is a genuine differentiator here. Describe a scene with multiple subjects, specific lighting conditions, and a target aesthetic, and Grok Imagine Image delivers output that closely matches your intent, rather than approximating it.

Instruction-Based Image Editing

Pass an existing image (via URL or base64) alongside a plain-English instruction "render this as a pencil sketch with detailed shading" or "swap the background to a busy Tokyo street at night" and receive a transformed image that respects both the edit instruction and the original composition.

This is particularly powerful for product photography workflows, where you need multiple variations of a base asset without re-shooting.

Style Transfer & Restyling

Restyle entire scenes with a single prompt. Convert a realistic photograph into an anime illustration, apply cinematic color grading, or shift the artistic medium from digital to watercolor — all without manual masking, layers, or post-processing.

The model shows particular strength in retro anime and cyberpunk aesthetics, making it a natural fit for creative studios, game developers, and content teams that iterate across visual directions rapidly.

High-Resolution Output

Generate images at 1024×1024 pixels as a baseline, suitable for web, social, and lightweight print applications without upscaling. The model handles complex compositions at this resolution without the quality degradation common in lower-end generation models.

Accurate rendering of hands, faces, and legible in-image text are standout strengths — areas where many competing models still leave visual artifacts.

Real-World Applications of the Grok Imagine Image API

Teams across industries are already using Grok Imagine to cut production time and eliminate bottlenecks in visual content workflows.

Product Photography at Scale

Automate product image generation, background replacement, and style variations. Place products in contextual lifestyle scenes or swap backdrops entirely — no studio required, no scheduling delays.

Concept Art & Asset Creation

Rapidly prototype characters, environments, UI assets, and concept illustrations. The model's strength in cyberpunk and retro anime aesthetics makes it a natural fit for indie studios and art directors.

Campaign Visuals On Demand

Generate bespoke ad creatives and social media assets without the stock photo grind. Explore multiple creative directions in parallel — more ideas in less time, with no licensing headaches.

Editorial Illustration

Create article illustrations, book cover mockups, and bespoke editorial imagery that precisely matches a brief. Eliminate dependency on stock image subscriptions for unique, original visuals.

Embed AI Image Generation

Add a "generate image" feature to your application without building your own model pipeline. The API handles inference, scaling, and output delivery — you handle the UX.

Visual Learning Materials

Generate diagrams, illustrated scenarios, and custom imagery for courses, textbooks, and learning platforms. Describe exactly what the scene should convey; get an image that actually matches.

Concept Visualization

Turn room descriptions or rough sketches into photorealistic renders for client presentations. Iterate on interior design concepts and spatial ideas in minutes rather than days.

Digital Lookbooks & Styling

Visualize garment combinations, generate look-book imagery, or prototype new colorways and textures without physical samples. Speed up the design review cycle dramatically.

Grok Imagine Image vs. Other Image Generation APIs

Here's how the model stacks up against other popular options available on AI/ML API.

Model Provider Price / Image Text Rendering Multi-Style Image Editing Speed
Grok Imagine Image ✦ Cheapest xAI $0.026 ✓ Strong ✓ Yes ✓ Native Fast
FLUX.1 Pro Best quality Black Forest Labs $0.065 ✓ Strong ✓ Yes Limited Moderate
DALL·E 3 OpenAI $0.052–$0.156 Good Moderate ✓ Yes Moderate
Stable Diffusion 3.5 Stability AI $0.0845 Inconsistent ✓ Strong Via inpainting Fast
Imagen 3 Google $0.039 Good Moderate ✓ Yes Moderate

‍

‍

Uptime and performance

  • Uptime (24h): 50.0%
  • Uptime (7d): 92.0%
  • Availability (24h): 50.0%
  • Error rate (24h): 50.0%

Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.

Use cases

Text-to-image generation is documented for Grok Imagine Image, including generating new images from text prompts.

Image editing is documented, including editing an existing image by providing a source image and a prompt describing the changes.

Image-to-image workflows are documented, including using reference images for generation or style transfer.

Batch image generation is documented, including generating multiple images and controlling aspect ratio, resolution, and quality.

How to use Grok Imagine API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to x-ai/grok-imagine-image.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/images/generations",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "x-ai/grok-imagine-image",
      "prompt": "A cat holding a sign that says hello"
    },
)
print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/images/generations", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "x-ai/grok-imagine-image",
    "prompt": "A cat holding a sign that says hello"
  }),
});
console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/images/generations \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"x-ai/grok-imagine-image","prompt":"A cat holding a sign that says hello"}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Grok Imagine API Pricing

TypePrice
Output
$0.026 / gen

Grok Imagine Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
Text-to-Image Arena
1020
Human preference Elo from blind pairwise comparisons of generated images, measured independently by Artificial AnalysisSourceSeptember 28, 2026

Grok Imagine vs other models

ModelInputOutputContextBest for
Grok Imagine
This page
$0.026 / gen
Image generation at scale
$0.325 / 1M tokens
$78 / 1M tokens
128K tokens
Image generation at scale
$6.5 / 1M tokens
$39 / 1M tokens
Image generation at scale
$0.325 / gen
Image generation at scale
$0.0195 / MP (variable)
Image generation at scale

Frequently asked questions

Grok Imagine takes image, text as input and returns image.

Grok Imagine is priced at $0.026 / gen.

Grok Imagine is billed per generation — a fixed charge per output rather than by prompt length.

Yes, Grok Imagine accepts image input as well as a text prompt.

Grok Imagine was built by xAI .

Send a request to https://api.aimlapi.com/v1/images/generations with x-ai/grok-imagine-image as the model id.

Yes. Grok Imagine is served through AI/ML API, so the same key and endpoint format used for other models applies.

No, Grok Imagine is an image generation model that only produces images from text input.

Grok Imagine is a lightweight text-to-image model by xAI built for fast, cost-efficient image generation.

Start building with Grok Imagine

Get API Key
1000+ models, one API.