Image generation

Grok Imagine Image 2.0

$0.04 per callimage.grok

Generate an original image from a text prompt using xAI Grok Imagine Image 2.0, or EDIT images you supply.

Send image_handles, image_urls or image_base64 to restyle, retouch or combine up to 5 reference images; send none and it generates from the prompt alone. Editing costs exactly what generating costs. Returns the URL of the generated image. That URL is temporary: Goro holds a run's results for 24 hours and nothing guarantees the file outlives that, so collect what you need within 24 hours.

What a call costs

Flat price, known before the call runs.

a price before every call. failed calls are never charged.

When to use it

Use when you want a photographic or cinematic look at the lowest price in the catalog, or a precise edit of an image you already have: a change of wardrobe, a background swap, typography placed into a scene, a reference transformed into a new composition. Follows instructions closely and renders text well. For the hardest edits and the best text, use image.nano_banana_pro.

Inputs

Grok Imagine Image 2.0 takes 5 fields, 1 of them required. Anything you leave out falls back to the tool's own default.

FieldTypeRequiredWhat it does
promptstringyesWhat to draw, or what to change. Describe subject, composition, style, lighting and mood; the more specific, the closer the result.
image_urlsarray of stringoptionalOptional. Public http or https links to the images to edit, combine or use as reference (JPEG, PNG or WEBP, up to 10 MB each, up to 5 of them). Use this when the images are ALREADY published somewhere; the output URL of any image endpoint works directly, which is what makes generate-then-edit a two-call sequence with nothing to upload in between. Nothing is copied or re-hosted, we pass the links on. For files that are not already public, use image_handles instead and they never have to be published anywhere. Send one of the three, never two.
aspect_ratiostringoptionalShape of the output image.
image_base64stringoptionalOptional, and only for ONE small image (under 3 MB) when you cannot run a shell command AND cannot ask the user to open a link. The image inline, as base64 of the file's own bytes; a data:image/png;base64, prefix is accepted and its declared type ignored. Only one image can arrive this way, because every inline image shares one request body. Understand the cost before choosing it: on an MCP call the request IS the tool arguments, which pass through the model's context window. A 3 MB photograph is 4 MB of base64, on the order of a million tokens, and in practice it is truncated and the run fails looking like file corruption. Do not downscale an image to fit here: use image_handles, which takes up to 10 MB per file and keeps them out of the conversation entirely. JPEG, PNG or WEBP, checked against the file's own leading bytes rather than against any type you declare. Send one of the three, never two.
image_handlesarray of stringoptionalOptional, and the RIGHT WAY to send local or private images to edit. Upload each file first with POST /v1/uploads (or the create_upload MCP tool, which also hands back a link a PERSON can open to pick the file on their own device, for when you have no shell) and put the short handles it returns here, in order. The files go straight from you to a private bucket: they never pass through a tool call, so they never pass through a model's context window, and up to 10 MB each is fine. Nothing is published. A handle is usable for 10 minutes after its upload lands and the file is deleted 30 minutes after that. Supplying any image makes this an edit rather than a generation, at exactly the same price. Up to 5 images, and the extras are free. Send one of image_handles, image_urls and image_base64, never two.

How to call it

Connect once and your agent can reach Grok Imagine Image 2.0 the same way it reaches everything else in the catalog. Add Goro as an MCP connector, or paste the setup line into an agent that reads skills.

MCP

Add this server in Claude, Claude Code, or any MCP client.

https://mcp.usegoro.ai/mcp

Skill

One line in your agent's chat. It sets itself up.

set up https://usegoro.ai/SKILL.md

Or plain HTTP

POST /v1/run

{
  "endpoint": "image.grok",
  "input": {
    "prompt": "A vintage espresso machine on a marble counter, morning window light, film grain.",
    "aspect_ratio": "1:1"
  }
}

Run Grok Imagine Image 2.0 from your agent.

One balance for every tool in the catalog. Start with Build, $25 of credit for $19 a month.

Get started