About Grok Imagine Image 2.0
The Grok Imagine Image 2.0 API delivers xAI's fast image engine across text-to-image and multi-reference edit endpoints, averaging around 20 to 24 seconds per call. With a minimal parameter surface and flat per-image pricing, it drops cleanly into social creators, quick storyboard tools and automated campaign remix workflows.
Call it with the model name xai/grok-imagine-image-2.0/text-to-image on POST /jobs/createTask, from $0.028.
Introduction
Create a Grok Imagine Image 2.0 picture with a prompt and an optional aspect_ratio selection.
Key features
The text limit is 8,000 characters, and five shapes are offered at the same image rate.
Request parameters
| Parameter | Required | Description |
|---|---|---|
prompt | Yes | Describe what you want to make. |
aspect_ratio | No | The shape of the frame: wide, square or tall. 1:1 · 2:3 · 3:2 · 16:9 · 9:16 · Default: 1:1 |
Pricing
Prices are in USD and charged to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
| Option | USD per image |
|---|---|
| Standard | $0.028 |
Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.
Prompt guide & pro tips
Name the subject, its action and the desired view; the gardener example asks for a macro photo and shallow depth of field.
API quick start
Call the Grok Imagine Image 2.0 API in three steps
- Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls are billed in USD from your PopNow balance.
- Send the request. POST /jobs/createTask with model xai/grok-imagine-image-2.0/text-to-image and an input object that follows the parameter table. The response returns a task ID straight away.
- Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{
"model": "xai/grok-imagine-image-2.0/text-to-image",
"input": {
"prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
"aspect_ratio": "1:1"
}
}'
# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $POPNOW_API_KEY"Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.
What to build with the Grok Imagine Image 2.0 API
- Low-latency social post and flyer generators returning finished frames in roughly 20 seconds.
- Interactive scene-restaging widgets that flip daylight shots to night or winter snow in one call.
- Lightweight multi-image remix flows combining up to five uploaded references without complex tier logic.
Grok Imagine Image 2.0 parameter notes
- aspect_ratio accepts five values: 1:1, 2:3, 3:2, 16:9 and 9:16; pass the matching ratio on edits so the framing stays consistent.
- image_urls on edit accepts 1 to 5 source URLs; no resolution, seed or output_format options are exposed.
- Write decisive edit instructions (distinct lighting shifts, prop replacements or full weather swaps) because subtle micro-edits can under-trigger.
How Grok Imagine Image 2.0 API pricing adds up
Billed at a single flat per-image rate across both generation and editing with no resolution multipliers or extra per-reference fees. Call /jobs/quote to confirm current unit pricing programmatically.
- Create Image: $0.028 per run, $2.80 for 100 runs
Async jobs, webhooks and rate limits
Every Grok Imagine Image 2.0 request is asynchronous: createTask returns a taskId straight away, and the result arrives when the job finishes. Poll GET /jobs/recordInfo every few seconds, or pass a public https callBackUrl and verify the X-Webhook-Signature header (HMAC-SHA256 over taskId, timestamp and the body hash) before trusting the payload. Each account gets 1,000 write requests per 10 seconds; a 429 carries Retry-After. Send an Idempotency-Key with createTask so a retried request for xai/grok-imagine-image-2.0/text-to-image never runs or bills twice.
Common Grok Imagine Image 2.0 API errors
| errorCode | What it usually means and how to fix it |
|---|---|
invalid_request | Ensure aspect_ratio is one of the five supported presets and image_urls has between 1 and 5 valid URLs. |
content_rejected | xAI moderation refused the prompt or source image. Return the error string to the user and do not retry verbatim. |
invalid_asset | One of the image_urls failed to fetch or exceeded upstream size limits; host assets on a public CDN or PopNow upload URL. |
Examples
Grok Imagine Image 2.0 API questions
How much does the Grok Imagine Image 2.0 API cost?
Grok Imagine Image 2.0 starts at $0.028 per image with Create Image, its lowest-priced task. API usage is charged in USD to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
What is the model name for Grok Imagine Image 2.0 in the API?
Put xai/grok-imagine-image-2.0/text-to-image for Create Image; xai/grok-imagine-image-2.0/edit for Edit Image in the model field of POST /jobs/createTask.
What is the typical API latency for Grok Imagine Image 2.0?
Both text-to-image and edit jobs typically complete in 20 to 25 seconds, making it one of the fastest general-purpose image APIs on PopNow.
Does Grok Imagine Image 2.0 accept a seed or resolution parameter?
No. Keep request payloads strictly to prompt, aspect_ratio and (for edits) image_urls; additional fields fail schema validation.
How many source photos can an edit call combine?
Up to five images per edit request, billed at the same flat rate as a single-image edit.
What are the limits of the Grok Imagine Image 2.0 API?
Aspect ratios: 1:1 · 2:3 · 3:2 · 16:9 · 9:16; Prompt length (characters): 8,000. Requests outside these limits are rejected before anything is charged.
Can I try Grok Imagine Image 2.0 without writing code?
Run Grok Imagine Image 2.0 in the Playground without an API key, using the same PopNow balance as the website, shown in USD. Each run appears in your developer history with its matching code.
All Grok models
Nano Banana 2.1 goes up to 4K and takes up to fourteen references. Grok Imagine Image 2.0 costs less per picture for posters and quick edits.
- Grok Imagine Image 2.0 APIxAI's image model for text-to-image and edits from up to five picturesFrom $0.028 per image
- Grok Imagine Video 1.5 API1 to 15-second clips with sound and spoken lines, timed keyframes and seamless loopsFrom $0.14 for a 5-second clip
- Grok STT APITranscripts with word timings in 25 languagesFrom $0.000033334 per second
- Grok TTS API71 voices across 20 languages with speech tagsFrom $0.018 per 1,000 characters

