All models
Grok Imagine Image 2 0
xai/grok-imagine-image-2.0
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-2.0",
"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-2.0", "prompt": "<your prompt>"}'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. Pass a public URL; to use a local file, upload it (free) via POST /v1/media (≤40MB) and pass the returned url.
images array optional
Reference images to guide generation. Pass a public URL; to use a local file, upload it (free) via POST /v1/media (≤40MB) and pass the returned url.
mask object optional
Mask image marking the region to edit (inpaint). Pass a public URL; to use a local file, upload it (free) via POST /v1/media (≤40MB) and pass the returned url.
quality string optional
Output quality level.
resolution string optional
Output resolution / quality tier.
response_format string optional
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