
01 · Social & video cover
A weekend travel magazine cover
Specify the exact title and the main scene, leave room for the headline, then check the title stays legible and clear of the traveler.
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.

Transparent pricing with no hidden fees. Pay only for what you use.
Featured examples
Pick an example to load the model, prompt and full settings, then adjust it your way.

01 · Social & video cover
Specify the exact title and the main scene, leave room for the headline, then check the title stays legible and clear of the traveler.

02 · Oil & watercolor art
Describe the subject, composition, palette, paper and brushwork to create an original watercolor, then check the washes, paper-white highlights and brush edges.

03 · Promo poster
Specify the exact lines of copy to render, then check the headline, discount badge and product art for hierarchy and exact spelling.
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; grok-imagine-2.0-ext accepts optional image_urls: an array of up to 5 public HTTP(S) reference image URLs, in selection order. Use an array even for one image. Omit image_urls for text-to-image (n=1–12). With references, use n=1 and omit resolution. 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
Switch between grok-imagine-2.0-ext and the official grok-imagine-image-2.0. The model selector changes the form, the pricing table and the generation history together.
grok-imagine-2.0-ext accepts optional image_urls: an array of up to 5 public HTTP(S) reference image URLs, in selection order. Use an array even for one image. Omit image_urls for text-to-image (n=1–12). With references, use n=1 and omit resolution.
grok-imagine-image-2.0 outputs 1K or 2K images and 1–10 images per request. For text to image you can pick low or medium quality; medium is the default.
Send one to three public image URLs in image_urls to the official model to edit an image or combine references. Each input image is billed once per request.
Ext offers 1:1, 2:3, 3:2, 3:4, 4:3, 9:16 and 16:9. The official model offers auto plus 13 ratios, including 1:2 and 2:1 for tall and wide layouts.
With Ext you can redraw a finished image in another aspect ratio, or select regions and describe a change. Region editing returns one image and is billed once per completed task, not per region.
Split a completed Ext image, or one uploaded image, into object layers at no charge. Use the layers to pick regions for editing.
Each request returns a task ID; poll the task endpoint until the status is completed or failed. Result URLs are kept for 72 hours, so save the images promptly.
Generate visual assets from text for common creative and product workflows
Turn campaign briefs into visual concepts for ads, landing pages, and promotional materials.
Create square, portrait, or widescreen imagery for posts, stories, thumbnails, and channel covers.
Generate text-directed product scenes and lifestyle concepts for creative exploration and merchandising drafts.
Produce multiple visual directions from written ideas to support mood boards, layouts, and early design reviews.
Create supporting visuals for articles, newsletters, presentations, and other text-led content.
Ext: Request several images in one task to review alternatives, while paying only for images delivered successfully.
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.
grok-imagine-2.0-ext accepts optional image_urls: an array of up to 5 public HTTP(S) reference image URLs, in selection order. Use an array even for one image. Omit image_urls for text-to-image (n=1–12). With references, use n=1 and omit resolution. 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. grok-imagine-2.0-ext accepts optional image_urls: an array of up to 5 public HTTP(S) reference image URLs, in selection order. Use an array even for one image. Omit image_urls for text-to-image (n=1–12). With references, use n=1 and omit resolution.
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. grok-imagine-2.0-ext accepts optional image_urls: an array of up to 5 public HTTP(S) reference image URLs, in selection order. Use an array even for one image. Omit image_urls for text-to-image (n=1–12). With references, use n=1 and omit resolution.
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. grok-imagine-2.0-ext accepts optional image_urls: an array of up to 5 public HTTP(S) reference image URLs, in selection order. Use an array even for one image. Omit image_urls for text-to-image (n=1–12). With references, use n=1 and omit resolution.
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.