X-AI Grok Imagine Image enables precise image editing with xAI's Grok Imagine model. Transform and modify images using text prompts with AI-powered precision. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Idle

$0.022per run·~45 / $1

3D character design, blind box toy style. A cute chibi girl wearing a fluffy dinosaur hoodie and oversized sneakers. She is sitting on a giant macaron. Soft clay texture, matte finish. Clean pastel color palette: mint green, baby pink, and cream. Studio lighting, soft shadows, 3D render, C4D, Octane render, high fidelity, 4k.

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 painting texture, intricate details, cinematic composition, gloomy atmosphere.

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, vibrant colors, shallow depth of field blurring the festive background. 85mm lens, culturally rich, masterpiece.
Grok Imagine Image is X-AI's text-to-image generation model that transforms text prompts into high-quality visuals. With extensive aspect ratio options and batch generation support, it delivers creative, detailed images for a wide range of applications.
Extensive aspect ratios 11 preset options including 2:1, 20:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, and 9:20.
Batch generation Generate up to 4 images in a single request for quick iteration.
Creative flexibility Excels at stylized content from 3D characters to photorealistic scenes.
Prompt Enhancer Built-in tool to automatically improve your prompts for better results.
Cost-effective Affordable per-image pricing for high-volume generation.
| Parameter | Required | Description |
|---|---|---|
| prompt | Yes | Text description of the image you want to generate |
| aspect_ratio | No | Output ratio: 2:1, 20:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:20 |
| num_images | No | Number of images to generate (1-4, default: 1) |
| Output | Cost |
|---|---|
| Per image | $0.022 |
Grab a WaveSpeedAI API key, then call POST https://api.wavespeed.ai/api/v3/x-ai/grok-imagine-image/text-to-image with your input as JSON. The endpoint returns a prediction id; poll the prediction endpoint until status flips to completed, then read the output URL from data.outputs[0]. Examples for Grok Imagine Image Text To Image below.
# Submit the prediction
curl -X POST "https://api.wavespeed.ai/api/v3/x-ai/grok-imagine-image/text-to-image" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $WAVESPEED_API_KEY" \
-d '{
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"aspect_ratio": "2:1",
"output_format": "jpeg"
}'
# Response includes a prediction id. Poll for the result:
curl -X GET "https://api.wavespeed.ai/api/v3/predictions/{request_id}/result" \
-H "Authorization: Bearer $WAVESPEED_API_KEY"
# When status is "completed", read the output from data.outputs[0].// npm install wavespeed
const WaveSpeed = require('wavespeed');
const client = new WaveSpeed(); // reads WAVESPEED_API_KEY from env
const result = await client.run("x-ai/grok-imagine-image/text-to-image", {
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"aspect_ratio": "2:1",
"output_format": "jpeg"
});
console.log(result.outputs[0]); // → URL of the generated output# pip install wavespeed
import wavespeed
output = wavespeed.run(
"x-ai/grok-imagine-image/text-to-image",
{
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"aspect_ratio": "2:1",
"output_format": "jpeg"
}
)
print(output["outputs"][0]) # → URL of the generated outputGrok Imagine Image Text To Image is a xAI model for image generation, exposed as a REST API on WaveSpeedAI. X-AI Grok Imagine Image enables precise image editing with xAI's Grok Imagine model. Transform and modify images using text prompts with AI-powered precision. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing. You can call it programmatically or try it from the playground above.
POST your input parameters to the model's REST endpoint (shown in the API tab of this playground) with your WaveSpeedAI API key in the Authorization header. Submission returns a prediction ID; poll the prediction endpoint until status flips to "completed", then read the output URL from the result. The playground generates a ready-to-paste code sample in Python, JavaScript, or cURL for whatever inputs you've set. Full request/response shape is documented at https://wavespeed.ai/docs/docs-api/x-ai/x-ai-grok-imagine-image-text-to-image.
Grok Imagine Image Text To Image starts at $0.022 per run. That figure is the base price — the final charge scales with the parameters you set in the form (output size, length, count, references, or whatever knobs this model exposes), so a higher-quality or larger output costs more than a minimal one. The exact cost for your current input is shown live next to the Generate button before you submit, and the actual per-call charge is recorded on the prediction afterwards.
Key inputs: `prompt`, `aspect_ratio`, `output_format`. The full JSON schema (types, defaults, allowed values) is rendered above the Generate button and mirrored in the API reference at https://wavespeed.ai/docs/docs-api/x-ai/x-ai-grok-imagine-image-text-to-image.
Average end-to-end generation time on WaveSpeedAI is around 7 seconds per request — measured across recent runs. Queue time scales with global demand; live status is visible in the prediction record.
Commercial usage rights depend on the model's license, set by its provider (xAI). The license summary appears on the model card above; see WaveSpeedAI's Terms of Service for platform-level conditions.