APIMart
Grok Imagine Image model icon
Image

Grok Imagine Image API

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.

Image GenerationImage EditingText to Image

Service Highlights

  • Official Discounts
  • Pay-as-you-go
  • Fast & Low Latency
Input

74 / 8000

Output
Model preview

Grok Imagine Image API Pricing

Transparent pricing with no hidden fees. Pay only for what you use.

VariantTierGoldCurrent pricePlatinumDiamondOfficialYour savings
grok-imagine-image1K0.16Credits(~$0.016)/pic0.152Credits(~$0.0152)/pic0.144Credits(~$0.0144)/pic0.2Credits(~$0.02)/pic20%
2K0.16Credits(~$0.016)/pic0.152Credits(~$0.0152)/pic0.144Credits(~$0.0144)/pic0.2Credits(~$0.02)/pic20%
Reference image (each)0.016Credits(~$0.0016)/pic0.0152Credits(~$0.0015)/pic0.0144Credits(~$0.0014)/pic0.02Credits(~$0.002)/pic20%

* Actual costs are subject to final output.

Grok Imagine API Features

What grok-imagine-image supports on APIMart, based on APIMart's API documentation

Text to Image

Send a prompt of up to 8,000 characters without image_urls to generate 1 to 10 images in one task.

Editing with Up to 5 Reference Images

Put one image in image_urls to edit it with a plain-language instruction, or several to combine references. No masks are needed.

1K or 2K at the Same Price

Set resolution to 1k or 2k; the default is 1k. On APIMart both resolutions cost the same per image.

Auto plus 13 Aspect Ratios

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. The default is auto.

Low Per-Image Price

xAI lists grok-imagine-image at $0.02 per image. On APIMart, Gold members pay $0.016 per image and $0.0016 per reference image (October 2026).

Optional Moderation

Set nsfw_check to true to review the prompt and input images before the task is submitted. Leave it off to skip the extra check and its latency.

Asynchronous Tasks, 72-Hour Results

Each request returns a task ID; poll the task endpoint until the status is completed or failed. Results are kept for 72 hours, so save the images promptly.

One Key for the Grok Imagine Family

The same API key calls Grok Imagine 2.0, Grok Imagine Image Quality, Grok Imagine 1.5 Ext and the Grok Imagine Video models. Switch models by changing the model ID.

Grok Imagine Use Cases

Design & Branding

Create logos, mockups, and brand identity assets. Grok Imagine produces crisp, detailed visuals that match brand guidelines precisely.

Advertising & Marketing

Generate photorealistic product shots, lifestyle images, and campaign visuals with grok-imagine-image for professional marketing materials.

Digital Art & Illustration

Bring creative concepts to life with Grok Imagine's nuanced prompt interpretation. From photorealism to stylized art, the model adapts to your vision.

Image Editing & Retouching

Use grok-imagine-image to naturally modify existing images — change backgrounds, remove objects, adjust lighting, or alter styles with text instructions.

UI/UX & Web Mockups

Generate interface designs, splash screens, and hero images for web and mobile projects. Fast iteration keeps creative workflows moving.

App & Platform Integration

Embed Grok Imagine into apps and platforms to enable dynamic image generation. Only model and prompt are required, and the API example below has copy-ready cURL and Python code.

Getting Started with Grok Imagine

Follow these simple steps to start generating images with Grok Imagine

1

Sign up

Create your free APIMart account to access Grok Imagine API.

2

Add funds

Top up your account balance to use Grok Imagine.

3

Generate your API key

Create an API key for Grok Imagine in your dashboard.

Grok Imagine API Example: Text to Image and Image Editing

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.

  1. 1

    Authenticate Grok Imagine API requests

    Save the key you created above in the APIMART_API_KEY environment variable and send it as Authorization: Bearer <key> on every request.

  2. 2

    Submit a grok-imagine-image task

    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.

  3. 3

    Get the Grok Imagine result

    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.

POST /v1/images/generations
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"
  }'

Grok Imagine API Parameters

ParameterTypeRequiredDefaultDescription
modelstringRequiredDefault: grok-imagine-imagegrok-imagine-image. The same model handles text to image and editing.
promptstringRequiredDefault: —Image description, or the edit instruction when image_urls is set. Up to 8,000 characters.
aspect_ratiostringOptionalDefault: autoAspect 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.
resolutionstringOptionalDefault: 1kOutput resolution: 1k or 2k. Both cost the same per image on APIMart.
nintegerOptionalDefault: 1Number of images, 1–10.
image_urlsarrayOptionalDefault: —Reference images for editing, 1–5 public HTTP(S) URLs. Omit the field for text to image.
nsfw_checkbooleanOptionalDefault: falseSet true to moderate the prompt and input images before the task is submitted.

Grok Imagine Customer Stories

“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

Grok Imagine API FAQ

Models, pricing, parameters and results for the Grok Imagine API on APIMart

What is the Grok Imagine API?

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.

How much does the Grok Imagine API cost on APIMart?

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.

What parameters does grok-imagine-image accept?

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.

Can the Grok Imagine API edit images?

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.

Which aspect ratios and resolutions are supported?

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.

How many images can one request generate, and how are they billed?

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.

grok-imagine-image vs grok-imagine-image-quality: what is the difference?

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 vs Grok Imagine 2.0: which should I use?

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.

How do I get the generated images?

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.

How do I get a Grok Imagine API key?

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.

Is the Grok Imagine API free?

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.

Is my data used to train AI models?

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.