Cheaper Gen.
xAIAPI key

Grok Imagine Image 2.0 API Key

Get a Grok Imagine Image 2.0 API key in about two minutes. One Cheaper Gen. key calls Grok Imagine Image 2.0 — 2 endpoints — and every other model in the catalog, from $0.022/image, 45% below xAI's official price. Prepaid, no subscription.

Key
Free
pay per use
Credits from
$10
≈ 454 test images
First request
$0.022
text-to-image
Models per key
41
12 developers

Step by step

How to get a Grok Imagine Image 2.0 API key

  1. 1

    Create an account

    Sign up with Google or a magic link sent to your email. No sales call and no waitlist.

  2. 2

    Add credits

    Credits are prepaid in US dollars, from $10 by card. $10 covers about 454 1K · low images with Grok Imagine Image 2.0 ($0.022 each). Turn on auto top-up if you don't want jobs to stop.

  3. 3

    Create the key

    Open Dashboard → API keys, name the key (e.g. “grok imagine-prod”) and copy it. Keys start with cg_live_, and the full key is shown only once.

  4. 4

    Store it as an environment variable

    Put it in CHEAPERGEN_API_KEY on your server or in your secrets manager — never in a browser bundle, mobile app or public repository.

  5. 5

    Call Grok Imagine Image 2.0

    Send the request below. It costs $0.022 (63% below the official $0.06) and returns a generation id you can poll or receive by webhook.

Your first Grok Imagine Image 2.0 request

curl -X POST https://cheapergen.com/api/v1/run/xai/grok-imagine-image/text-to-image \
  -H "Authorization: Bearer $CHEAPERGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "Fashion editorial: a model in a sculptural orange coat on a salt flat at noon, harsh shadows, medium format",
  "aspect_ratio": "1:1",
  "resolution": "1K",
  "quality": "medium"
}'

What the key unlocks

Grok Imagine Image 2.0 endpoints on your key

Every Grok Imagine Image 2.0 endpoint, with its starting price. The same key also runs the other 40 models.

Grok Imagine Image 2.0 endpoints available with one API key
TaskEndpointFrom
Text to ImagePOST /api/v1/run/xai/grok-imagine-image/text-to-image$0.022/image
Image EditPOST /api/v1/run/xai/grok-imagine-image/edit$0.022/image

Security

Keep your key safe

Anyone with the key can spend your balance. Details in the authentication docs.

Server-side only

Call the API from your backend. Never ship a key in a browser bundle, mobile app or public repository.

One key per app

Separate keys for production, staging and each integration let you revoke one without touching the others.

Rotate without downtime

Create a new key, deploy it, then revoke the old one. Revocation takes effect immediately.

Watch last-used times

The dashboard shows when each key was last used, so unused or unexpected keys stand out.

Compared

A Cheaper Gen. key vs a key from xAI

Cheaper Gen. API key compared with the official developer API
AspectCheaper Gen.xAI directly
Price$0.022/image at 1K · low$0.04/image (official list)
Models on one key41 models from 12 developersxAI models
BillingPrepaid USD credits, per use, failed runs refundedxAI's own billing
Same modelYes — official Grok Imagine Image 2.0Yes — official Grok Imagine Image 2.0

FAQ

Grok Imagine Image 2.0 API key questions

Creating a key is free, but generations are paid: there is no free tier. You add prepaid credits from $10, failed generations are refunded automatically, and the quote endpoint (POST /v1/quote/{endpoint}) prices any request for free before you run it. Grok Imagine Image 2.0 starts at $0.022/image.

The key itself costs nothing. You pay per generated image: Grok Imagine Image 2.0 costs $0.022/image at 1K · low, 45% below xAI's official $0.04/image. There is no subscription or monthly fee.

Yes. One Cheaper Gen. key works for all 41 models from 12 developers in the catalog — change the endpoint, keep the key and the balance.

The full key is shown once, when you create it. The dashboard keeps its name, prefix and last-used time; if you lose the key, create a new one and revoke the old one.

Revoke it in Dashboard → API keys — revocation takes effect immediately — then create a new key and deploy it. Use one key per app or environment so you can revoke one without touching the others.