All models


Grok Imagine Image
xai/grok-imagine-image
xAI Image GenerationImage EditingMultimodal
xAI's Grok Imagine image model. Generates and edits images from text and reference-image inputs with configurable aspect ratio and resolution.
Quick start
# Inspect the price — a plain request returns the 402 challenge:
curl -i https://api.glianalabs.com/v1/infer \
-H "content-type: application/json" \
-d '{
"model": "xai/grok-imagine-image",
"prompt": "<your prompt>"
}'
# Pay + run in one step with the mppx CLI (create a wallet: npx mppx account create):
npx mppx https://api.glianalabs.com/v1/infer \
-J '{"model": "xai/grok-imagine-image", "prompt": "<your prompt>"}'Examples



Parameters
Input
prompt string required
Text prompt describing what to generate.
aspect_ratio string optional
Output aspect ratio (e.g. 16:9, 1:1, 9:16).
image object optional
Input image (HTTPS URL or upload) to guide or edit from.
images array optional
Reference images to guide generation.
mask object optional
Mask image marking the region to edit (inpaint).
n integer optional
How many outputs to generate.
quality string optional
Output quality level.
resolution string optional
Output resolution / quality tier.
response_format string optional default: "b64_json"
How the result is returned (e.g. a URL or base64 data).
user string optional
Optional end-user identifier for abuse monitoring; not required.
Output
image: string