by xAI

Edit Image

xai/grok-imagine-image-2.0/edit
  • Up to 5 reference images
  • 5 aspect ratios
  • Create Image
  • Edit Image

About Grok Imagine Image 2.0

Grok Imagine Image 2.0 is xAI's image model, released in August 2026 with a focus on layout and lettering. It makes a picture from a prompt in five shapes (square, 2:3, 3:2, 16:9 and 9:16) and edits with one to five source pictures, at one price per picture.

Call it with the model name xai/grok-imagine-image-2.0/edit on POST /jobs/createTask, from $0.028.

Introduction

Send image_urls with an instruction to edit existing pictures using Grok Imagine Image 2.0.

Key features

One to five inputs can guide an edit, with the same five aspect ratios used for generation.

Request parameters

ParameterRequiredDescription
aspect_ratioNoThe shape of the frame: wide, square or tall. 1:1 · 2:3 · 3:2 · 16:9 · 9:16 · Default: 1:1
image_urlsYesPhotos to edit or combine. Say in the prompt what each one adds.
promptYesDescribe what you want to make.

Pricing

Prices are in USD and charged to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your API 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.

OptionUSD 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.

Use cases

A packaging concept can change a tin label while requesting that its lid, table and lighting stay in place.

Prompt guide & pro tips

Call sources Image 1 and Image 2 when needed, then separate the desired change from the details you want preserved.

API quick start

Call the Grok Imagine Image 2.0 API in three steps

  1. 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.
  2. Send the request. POST /jobs/createTask with model xai/grok-imagine-image-2.0/edit and an input object that follows the parameter table. The response returns a task ID straight away.
  3. 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/edit",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
    "image_urls": [
      "https://media.popnow.ai/influencer/examples/marco.webp"
    ],
    "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.

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 Edit 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 API 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 are the limits of the Grok Imagine Image 2.0 · Edit Image API?

Aspect ratios: 1:1 · 2:3 · 3:2 · 16:9 · 9:16; Reference images: 5; Prompt length (characters): 8,000; Largest upload: 10 MB. Requests outside these limits are rejected before anything is charged.

More about Grok Imagine Image 2.0