Grok Imagine Image 2 API and MCP for AI agents
TollNode gives Claude, Cursor or any AI agent Grok Imagine Image 2, xAI's image model for bold, detailed images at 1K or 2K, over API and MCP, from $0.082 per image, with no subscription.
Ask for 'A retro 1970s travel poster that reads VISIT MARS, a sleek...' and get a finished image link back in seconds.
No subscription · Sign-up optional · From $0.082 per call · Charged only when it works · No xAI account needed
Make this image: A retro 1970s travel poster that reads VISIT MARS, a sleek rocket over red dunes...
TollNode · xAI · 2k$0.109 · 1 image
| Result | Detail |
|---|---|
| File | 1 image link, does not expire |
| Resolution | 2k |
Real result, shown below.
Grok Imagine Image 2 examples
Made by this node in our own tests, from the request shown under each.

“A retro 1970s travel poster that reads VISIT MARS, a sleek rocket over red dunes and two moons, grainy print texture, bold typography”
The request that made it
Send the same body to get this kind of result. Change the prompt or the options to get your own.
{
"prompt": "A retro 1970s travel poster that reads VISIT MARS, a sleek rocket over red dunes and two moons, grainy print texture, bold typography",
"resolution": "2k",
"aspect_ratio": "2:3"
}What you control with Grok Imagine Image 2
Prompt and style
Grok Imagine Image 2 prompt to image
Describe the picture in plain words, including any text.
- Prompt
- A retro 1970s travel poster that reads VISIT MARS, a sleek rocket...
- Resolution
- 2k
- Aspect ratio
- 2:3
- Returns
- 1 image link
You get
- prompt: what to create, in plain words
- aspect_ratio: the shape of the result: 1:1 to 1:2
- from $0.082
Resolution and price
Grok Imagine Image 2 resolution options
Pick the option; the price follows it.
- Default
- 2k
- Options
- 1k, 2k
- Charged
- only when a result comes back
You get
- resolution: output size; sets the price; default 2k
- options: 1k, 2k
Failed calls are never charged. Image and audio links returned by TollNode don't expire.
What people ask their AI to do with it
Ecommerce sellers
Product photos without a shoot
“Make a studio photo of my ceramic mug on a marble counter in morning light”
2k
Cost today$0.109
Marketers
Ad and social images
“Create three portrait Instagram ad images for a coffee subscription, bold and bright”
3 × 2k
Cost today$0.327
Designers
Concept art and mockups
“Generate three packaging concepts for an oat milk brand, flat lay on a gray background”
3 × 2k
Cost today$0.327
Founders
Pitch deck visuals
“Draw a wide hero image of a delivery drone over a US suburb at sunset for my seed deck”
2k
Cost today$0.109
Content creators
Thumbnails and blog headers
“Make a wide YouTube thumbnail of me pointing at a glowing laptop with big bold text”
2 × 2k
Cost today$0.218
Educators
Diagrams and class visuals
“Illustrate the water cycle for fourth graders, labeled, clean flat style”
2k
Cost today$0.109
Use it as a Grok Imagine Image 2 MCP server in Claude, Cursor or Codex
Connect once. Then just ask.
Paste this into Claude Code, Cursor or Codex. It connects TollNode and gives your agent a small wallet. Add a few dollars of USDC and you're done.
npx agentcash add https://tollnode.comCopy for your AI agent
Paste this into your agent so it knows what this node does and how to call it.
You can use TollNode's Grok Imagine Image 2 node to make an image. Call POST https://tollnode.com/api/v1/nodes/grok-imagine-image-2 with prompt (required), resolution (optional), aspect_ratio (optional). The price depends on resolution (1k, 2k; default 2k) and is charged only when a result is returned. Over MCP, call the "grok-imagine-image-2" tool; use list_models to see prices. Give me the file link when it is done.Price
from $0.082
per image
The price depends on the resolution you choose. If you don't choose, you get 2k.
| 1k | $0.082 per image |
| 2kdefault | $0.109 per image |
Charged only when a call returns a result. Failed or empty calls cost $0.
Grok Imagine Image 2 without a xAI account
No subscription, no credit packs
Pay per image: $0.082 at 1k, $0.109 at 2k.
No xAI account, no quota form
Your agent calls TollNode. You never set up billing with the model's maker or request access.
Only charged when it works
If generation fails or returns nothing, the call costs nothing.
One connection, many image models
The same setup also gives your agent other models and live data tools, so it can compare results.
FAQ
- Is this the official xAI API?
- No. TollNode is an independent service. It gives your agent access to Grok Imagine Image 2 through its own API and MCP server, priced per image, with no xAI account needed.
- Can I use it as a Grok Imagine Image 2 MCP server in Claude?
- Yes. Add https://tollnode.com/mcp in Claude Code, Claude Desktop or Cursor, and the "grok-imagine-image-2" tool appears with its options and prices.
- What options can I choose?
- The resolution can be 1k or 2k; the default is 2k. The price follows the option you pick, shown in the price table above.
- What if nothing comes back?
- You're not charged. TollNode only collects payment when a usable result is returned.
- How long are the links valid?
- They don't expire. Download the file or keep the link.
- How do I pay for Grok Imagine Image 2?
- Your agent sends the request, gets an HTTP 402 with the exact price (from $0.082 per call), signs a USDC payment on Base and retries. Or use an account balance with an API key. Either way you are charged only when a result comes back.
- What does the Grok Imagine Image 2 response look like?
- A JSON object with a link to the finished file. The link does not expire, so you can download it later or keep the link.
Works well with
- Grok Imagine image generationAnother image model to compare on the same prompt$0.028
- Crisp image upscalerEnlarge the finished image for print$0.010
- Nano Banana Pro image generationA high-quality image model to comparefrom $0.204
- GPT Image 2 generation and editingOpenAI's image model, good with textfrom $0.018
Ready in a minute
Connect your AIFor developers: endpoint, inputs and an example response
POST https://tollnode.com/api/v1/nodes/grok-imagine-image-2
Input
| Field | Type | Notes |
|---|---|---|
| prompt* | string | What to create or change |
| resolution | enum | Output resolution; sets the price. Default 2k (1k, 2k) |
| aspect_ratio | enum | Aspect ratio, default 1:1 (1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2) |
Example response
{
"images": [
"https://tollnode.com/api/v1/files/00000000-0000-0000-0000-000000000000/0"
]
}Also described in the OpenAPI file and llms.txt. Setup for every app: Agents & MCP.