curl --request POST \
--url https://api.modellix.ai/api/v1/xai/grok-imagine-image-2.0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A collage of London landmarks in a stenciled street-art style"
}
'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-xai-t2i-003",
"model_id": "xai/grok-imagine-image-2.0",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-xai-t2i-003"
}
}
}{
"code": 400,
"message": "Invalid parameters: parameter 'prompt' is required"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Grok Imagine Image 2.0
[Core Function] Grok Imagine Image 2.0 generates images from a text prompt. [Strengths] It supports quality (low or medium), 1k or 2k resolution, a wide range of aspect ratios including 21:9 and 5:2, and up to 10 images per request. [Best For] Highly recommended for: concept art, marketing visuals, cinematic banners, and batch generation. [Limitations] This model does not edit existing images. [Routing] For image editing, use Grok Imagine Image 2.0 Edit.
curl --request POST \
--url https://api.modellix.ai/api/v1/xai/grok-imagine-image-2.0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A collage of London landmarks in a stenciled street-art style"
}
'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-xai-t2i-003",
"model_id": "xai/grok-imagine-image-2.0",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-xai-t2i-003"
}
}
}{
"code": 400,
"message": "Invalid parameters: parameter 'prompt' is required"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Authorizations
API Key authentication. Format: Bearer YOUR_API_KEY.
Body
Generate one or more images from a text prompt.
Text description of the image to generate.
1"A collage of London landmarks in a stenciled street-art style"
Number of images to generate.
1 <= x <= 101
Aspect ratio of the generated image. auto lets the model choose a ratio that fits the prompt.
1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 19.5:9, 9:19.5, 20:9, 9:20, 21:9, 5:2, auto "16:9"
Output resolution.
1k, 2k "2k"
Generation quality.
low, medium "medium"
How images are returned: a temporary URL, or base64 in the task result.
url, b64_json "url"