Grok Imagine Image 2.0 API

xAI Grok Imagine Image 2.0 API for bold cinematic aesthetics, typography, 1–3 reference image editing, and batch generation up to n=10 images per request across 1K/2K and low/medium quality tiers.

xAIAvailablegrok-imagine-image-2.0POST /v1/images/generations
From$0.0375/ img(3.750 Credits / img)
Model Highlights1K–2K · n=1..10 Batch · 1–3 Refs
Best ForSingle-call batch exploration (n=1..10) · Keyframes & character plates for Grok Video 1.5 · Full-bleed mobile wallpapers & social cards
InputUTF-8 prompt · Optional 1–3 HTTPS ref images
Output & DeliveryJPEG / PNG · 30-day signed HTTPS URL

Grok Imagine Image 2.0 Web Studio & API Playground

Preview live credit estimates and export cURL without signing in, or sign in to upload local reference images and generate real samples.

Configure Image Task

grok-imagine-image-2.0 · POST /v1/images/generations
Live quote
147 chars
Presets:
Reference Images (Optional)0/3

Supports 1–3 reference images (+0.9375 Credits per ref image, once per request).

Click to upload or drag images hereJPG, PNG, WebP · ≤ 30MB each · max 3 files
1 – 10
n=1
Estimated cost~$0.05635.625 Credits
16:9 · 1K medium
Ready
Grok Imagine Image 2.0 sample output
Adjust settings on the left or switch to the JSON tab to inspect the payload

Grok Imagine Image 2.0 API Pricing & Budget Guide

Fixed per-image pricing (3.75–7.5 Credits × n delivered images). Each reference image in image_urls (1–3) adds +0.9375 Credits once per request (not multiplied by n).

First Test Cost

$0.0375/ img
3.750 Credits / imgvs $0.040 official
  • $10 top-up yields ~266 images (1K low) ($1 = 100 Credits, no subscription)
  • $0 charged on failed or timed-out tasks—100% of held credits return automatically

Testing Budget Guide

$1 = 100 Credits
  • $10 (1,000 Credits)266 imgs (1K low) · 177 imgs (1K med)
  • $50 (5,000 Credits)1,333 imgs (1K low) · 666 imgs (2K med)
  • $100 (10,000 Credits)2,666 imgs (1K low) · 1,333 imgs (2K med)
SpecificationRef creditsUSD equivOfficial referencePer $10
1K · low quality · Per output image3.750000 Credits$0.0375$0.040~266 images
1K · medium quality (default) · Per output image5.625000 Credits$0.0563$0.060~177 images
2K · low quality · Per output image5.625000 Credits$0.0563$0.060~177 images
2K · medium quality · Per output image7.500000 Credits$0.0750$0.080~133 images
Reference image surcharge (each image in image_urls, 1–3, once per request)+0.937500 Credits / ref+$0.00938$0.010Per ref (once/call)

Interactive Volume Cost Calculator

Choose output settings and expected call volume to estimate your spend in Credits and USD.

Interactive Specification Cost Calculator
grok-imagine-image-2.0
Output resolution (resolution)
Quality tier (quality)
Images per request (n · 1–10)n = 1
Reference images (0–3)+0 Credits
0 / 3
Price per Call
5.625Credits / image
≈ $0.0563 USD ($1 = 100 Credits)Save 6% vs. official estimate
Output tier & batch n
1K medium × n=1 (5.6250 × 1)
Reference input (0–3)
Text-to-image (+0 Credits)
$10 (1,000 Credits) output
~177 images
1,000 runs: $56.255,625 Credits
Official estimate: $60.00You save $3.75
Settles strictly on delivered image count; each reference image is charged once per request (not multiplied by n); failed calls cost 0 Credits.

About Grok Imagine Image 2.0, Integration & Model Comparison

1K–2K image & 3-ref editing · Up to 10/call

011K–2K · n=1..10 Batch · 1–3 Refs

Core Capabilities

Grok Imagine Image 2.0 API brings xAI’s signature cinematic lighting, expressive styling, and multi-variant batch generation to Callmodels’ unified POST /v1/images/generations endpoint. Choose 1K or 2K resolution, low or medium quality, "auto" plus 13 aspect ratios (including mobile 19.5:9 and 20:9), 1–3 reference images, and n=1..10 concurrent outputs in a single API call.

02POST /v1/images/generations

Input Specs & 30-Day Delivery

Input
UTF-8 prompt · Optional 1–3 HTTPS ref images
Output
JPEG / PNG · 30-day signed HTTPS URL
03$0.0375 / img

Pricing Advantage & $0 Failure Protection

Pricing is deterministic per delivered image (3.75 Credits at 1K low, 5.625 Credits at 1K medium / 2K low, and 7.5 Credits at 2K medium, -6% vs. official list). When image_urls is supplied, each reference image (1–3) adds +0.9375 Credits once per request (not multiplied by n).

Three Ways to Use Grok Imagine Image 2.0

Use in Claude & ChatGPT (Zero-Code MCP)

Connect Callmodels Remote MCP to Claude, ChatGPT, or Google Gemini via zero-key browser sign-in. Run Grok Imagine Image 2.0 in plain English inside chat with upfront price quotes before any spend.

Connect Chat Assistant

Direct HTTPS REST API

Send standard JSON requests to POST /v1/images/generations on https://api.callmodels.dev with account-scoped Idempotency-Key deduplication and 30-day signed result URLs—zero vendor SDK lock-in.

Jump to API Reference

Integrate with AI Coding Agents (Cursor / Claude Code)

Copy a self-contained engineering prompt with exact endpoint, schema constraints, polling loop, and error handling—paste straight into Cursor, Claude Code, or Codex.

Production Use Cases

n: 4..10 · 1K low / medium

Single-call batch exploration (n=1..10)

Generate 4 to 10 distinct compositions in one async task so users can pick their favorite frame immediately.

16:9 / 9:16 · 2K medium

Keyframes & character plates for Grok Video 1.5

Create cohesive start frames and subject sheets tuned to xAI’s visual aesthetic, then animate them in Grok Imagine Video 1.5.

9:19.5 / 9:20 / 16:9 · 2K

Full-bleed mobile wallpapers & social cards

Native 9:19.5 and 9:20 aspect ratios fit modern smartphone screens edge-to-edge without cropping.

Sibling & Family Model Comparison

ModelBilling ModeMax SpecStarting PriceOutput per $10Best For
Nano Banana ProFixed per image4K · 14 refs included · 10 ratios$0.0390 / img256 imgs (2K)2K–4K flagship studio photography, typography & 14-ref fusion
Nano Banana 2.1Fixed per image4K · 14 refs · 14 ratios (4:1–8:1)$0.0220 / img454 imgs (1K)Fast low-cost 1K–4K generation, 4:1/8:1 banners & 14-ref edits
Grok Imagine Image 2.0Fixed per image2K · n=1..10 batch · 1–3 refs$0.0375 / img266 imgs (1K low)Cinematic aesthetics, mobile 19.5:9/20:9 & n=1..10 batch variants
GPT Image 2.6 FlareActual tokens4K · 16 refs · Mask & GIF$0.0139 / img~721 imgs (16:9 low)Fast production, 16-ref/mask editing & animated GIFs
GPT Image 2.6 SunburstActual tokens4K · Studio precision · 16 refs$0.0139 / img~721 imgs (16:9 low)Hero product renders, macro materials, mask edits & GIFs
Seedream 5.5Fixed per image2K · One output per request · PNG/JPEG$0.0200 / img500 imgs (1K / 1.5K)Fixed per-image rates and transparent cutouts

Itemized Call Billing & 30-Day Result Delivery

Atomic Hold & Settlement · Grok Imagine Image 2.0

$0 on Failure
Rate lock
Locked at HTTP 202 acceptance
Idempotency
24h Idempotency-Key
Starting rate
$0.0375 / img (3.750 Credits / img)
Failed or timed out
0 Credits (100% hold returned)

How billing and 30-day file delivery work

  1. 1
    Submitting a request locks the published rate and temporarily holds the maximum credits for your chosen specification.
  2. 2
    Once generation finishes, Callmodels verifies output file integrity and metadata before marking the task completed.
  3. 3
    Exact usage is settled against the locked rate, any unused hold returns immediately to your balance, and a 30-day HTTPS link is signed.
  4. 4
    Your backend or browser reads https://files.callmodels.dev/... directly for 30 days without passing an API key.

Grok Imagine Image 2.0 API FAQ

How does batch billing work when n > 1 on Grok Imagine Image 2.0?

At acceptance, Callmodels holds n × the per-image tier rate (+0.9375 Credits × reference image count if image_urls is present). Upon completion, you are charged strictly for the number of verified output images actually delivered in results[], and any unused hold returns automatically.

Does reference_image_input multiply by n when generating a batch?

No. Each reference URL in image_urls (1–3) adds +0.9375 Credits ($0.00938) once per request—even when n=10, reference images are never multiplied by n.

What are the default resolution and quality if omitted?

Grok Imagine Image 2.0 defaults to resolution "1K", quality "medium" (5.625 Credits), size "auto", and n = 1.

Does Grok Imagine Image 2.0 accept an output_format parameter?

No. Output encoding (JPEG/PNG) is selected automatically by the model and verified by magic bytes before signing your 30-day files.callmodels.dev URLs.

Are failed calls ever charged?

Never. Any task ending in failed settles at 0 Credits and releases 100% of held credits.

Grok Imagine Image 2.0 API Reference & Code Examples

Submit to POST /v1/images/generations with your Bearer key and a stable Idempotency-Key. Query the returned task ID for its result links and settled credits.

Building with Cursor, Claude Code, or Codex? Copy the AI Integration Prompt

Includes exact endpoint, parameter constraints, async polling loop, and error handling—paste straight into your coding agent.

Standalone Docs Page
Endpointhttps://api.callmodels.dev/v1/images/generationsGET /v1/tasks/{task_id}
Public model IDs
grok-imagine-image-2.01K / 2K Generation, 1–3 Ref Editing & Batch n=1..10
ParameterTypeAllowed values & notes
Authorizationheader · Required
string
Bearer sk-... server-side API key from your account.
Idempotency-Keyheader · Optional (recommended)
string
1 to 255 ASCII chars. Prevents duplicate submissions and charges for 24h.
modelbody · Required
"grok-imagine-image-2.0"
Stable public model ID for xAI Grok Imagine Image 2.0.
promptbody · Required
string
1 to 5,000 UTF-8 characters describing the scene or edit.
resolutionbody · Optional ("1K")
"1K" | "2K"
Output resolution tier.
qualitybody · Optional ("medium")
"low" | "medium"
Rendering quality tier combined with resolution.
sizebody · Optional ("auto")
"auto" | 13 aspect ratios
Supports "auto", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "2:1", "1:2", "19.5:9", "9:19.5", "20:9", and "9:20".
nbody · Optional (1)
integer (1..10)
Number of images to generate in one call; settles strictly on delivered count.
image_urlsbody · Optional (omitted)
string[] (1..3)
Optional 1–3 HTTPS reference images (+0.9375 Credits per reference image, once per request).
# Set CALLMODELS_OPERATION_ID once per job and keep it for retries.
: "${CALLMODELS_OPERATION_ID:?Set a stable job ID}"
curl --silent --show-error --fail-with-body --max-time 15 "https://api.callmodels.dev/v1/images/generations" \
  -H "Authorization: Bearer $CALLMODELS_API_KEY" \
  -H "Idempotency-Key: $CALLMODELS_OPERATION_ID" \
  -H "Content-Type: application/json" \
  --data-binary '{
  "model": "grok-imagine-image-2.0",
  "prompt": "Brushed silver grand tourer coupe parked on a misty coastal cliff road at dawn",
  "size": "16:9",
  "resolution": "1K",
  "quality": "medium"
}'

# Set TASK_ID to the id from the response, then poll until terminal.
if [ -n "${TASK_ID:-}" ]; then
  curl --silent --show-error --fail-with-body --max-time 15 "https://api.callmodels.dev/v1/tasks/$TASK_ID" \
    -H "Authorization: Bearer $CALLMODELS_API_KEY"
fi
HTTP/1.1 200 OK
X-Request-Id: req_example
Cache-Control: no-store

{
  "id": "task_01e561ba-859e-47fe-be79-60bc6f1d6499",
  "model": "grok-imagine-image-2.0",
  "object": "image.generation.task",
  "created_at": "2026-11-21T00:00:00.000Z",
  "status": "completed",
  "results": [
    {
      "type": "image",
      "url": "https://files.callmodels.dev/task_01e561ba-859e-47fe-be79-60bc6f1d6499/0.jpg?expires=1797811200&sig=example",
      "expires_at": "2026-12-21T00:00:00.000Z"
    }
  ],
  "usage": {
    "cost_credits": "5.625"
  }
}
HTTP / Task Error CodeCause & Recommended HandlingBilling Impact
400 invalid_parameter
400 model_not_found
Use the model ID and parameters documented for the endpoint. Correct the JSON before sending again.0 Credits for this rejection
401 invalid_api_key
Check the server-side Bearer key, expiration and revocation status.0 Credits for this rejection
402 insufficient_balance
402 key_quota_exceeded
Check available account credits and the key’s total and daily limits with GET /v1/credits.0 Credits for this rejection
403 model_access_denied
403 account_disabled
Check the model allowlist and account status.0 Credits for this rejection
404 not_found
Check the task ID or original Idempotency-Key and the account that submitted it.0 Credits for this rejection
409 idempotency_key_conflict
Use the original JSON for this job. Assign a fresh key only to a new job.0 Credits for this rejection
413 body_too_large
415 unsupported_media_type
Send application/json with a request body no larger than 128 KiB.0 Credits for this rejection
500 internal_error
503 service_unavailable
503 model_unavailable
On a timeout or transient error, look up the original job and retry only with its original key and body.Check the task record
Task: delivery_failed
Task: submission_unknown
Task: submission_rejected
Task: upstream_failed
Task: timeout
The task ended. Its hold was released. Review error.code before creating a separate generation job.0 Credits charged

Ready to Ship with Grok Imagine Image 2.0 API?

Sign in with Google to create scoped sk- API keys, top up from $10 with no monthly commitment, and pay $0 on failed calls.