# Grok Grok 4 Image — Text To Image > Try grok-4-image on GPT Proto. This multimodal model excels at visual analysis and reasoning, with capabilities extending to future text to image generation. ## Overview - **Endpoint**: `POST https://gptproto.com/v1/images/generations` - **Model ID**: `grok-4-image` - **Vendor**: Grok - **Scene**: `text-to-image` - **Category**: text-to-image - **Modalities**: input text → output image - **Model page**: https://gptproto.com/model/grok/grok-4-image - **API documentation**: https://docs.gptproto.com/docs/allapi/Grok/grok-4-image/openai-format/text-to-image ## 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.042 per run Price range: $0.042 – $0.042 per generation. Prices may change. The model page always shows the live price: https://gptproto.com/model/grok/grok-4-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-4-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-4-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-4-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-4-image", prompt: "a cat.", n: 1, }), }); const data = await response.json(); console.log(data); ``` ## Example Prompts - Cinematic aerial shot of a colossal biomechanical city-ship drifting through a nebula at golden hour, intricate organic-metallic architecture covered in bioluminescent veins, massive translucent wings made of light, thousands of tiny ships swarming like fireflies, warm rim lighti… - Cinematic portrait of a woman sitting by a vinyl record player, retro living room background, soft ambient lighting, warm earthy tones, nostalgic 1970s wardrobe, reflective mood, gentle film grain texture, shallow depth of field, vintage editorial photography style. - Hyper-realistic classical oil painting portrait of a 24-year-old East Asian woman with porcelain skin and subtle freckles, wearing 18th century European aristocratic attire with intricate lace and pearls, soft Rembrandt lighting, dramatic chiaroscuro, individual strands of hair,… ## 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-4-image) - [API documentation](https://docs.gptproto.com/docs/allapi/Grok/grok-4-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`