We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.

xAI: Grok Imagine Image 2.0

x-ai/grok-imagine-image-2.0
ImageInput: text · image66KAdded Aug 11, 2026

Try xAI: Grok Imagine Image 2.0 now

Runs on your balance at the prices above. New accounts start with free usage.

Sign in to use thisCreate free account
Results will appear here.
5 of 5 free messages left today. A free account adds free usage and an API key.Create free accountSign inSession cost $0.00

xAI: Grok Imagine Image 2.0 at a glance

  • Context window of 65,536 tokens, enough for long documents and multi-turn conversations.

About xAI: Grok Imagine Image 2.0

Grok Imagine Image 2.0 is an image generation and editing model from xAI, listed on api14 under the model id x-ai/grok-imagine-image-2.0. It sits in the image category and is built for two related jobs: creating images from text prompts and editing images from references. If you already route other xAI models through your stack, this one extends that line into visual output rather than text.

The model accepts text and image inputs and returns images. It has a context length of 65536 tokens and a maximum output of 58982 tokens. Generation is controlled through image parameters: resolution can be set to 1K or 2K, quality can be low or medium, and aspect ratio supports a wide set of values including 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 and auto. The n parameter accepts a value from 1 to 1, so each request produces a single image. Input references accept from 0 to 3 images, which is what makes reference based editing possible alongside plain text to image work.

Those capabilities point to a few practical patterns. A text prompt with no references covers straightforward generation, such as producing a single asset at a chosen aspect ratio and resolution. Supplying one to three input references shifts the model into editing and variation territory, where you guide the result from existing images rather than describing everything from scratch. The aspect ratio list is broad enough to cover square, portrait, landscape and tall or wide formats, so you can target specific placements without post processing crops. The low and medium quality settings let you choose between faster drafts and more finished output within the same model.

You call it through api14's OpenAI-compatible API using the model id x-ai/grok-imagine-image-2.0. The supported request parameters are logprobs, max_tokens, response_format, seed, temperature, top_logprobs and top_p. The seed parameter is useful when you want reproducible output across runs, and temperature and top_p give you control over how much variation you get between calls. Because the interface follows the OpenAI format, you can point existing client libraries at api14 and change the model id rather than rewriting your integration.

A few constraints are worth noting before you commit. Output is images only, so if you need text back from the same call, this is not the model for that. Each request returns exactly one image, so batch style workflows need multiple calls. Input references cap at three, which limits how much visual context you can supply for an edit. If your task is text generation or analysis rather than image creation and editing, a text model on api14 will fit better.

How to call the xAI: Grok Imagine Image 2.0 API

  1. Create an API key in your dashboard.
  2. Install the official openai SDK for your language.
  3. Set baseURL to https://api14.com/api/v1 and model to "x-ai/grok-imagine-image-2.0".
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api14.com/api/v1",
  apiKey: process.env.API14_API_KEY,
});

const result = await client.images.generate({
  "model": "x-ai/grok-imagine-image-2.0",
  "prompt": "A minimalist product photo of a ceramic mug on a wooden table",
  "n": 1,
  "aspect_ratio": "1:1"
});
import { writeFile } from "node:fs/promises";
await writeFile("image.png", Buffer.from(result.data[0].b64_json, "base64"));

Supported parameters

logprobsmax_tokensresponse_formatseedtemperaturetop_logprobstop_p

Specifications

Context length
65,536
Max output
58,982
Input
text, image
Output
image

Requests on api14 · last 7 days

10-1610-1710-1810-1910-2010-2110-22

xAI: Grok Imagine Image 2.0: frequently asked questions

How much does the xAI: Grok Imagine Image 2.0 API cost?
xAI: Grok Imagine Image 2.0 costs Image output $0.14 / image. It is charged from your USD balance only for successful requests; failed requests are free.
What is the context window of xAI: Grok Imagine Image 2.0?
xAI: Grok Imagine Image 2.0 reads up to 65,536 tokens per request: prompt, history and documents together. It writes up to 58,982 output tokens per response.
What can xAI: Grok Imagine Image 2.0 do?
xAI: Grok Imagine Image 2.0 accepts text, image and returns image.
How do I call xAI: Grok Imagine Image 2.0 from my code?
Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "x-ai/grok-imagine-image-2.0". No other code changes. Copy a ready example from the code panel on this page.
What are alternatives to xAI: Grok Imagine Image 2.0?
Comparable Image models at a similar price: Recraft: Recraft V4 Styles Vector, ByteDance Seed: Seedream 5.0 Pro, Qwen: Qwen Image 2.1 Pro. Each runs through the same API key, so switching is one string.

xAI: Grok Imagine Image 2.0 community

New topic

This community has no topics yet. Open the first one about xAI: Grok Imagine Image 2.0.