Image Generation Model
Grok Imagine Image Generation
Call xAI image models through the unified image API; the current project returns a synchronous `ImageResponse` and does not support the legacy task_id polling documentation.
- Route:
POST /v1/images/generations - On success, returns
ImageResponsesynchronously
Request Example
curl --request POST \
--url https://api.magickapi.com/v1/images/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-image",
"prompt": "An orange cat sitting on a sunny windowsill, oil painting style",
"n": 1,
"response_format": "url"
}'Successful Response Example
{
"created": 1712345678,
"data": [
{
"url": "https://example.com/grok-image.png",
"b64_json": "",
"revised_prompt": ""
}
]
}Current Limitations
The xAI image requests in the current project only guarantee these fields:
modelpromptnresponse_format
The following usages from the old documentation are no longer retained:
grok-imagine-1.0-apimart- Top-level
size - Top-level
quality - Top-level
style - Asynchronous
task_id
Last updated on
Qwen Image Generation
Call the Qwen Image series via `/v1/images/generations`; the current project returns `ImageResponse` synchronously without using task_id polling.
Gemini 3.1 Flash Image
Describes how `gemini-3.1-flash-image-preview` is integrated in the current project: it belongs to the Gemini native model and does not use the unified image interface.