Image Generation
Generate an Image
POST/v1/images/generations
Generate an image following instructions given by the prompt.
Compatible with OpenAI Image Generation API with some limitations (cf column "support" in the Request Body table).
Request
curl -X POST https://api.ig1.ai/v1/images/generations \
-H "Authorization: Bearer $IG1AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image",
"prompt": "An image of an Iguana in the street of Paris, Neon theme.",
"quality": "low",
"size": "1280x720",
"output_format": "png"
}'
Request body
| Parameter | Type | Required | Support | Description |
|---|---|---|---|---|
prompt | string | ✅ | ✅ Full | Input prompt |
model | string | ✅ | ✅ Full | qwen-image or qwen-image-pe |
output_format | string | ✅ Full | png, jpeg, or webp | |
quality | string | ✅ Full | low, medium, standard (=medium), high, hd (=high), auto (=medium) | |
size | string | ✅ Full | Any resolution up to 2 Megapixels (e.g. 1024x1024, 1920x1080) | |
n | integer | ⚠️ Partial | Only 1 accepted (0 mapped to 1) | |
response_format | string | ⚠️ Partial | Only b64_json supported. url not supported | |
background | ❌ Ignored | |||
moderation | ❌ Ignored | |||
output_compression | ❌ Ignored | |||
partial_images | ❌ Ignored | |||
stream | ❌ Ignored | |||
style | ❌ Ignored | |||
user | ❌ Ignored |
Response
{
"created": 1773677269,
"data": [
{
"b64_json": "<BASE64_ENCODED_IMAGE_DATA>"
}
],
usage": {
"total_tokens": 0,
"input_tokens": 0,
"output_tokens": 31457280,
"input_tokens_details": {
"text_tokens": 0,
"image_tokens": 0
}
},
"output_format": "png",
"quality": "low",
"size": "1280x720"
}
Prompt Enhancement
Use model qwen-image-pe to automatically refine your prompt via Qwen3.5-397B-A17B before generation. Prompt enhancement override your prompt with more details and elements that fit perfectly with model's expectations to generate a better image.
info
Prompt enhancement tokens are charged under the Qwen3.5-397B-A17B model.