# Grok Grok Imagine Image — Text To Image > Master grok-imagine-image/text-to-image on GPT Proto. Generate hyper-realistic visuals and precise text-in-image renders with xAI's premier model. ## Overview - **Endpoint**: `POST https://gptproto.com/v1/images/generations` - **Model ID**: `grok-imagine-image` - **Vendor**: Grok - **Scene**: `text-to-image` - **Category**: text-to-image - **Modalities**: input text → output image - **Model page**: https://gptproto.com/model/grok/grok-imagine-image - **API documentation**: https://docs.gptproto.com/docs/allapi/Grok/grok-imagine-image/openai-format/text-to-image - **Other scenes of this model**: `image-edit` — same auth, different endpoint path and input schema ## Authentication Every request needs a GPTProto API key. Create one at https://gptproto.com/dashboard/api-key, then export it: ```bash export GPTPROTO_API_KEY="your-api-key" ``` Header: `Authorization: Bearer $GPTPROTO_API_KEY`. ## Pricing Platform price by tier (USD, already includes the GPTProto discount): - **Per run** — $0.012 per run Price range: $0.012 – $0.012 per generation. Prices may change. The model page always shows the live price: https://gptproto.com/model/grok/grok-imagine-image ## API Information The examples below use this model's official request format from the model page. Copy them as-is and replace the API key placeholder. ### Input Schema The accepted JSON body is the official request shape below: **Full Example**: ```json { "model": "grok-imagine-image", "prompt": "a cat.", "n": 1 } ``` ## Usage Examples ### 1. Submit a request ```bash curl --request POST "https://gptproto.com/v1/images/generations" \ --header "Authorization: Bearer $GPTPROTO_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "model": "grok-imagine-image", "prompt": "a cat.", "n": 1 }' ``` ```python import os import requests url = "https://gptproto.com/v1/images/generations" headers = { "Authorization": f"Bearer {os.environ['GPTPROTO_API_KEY']}", "Content-Type": "application/json" } payload = { "model": "grok-imagine-image", "prompt": "a cat.", "n": 1 } response = requests.request("POST", url, headers=headers, json=payload) print(response.json()) ``` ```typescript const response = await fetch("https://gptproto.com/v1/images/generations", { method: "POST", headers: { "Authorization": `Bearer ${process.env.GPTPROTO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ model: "grok-imagine-image", prompt: "a cat.", n: 1, }), }); const data = await response.json(); console.log(data); ``` ## Example Prompts - Dramatic panoramic view of Shanghai Bund 200 years after apocalypse, iconic skyline completely overtaken by massive glowing mushrooms and vines, Oriental Pearl Tower wrapped in bioluminescent flora, aurora borealis in the sky, abandoned ships floating in the Huangpu River covered… - Cinematic portrait of a stunning Indian woman in a traditional red Saree with gold embroidery. She is wearing intricate bridal jewelry (nose ring, heavy necklace). Her hands are decorated with detailed Henna (Mehndi) patterns. Warm, golden lighting illuminates her face. Rich, vib… - Dark fantasy concept art. A fallen knight in rusted, ornate armor kneeling in a ruined gothic cathedral. A massive, glowing red rune floats in the air above him. Fog rolls across the floor. Dramatic, high-contrast lighting. Shadows hide terrifying creatures in the corners. Oil pa… ## HTTP Status Codes - `400` — malformed body, a parameter or value this model does not accept, or input blocked by the provider's content moderation - `401` — missing or invalid API key - `403` — insufficient credits - `413` — request body too large - `429` — rate limited; retry with backoff - `500` — An internal server error occurred - `502` — An internal server error occurred - `504` — Gateway timeout — upstream service did not respond in time; retry later ## Additional Resources - [Model page](https://gptproto.com/model/grok/grok-imagine-image) - [API documentation](https://docs.gptproto.com/docs/allapi/Grok/grok-imagine-image/openai-format/text-to-image) - [All models](https://gptproto.com/model) - [API keys](https://gptproto.com/dashboard/api-key) - [Platform overview for LLMs](https://gptproto.com/llm-full.txt) - Any other model: `https://gptproto.com/model/{vendor}/{model}/{scene}/llms.txt`