Grok Image 2 API
by xAI
xAI Imagine Image 2.0. Instruction-following generation and editing up to 2K.
Generate and edit images with xAI's Imagine Image 2.0 through one unified API. Quality and 1K/2K controls, async jobs, and webhooks, with no separate xAI account to manage.
- 5 credits
- Flat per image
- 2K
- Max output
- ~15s
- Avg. generation
Image · example Playground
Try Grok Image 2 right here.
Capabilities
What's new in Grok Image 2.
Imagine Image 2.0
xAI's latest image model, built for real creative work. It follows instructions down to the details and plans typography and layout the way a designer would.
Sharp text and dense layouts
Posters, infographics, and multi-part visuals hold together, and small print stays readable instead of dissolving into glyphs.
Editing as a first-class path
Pass an image plus a prompt to change exactly what you mean and leave the rest. Subjects, style, and composition stay consistent across generations.
Quality and resolution controls
Pick low or medium quality and 1k or 2k output. Defaults are medium quality at 2K.
Wide aspect-ratio set
Square, portrait, landscape, banners, and ultra-wides, plus auto when you want the model to choose.
Same API as every other model
One endpoint, one key, one bill. 5 credits per image. The faster 2-credit model stays available as Grok Image Fast.
Showcase
See what Grok Image 2 can create.
Real outputs generated with Grok Image 2 on Apiframe, each with the prompt behind it.
A print-ready event poster. Huge condensed cream type reading SOLACE, second line LATE SET. Sharp small print: FRIDAY OCT 26 · 10PM · 14 ELM STREET. Deep oxblood and walnut field, thin brass rule, a small vinyl-groove mark, no extra logos, no misspellings.
A 12-inch vinyl record sleeve, front cover. Title SOLACE VOL. 04 in large clean type. Simple geometric sunset in oxblood, cream, and walnut. Catalog number SL-004 small at the bottom. Print-ready, no extra logos, no misspellings.
Photoreal printed cocktail menu card on dark walnut at a listening bar. Heading HOUSE POURS. Six drinks with names and prices, all perfectly legible: OLD LIGHT 14, RIMSHOT 15, AFTER HOURS 16, NEEDLE DROP 14, LOW HUM 13, LAST CALL 12. Cream paper, oxblood type, SOLACE wordmark small at the top, no misspellings.
A printed week card titled THIS WEEK AT SOLACE, lying on a bar counter. Seven rows Mon through Sun, each with a set name and a time, all type sharp and readable. Cream stock, oxblood ink, brass paperclip. Photoreal, no misspellings.
Photoreal interior of a vinyl listening bar at night. A record spinning on a deck, a matchbook on the counter printed SOLACE, low lamps, two people out of focus in the back. Handheld, grain, warm tungsten, no extra logos, no misspellings.
Photoreal night photograph of a small vinyl listening bar storefront named SOLACE. Black facade, warm interior light, a cream neon wordmark reading SOLACE above the door. In the window, a printed poster with sharp type: LATE SET FRIDAY 10PM. Wet sidewalk reflections, handheld, film grain, no extra logos, no misspellings.
Pricing
Simple per-generation pricing.
6 credits per generation ≈ $0.06
- You only pay for successful generations. Failed jobs are refunded automatically.
- One credit balance across every model on Apiframe, no per-model plans.
- Start with free credits. No subscription required.
- Volume discounts on larger plans.
Specs
At a glance.
Comparison
Grok Image 2 vs Grok Image Fast vs GPT Image 2
Grok Image 2 against the other production-tier image models on Apiframe.
| Feature | Grok Image 2 | Grok Image Fast | GPT Image 2 |
|---|---|---|---|
| Price per image | 5 credits flat (≈$0.05) | 2 credits flat (≈$0.02) | 2–17 credits × n |
| Max resolution | 2K | Standard | High |
| Quality control | low / medium | — | low / medium / high / auto |
| Image input | Single-image edit | Single-image edit | Multi-image editing |
| Best for | Instruction-heavy stills and posters | Cheap volume and drafts | ChatGPT-class editing and reasoning |
Specs reflect what each model supports on Apiframe today, from the live catalog.
Quickstart
How to call the Grok Image 2 API.
Send one POST /v2/images/generate request with your API key. The call returns a jobId you can poll, or pass a webhook_url and the result is pushed to you the moment it's ready.
Swap grok-image for any other model and nothing else changes.
const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
"model": "grok-image",
"grokImageParams": {
"image": "https://example.com/input.jpg",
"resolution": "2k",
"quality": "medium"
}
}),
});
const { jobId } = await response.json();
console.log(jobId); Input schema
Every field Grok Image 2 accepts, with types and defaults. The full reference lives in the docs.
| Field | Type | Description |
|---|---|---|
| prompt required | string | Text description of what to generate. |
| model required | string | The model identifier for this endpoint. Default:"grok-image" · "grok-image" |
| grokImageParams.image | string (URL) | Reference image (URL) |
| grokImageParams.resolution | string | Resolution Default:"2k" · "1k", "2k" |
| grokImageParams.quality | string | Quality Default:"medium" · "low", "medium" |
Grok versions
Every Grok image model on Apiframe. Switch with one parameter.
Use cases
What teams build with Grok Image 2.
Posters and dense layouts
Image 2.0 plans typography and composition together, so multi-part visuals and small print stay sharp instead of falling apart.
Iterative editing
Pass a source image and describe the change. The model keeps what you did not mention and applies only the edit.
First frame for Grok Video
Generate the still here, then animate it with Grok Video 1.5. One pipeline, one provider aesthetic, one API key.
Quality when it counts
Default is medium quality at 2K. Drop to low or 1K when you are iterating, same 5-credit price.
Reviews
9,800+ developers. One API.
Real Apiframe reviews from Trustpilot and G2.
Speeds up our ad creative iteration
The API integrates directly into my existing pipeline, so I can generate and iterate on image variations for Meta ads without jumping between tools. We can go from concept to a testable ad in the same day instead of spreading it across a week.
Fast, reliable, easy to integrate
Image generation requests are processed quickly, and the results are consistently high quality. Customer support has also been responsive whenever I had questions. It has saved me a lot of development time.
Seamless integrations, effortless setup
Generating ad creatives for Facebook and Google ads is more streamlined now since we use APIFRAME to manage the workflow, which used to require a lot of time with official APIs. The initial setup was very easy, just a matter of using curl.
Grok Image 2 questions
What teams ask before shipping with Grok Image 2. Everything else lives in the docs.
What is Grok Image 2?
xAI's Imagine Image 2.0, available on Apiframe as grok-image. It generates images from text and edits existing ones with natural language.
How is it different from Grok Image Fast?
Grok Image 2 is the 2.0 model: 2K output, a quality control, and stronger instruction following. Grok Image Fast (grok-imagine-image) is the cheaper, quicker model at 2 credits.
Can it edit images?
Yes. Pass grokImageParams.image with a public URL and describe the change. Aspect ratio is ignored while editing.
What resolutions and quality settings are available?
Resolution is 1k or 2k (default 2k). Quality is low or medium (default medium). Both are the same 8-credit price.
How much does it cost?
A flat 5 credits ($0.05) per image, whether you generate or edit.
Where can you access it?
Through Apiframe, as well as grok.com/imagine and the xAI API.
Related models
All image modelsFlux 2 Max
by Black Forest Labs
Highest-quality Flux 2 tier.
View modelMidjourney
by Midjourney
Iconic stylised, cinematic look.
View modelNano Banana 2
by Google
Next-gen Nano Banana with refined detail.
View modelSeedream 5.0 Pro
by ByteDance
Flagship ByteDance model with sharp 1K/2K output and up to 10 reference images.
View model9,800+
developers & companies
Official partner of
Power your next AI product with Apiframe.
Instant access to 70+ media models through a single API. Start free and scale when you're ready.