Grok Imagine Image 2.0 API
xAI's second-generation image model for generation and editing
About this model
Grok Imagine Image 2.0 is xAI’s second-generation image model. Per xAI’s release notes, version 2.0 added an “auto” quality setting (low for generation, medium for editing), editing from up to 5 source images and new 21:9 and 5:2 aspect ratios.
It both generates images from text and edits existing ones. Compared with the first Grok Imagine Image, which is also in this catalog, choose 2.0 for multi-image editing and wider formats.
Limits: the catalog lists no extra constraints; the 5-source-image cap for editing comes from xAI.
Use cases
- Illustrations and marketing visuals
- Editing from up to 5 source images
- Wide banners (21:9 and 5:2)
Input and output
- Input
- Text prompt, optional source images
- Output
- Images
Developer
- Developer
- xAI
- Type
- Picture
Grok Imagine Image 2.0 request example
Use https://gatelum.com/v1 as the base URL and pass x-ai/grok-imagine-image-2.0 in the model field. You create the key in your account after signing up.
curl --silent --show-error --fail-with-body \
--header 'Authorization: Bearer glt_YOUR_KEY' \
'https://gatelum.com/v1/images/generations' \
--header "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"model": "x-ai/grok-imagine-image-2.0",
"prompt": "A lighthouse on a rocky shore at sunset, watercolor",
"n": 1
}
JSON