curl --request POST \
--url https://api.modellix.ai/api/v1/xai/grok-imagine-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A serene Japanese garden with a koi pond in spring"
}
'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-xai-t2i-002",
"model_id": "xai/grok-imagine-image",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-xai-t2i-002"
}
}
}{
"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
[Core Function] Grok Imagine Image is xAI’s standard text-to-image generation model. [Strengths] It excels at quickly generating solid, visually appealing images from a text prompt across a wide range of aspect ratios. [Best For] Highly recommended for: rapid prototyping, social media content, and general-purpose image generation. [Limitations] Do NOT use this model when maximum detail or fidelity is required; the Quality variant produces richer detail. [Routing] Choose this model for fast, general image generation. When the user demands maximum fidelity, route to Grok Imagine Image (Quality).
curl --request POST \
--url https://api.modellix.ai/api/v1/xai/grok-imagine-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A serene Japanese garden with a koi pond in spring"
}
'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-xai-t2i-002",
"model_id": "xai/grok-imagine-image",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-xai-t2i-002"
}
}
}{
"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
xAI Grok Imagine text-to-image request. Shared by the Quality and standard image generation models.
Text description of the image to generate
1"A collage of London landmarks in a stenciled street-art style"
Number of images to generate (official examples use 4; no fixed upper limit)
x >= 11
Aspect ratio of the generated image
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, auto "16:9"
Output resolution tier
1k, 2k "2k"
Format of the returned image data
url, b64_json "url"