The Grok Imagine 2.0 API on APIMart gives you two ways to use xAI's Grok Imagine 2.0 image model: the low-cost grok-imagine-2.0-ext for text to image, ratio redraw, layers and region editing, and the official grok-imagine-image-2.0 for 1K or 2K text to image and editing with up to three reference images.
Service Highlights

Image link valid for 72 hours
Transparent pricing with no hidden fees. Pay only for what you use.
| Variant | Tier | GoldCurrent price | Platinum | Diamond | Official | Your savings |
|---|---|---|---|---|---|---|
grok-imagine-2.0-ext | Image upload | Free | Free | Free | — | — |
| Standard Generation | 0.15Credits(~$0.015)/pic | 0.1425Credits(~$0.0143)/pic | 0.135Credits(~$0.0135)/pic | 0.6Credits(~$0.06)/pic | 75% | |
| Region edit | 0.15Credits(~$0.015)/gen | 0.1425Credits(~$0.0143)/gen | 0.135Credits(~$0.0135)/gen | 0.1875Credits(~$0.0188)/gen | 20% | |
grok-imagine-image-2.0 | 1K low | 0.32Credits(~$0.032)/pic | 0.304Credits(~$0.0304)/pic | 0.288Credits(~$0.0288)/pic | 0.4Credits(~$0.04)/pic | 20% |
| 1K medium | 0.48Credits(~$0.048)/pic | 0.456Credits(~$0.0456)/pic | 0.432Credits(~$0.0432)/pic | 0.6Credits(~$0.06)/pic | 20% | |
| 2K low | 0.48Credits(~$0.048)/pic | 0.456Credits(~$0.0456)/pic | 0.432Credits(~$0.0432)/pic | 0.6Credits(~$0.06)/pic | 20% | |
| 2K medium | 0.64Credits(~$0.064)/pic | 0.608Credits(~$0.0608)/pic | 0.576Credits(~$0.0576)/pic | 0.8Credits(~$0.08)/pic | 20% | |
| Reference image (each) | 0.08Credits(~$0.008)/pic | 0.076Credits(~$0.0076)/pic | 0.072Credits(~$0.0072)/pic | 0.1Credits(~$0.01)/pic | 20% |
* Actual costs are subject to final output.
Call grok-imagine-image-2.0 on APIMart with one POST request. Generation is asynchronous: submit a task, then poll the task endpoint for the image URLs. The example uses the official grok-imagine-image-2.0; for Ext, set model to grok-imagine-2.0-ext with n up to 12 and no reference images. This code sends no X-APIMart-Response-Version header, so the submit response is HTTP 200 with data[0].task_id; the docs example sends that header and gets HTTP 202 with data.id.
Save the key you created above in the APIMART_API_KEY environment variable and send it as Authorization: Bearer <key> on every request.
POST /v1/images/generations with model grok-imagine-image-2.0, your prompt, aspect_ratio, resolution, quality and n. To edit, add image_urls and drop quality. The task ID is in data[0].task_id.
Poll GET /v1/tasks/{task_id} until status is completed, then read the image URL from data.result.images[0].url[0]. Results are kept for 72 hours. Failed tasks are not charged.
See the Grok Imagine 2.0 API reference for every parameter and response field.
curl -X POST https://api.apimart.ai/v1/images/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image-2.0",
"prompt": "Minimal product photography of a white ceramic cup on a stone surface, soft window light, clean background",
"n": 1,
"aspect_ratio": "16:9",
"resolution": "2k",
"quality": "medium"
}'import os
import time
import requests
API_BASE = "https://api.apimart.ai"
headers = {"Authorization": f"Bearer {os.environ['APIMART_API_KEY']}"}
# 1. Submit the generation task
payload = {
"model": "grok-imagine-image-2.0",
"prompt": "Minimal product photography of a white ceramic cup on a stone surface, soft window light, clean background",
"n": 1,
"aspect_ratio": "16:9",
"resolution": "2k",
"quality": "medium"
}
resp = requests.post(f"{API_BASE}/v1/images/generations", headers=headers, json=payload, timeout=60)
resp.raise_for_status()
task_id = resp.json()["data"][0]["task_id"]
# 2. Poll the task until it finishes
for _ in range(200):
task_resp = requests.get(f"{API_BASE}/v1/tasks/{task_id}", headers=headers, timeout=30)
task_resp.raise_for_status()
task = task_resp.json()["data"]
if task["status"] == "completed":
print(task["result"]["images"][0]["url"][0])
break
if task["status"] == "failed":
raise RuntimeError(task.get("error", {}).get("message", "generation failed"))
time.sleep(3)
else:
raise TimeoutError(f"task {task_id} did not finish in time; continue GET polling with this task ID")curl -X POST https://api.apimart.ai/v1/images/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image-2.0",
"prompt": "Place the product on a marble kitchen counter with morning light and keep the product unchanged",
"n": 1,
"image_urls": [
"https://example.com/product.png"
]
}'TASK_ID="task_xxx" # replace with the task_id returned by the POST request
curl "https://api.apimart.ai/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $APIMART_API_KEY"| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Required | Default: grok-imagine-image-2.0 | grok-imagine-image-2.0. The same model handles text to image and editing. |
prompt | string | Required | Default: — | Image description, or the edit instruction when image_urls is set. Up to 8,000 characters. |
aspect_ratio | string | Optional | Default: auto | Aspect ratio: auto, 1:1, 3:4, 4:3, 9:16, 16:9, 2:3, 3:2, 9:19.5, 19.5:9, 9:20, 20:9, 1:2, 2:1. |
resolution | string | Optional | Default: 1k | Output resolution: 1k or 2k. The price depends on resolution and quality. |
quality | string | Optional | Default: medium | Text to image only: low or medium. Do not send it when image_urls is present. |
n | integer | Optional | Default: 1 | Number of images, 1–10. |
image_urls | array | Optional | Default: — | Reference images for editing, 1–3 public HTTP(S) URLs. Omit the field for text to image. |
nsfw_check | boolean | Optional | Default: false | Set true to moderate the prompt and input images before the task is submitted. |
What the Ext and official models on this page support, based on APIMart's API documentation
Generate visual assets from text for common creative and product workflows
Set up access, submit a text-to-image task, and poll for the result
Sign in to APIMart or create an account to access the dashboard.
Top up your account balance before sending production generation requests.
Generate an API key, submit grok-imagine-image-2.0 (as in the example below) or grok-imagine-2.0-ext with a text prompt, and poll the returned task ID for image URLs.
Models, pricing, parameters and results for the Grok Imagine 2.0 API
It is API access to Grok Imagine 2.0, the image model xAI released on August 7, 2026. On APIMart this page offers two models: grok-imagine-2.0-ext for low-cost text to image with ratio redraw, layers and region editing, and the official grok-imagine-image-2.0 for 1K/2K text to image and reference-image editing.
Gold member prices in October 2026: Ext text to image $0.015 per image (list price $0.06) and region editing $0.015 per edit, with layer retrieval free. The official model costs $0.032 per image at 1K low, $0.048 at 1K medium or 2K low and $0.064 at 2K medium, plus $0.008 per reference image. Failed tasks are not charged; the pricing table shows live rates.
Ext is text to image only, returns 1–12 images per request at a fixed quality mode in seven ratios, and adds ratio redraw, layers and region editing. The official model supports 1K or 2K, low or medium quality, auto plus 13 ratios, 1–10 outputs and editing with up to three reference images.
Ext accepts any whole number n from 1 to 12, defaulting to 1. The official model accepts 1 to 10. Ratio redraw and region editing each return one image per request.
Ext supports 1:1, 2:3, 3:2, 3:4, 4:3, 9:16 and 16:9. The official model uses aspect_ratio with auto (the default) plus 13 ratios, including 1:2 and 2:1.
Ext uses the fixed resolution=quality mode, or you can omit the field. The official model accepts 1k or 2k (default 1k) and, for text to image, quality low or medium (default medium). Do not send quality when image_urls is present.
Yes. On the official model, add one to three public image URLs in image_urls with an editing instruction. On Ext, use ratio redraw to change a finished image's aspect ratio, or region editing to change selected areas.
Layer retrieval splits a completed Ext image, or one uploaded image, into object layers for free. Region editing takes the regions you select plus a prompt and returns one edited image, billed once per completed task regardless of how many regions you select.
Submit the request to /v1/images/generations, save the task ID and poll /v1/tasks/{task_id} until the status is completed. Read the image URLs from the result. Results are kept for 72 hours, so download them to your own storage.
Sign up for APIMart, open the API Keys page in your dashboard and create a key. The same key calls both Grok Imagine 2.0 models and every other model on the platform, with pay-as-you-go billing and no subscription.
Image generation is not free: there is no free quota, and billing is pay-as-you-go per image or edit. Layer retrieval is free, failed tasks are not charged, and members get 20% or more off every paid price.
No. Under APIMart's Terms of Service, your prompts and images are not used to train AI models or shared with third parties except as needed to provide the service.
Explore more models in the same category.

Qwen Image 3.0 Pro
Qwen Image 3.0 Pro is the Pro version of Qwen Image 3.0, with clear instruction following, stable bilingual text rendering, 1K/2K output and image editing with up to 3 references.

Qwen Image 3.0
Qwen Image 3.0 is Alibaba's image model for text-to-image and editing with 1–3 reference images. It offers stable bilingual text rendering and dense layouts, in standard and Pro versions at 1K or 2K, up to 6 images per request.

Flux 2 Max
FLUX.2 Max delivers the highest output quality in the FLUX.2 family for text-to-image and image editing, supporting up to 8 references and output up to 4 MP.

Nano banana
Nano Banana (gemini-2.5-flash-image-preview) is Google DeepMind's fast, conversational image generation and editing model. It delivers natural-language text-to-image, precise multi-turn edits, strong character consistency, and multi-image fusion at low latency.