The Grok Imagine API on APIMart gives you xAI's standard image model, grok-imagine-image: text to image and natural-language editing with up to five reference images, 1K or 2K output, auto plus 13 aspect ratios and 1–10 images per request.
74 / 8000

Transparent pricing with no hidden fees. Pay only for what you use.
| Variant | Tier | GoldCurrent price | Platinum | Diamond | Official | Your savings |
|---|---|---|---|---|---|---|
grok-imagine-image | 1K | 0.16Credits(~$0.016)/pic | 0.152Credits(~$0.0152)/pic | 0.144Credits(~$0.0144)/pic | 0.2Credits(~$0.02)/pic | 20% |
| 2K | 0.16Credits(~$0.016)/pic | 0.152Credits(~$0.0152)/pic | 0.144Credits(~$0.0144)/pic | 0.2Credits(~$0.02)/pic | 20% | |
| Reference image (each) | 0.016Credits(~$0.0016)/pic | 0.0152Credits(~$0.0015)/pic | 0.0144Credits(~$0.0014)/pic | 0.02Credits(~$0.002)/pic | 20% |
* Actual costs are subject to final output.
What grok-imagine-image supports on APIMart, based on APIMart's API documentation
Follow these simple steps to start generating images with Grok Imagine
Create your free APIMart account to access Grok Imagine API.
Top up your account balance to use Grok Imagine.
Create an API key for Grok Imagine in your dashboard.
Call grok-imagine-image on APIMart with one POST request. Generation is asynchronous: submit a task, then poll the task endpoint for the image URLs. 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, your prompt, aspect_ratio, resolution and n. Add image_urls to edit an image, and do not send a quality field. 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 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",
"prompt": "Minimal product photography of a white ceramic cup on a stone surface, soft window light, clean background",
"n": 1,
"aspect_ratio": "1:1",
"resolution": "2k"
}'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",
"prompt": "Minimal product photography of a white ceramic cup on a stone surface, soft window light, clean background",
"n": 1,
"aspect_ratio": "1:1",
"resolution": "2k"
}
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")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",
"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 | grok-imagine-image. 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. Both cost the same per image on APIMart. |
n | integer | Optional | Default: 1 | Number of images, 1–10. |
image_urls | array | Optional | Default: — | Reference images for editing, 1–5 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. |
“Grok Imagine delivers photorealistic quality that honestly surprised me. The color accuracy and texture detail are exceptional — we use it daily for product campaign visuals.”
Alex Chen
Creative Director at DesignWorks
“The edit model is a game-changer. I just describe what needs changing in plain text and grok-imagine-1.5-edit-apimart handles it cleanly. No more fiddling with masks in Photoshop.”
Sarah Mitchell
UI/UX Designer
“The prompt interpretation is incredibly nuanced. Grok Imagine picks up on subtle stylistic cues that other models miss entirely. My clients are constantly asking how I generate these so fast.”
Marcus Weber
Freelance Illustrator
“APIMart's pricing for Grok Imagine is unbeatable. We generate hundreds of product visuals per week and the cost is a fraction of what we paid before.”
Emma Rodriguez
Marketing Manager
“The two-parameter API is refreshingly simple. I integrated Grok Imagine into our platform in under an hour. The reliability via APIMart is rock solid.”
James Liu
Full-Stack Developer
“We switched to Grok Imagine for all our campaign concepting. The speed-to-quality ratio is the best we've found, and the APIMart pricing makes scaling completely viable.”
Sophie Anderson
Art Director at AdVision
Models, pricing, parameters and results for the Grok Imagine API on APIMart
The Grok Imagine API is xAI's API for Grok Imagine image and video generation, which xAI announced on January 28, 2026. This page covers the standard image model, grok-imagine-image, for text to image and image editing. Video generation is on the Grok Imagine Video pages.
xAI lists grok-imagine-image at $0.02 per image. In October 2026, APIMart Gold members paid $0.016 per output image at 1K or 2K, plus $0.0016 per reference image; Platinum and Diamond members save up to 28%. Failed tasks are not charged. The pricing table shows live rates.
model and prompt are required; the prompt can be up to 8,000 characters. Optional fields are n (1–10, default 1), aspect_ratio (default auto), resolution (1k or 2k, default 1k), image_urls (1–5 images) and nsfw_check. Do not send a quality field.
Yes. Add one public HTTP(S) image URL to image_urls with an editing instruction to edit that image, or up to five URLs to combine references. Omit image_urls for text to image. Upload local files with POST /v1/uploads/images first.
aspect_ratio accepts 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, with auto as the default. resolution accepts 1k or 2k. On APIMart, 1K and 2K have the same per-image price.
Set n from 1 to 10. Each output image is billed, so the output cost scales with n. Reference images are billed once per input per request; they are not multiplied by n.
Both use the same parameters, 1K or 2K output and up to 10 images per request. grok-imagine-image accepts up to five reference images and costs less; grok-imagine-image-quality accepts up to three and is priced higher (xAI lists it at $0.05 per image). Each model has its own page and pricing on APIMart.
Grok Imagine 2.0 is the newer xAI image model, released on August 7, 2026, and adds low or medium quality settings. Use grok-imagine-image when you want up to five reference images at the lowest official per-image price, and compare Grok Imagine 2.0 on its own page.
Send the request to POST /v1/images/generations, save the task ID and poll GET /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 the Grok Imagine API and every other model on the platform, with pay-as-you-go billing and no subscription.
No. There is no free quota for the Grok Imagine API on APIMart. Billing is pay-as-you-go per image: failed tasks are not charged, and members get 20% or more off every 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.

Hy Image V3.5 Preview
HY Image 3.5 Preview is an image generation and editing model developed by Tencent Hunyuan. It supports text-to-image creation, reference-based generation, and multi-turn editing, allowing users to refine images through conversational instructions. With support for up to 4K output and flexible image dimensions, it offers a versatile tool for creating and refining visual content.

Flux 3 Image Klein
FLUX 3 Image Klein is a compact, open-weight image generation and editing model developed by Black Forest Labs. It combines text-to-image creation, image editing, and composition using up to 10 reference images in a single model. With support for up to 4K resolution and bounding-box layout control, it gives creators flexible tools to bring their ideas to life.

Mai Image 2.6
MAI-Image-2.6 is Microsoft's image model for text-to-image, single-image editing and composition with up to 5 reference images. It is available in high-quality and Flash versions, with 1K and 2K output and sharp text rendering.

Mai Image 2.6 Flash
MAI-Image-2.6 Flash is the Flash version of Microsoft MAI-Image-2.6 for text-to-image and image editing with up to 5 references, 1K/2K PNG output and optional Bing grounding, billed by actual token usage.