curl --request POST \
--url https://api.modellix.ai/api/v1/xai/grok-imagine-image-quality \
--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-001",
"model_id": "xai/grok-imagine-image-quality",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-xai-t2i-001"
}
}
}{
"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 Quality
[Core Function] Grok Imagine Image (Quality) is xAI’s high-fidelity text-to-image generation model. [Strengths] It excels at producing richly detailed, high-quality images from a text prompt, with flexible aspect ratios and an optional 2K resolution. [Best For] Highly recommended for: detailed concept art, marketing visuals, and any scenario where image quality is prioritized over generation speed. [Limitations] Do NOT use this model when latency is critical, as generation is slower than the standard model. [Routing] Use this model by default when the user emphasizes quality or detail. For faster, lighter generation use Grok Imagine Image (standard).
curl --request POST \
--url https://api.modellix.ai/api/v1/xai/grok-imagine-image-quality \
--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-001",
"model_id": "xai/grok-imagine-image-quality",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-xai-t2i-001"
}
}
}{
"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"