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

ParameterTypeDescription
promptstringText description of the image to generate
nintegerNumber of images (1–4, default 1)
aspect_ratiostringOutput shape such as 1:1, 16:9, or 9:16
resolutionstring1k or 2k
response_formatstringurl or b64_json