Image Generation
Generate images from text prompts using the Grok image model.
CLI
progrok image "a sunset over a cyberpunk city" API
curl -X POST http://localhost:18645/v1/images/generations -H 'Authorization: Bearer anything' -H 'Content-Type: application/json' -d '{
"model": "grok-imagine-image",
"prompt": "a sunset over a cyberpunk city",
"n": 1,
"aspect_ratio": "1:1",
"resolution": "1k"
}' Parameters
| Parameter | Type | Description |
|---|---|---|
| prompt | string | Text description of the image to generate |
| n | integer | Number of images (1–4, default 1) |
| aspect_ratio | string | Output shape such as 1:1, 16:9, or 9:16 |
| resolution | string | 1k or 2k |
| response_format | string | url or b64_json |