← All articles

Grok Imagine API and MCP: how to add image generation to your project

A glowing spiral with abstract frames

Grok Imagine is a family of image generation models. NeuralSpace offers the following models: Grok Imagine 1, Grok Imagine 2. They all run through a single public API, and there is a ready MCP server for AI agents. The key is issued on the API keys page. Below are the model capabilities, request examples and setup steps.

What Grok Imagine can do

Grok Imagine generates images from text with a single price per image. Both versions — Imagine 1 and Imagine 2 — support references (image-to-image), so you can pass a source image and ask the model to rework it.

API endpoint

Send a request to POST /v1/images/generations. Example: {"model": "grok-imagine-image-2", "prompt": "a futuristic city"}. Authorization uses an API key in the x-api-key header. Available model ids: grok-image, grok-imagine-image-2.

A glowing spiral with frames

MCP tools

The NeuralSpace MCP server is available at POST /mcp (Streamable HTTP). To work with Grok Imagine, an agent uses the tools: generate_image, list_models, get_balance. This lets Claude Code, Cursor and other MCP clients use the site models directly.

How to connect

Sign up on NeuralSpace, open the API keys page and create an nsk-… key. Then pass it in the request header or in your MCP client settings. Full documentation is on the the /v1/docs page.

FAQ

Does it support references?

Yes, both versions support image-to-image via image_urls.

What is the price per image?

A single price per image, independent of resolution.

What format is the request?

POST /v1/images/generations with model and prompt fields.