Introduction
The image generation API supports text-to-image, image-to-image, image editing, and more. Through a unified API interface, you can call multiple mainstream image generation models including Gemini, Doubao Seedream, GPT Image, and Qwen.
Authentication
Bearer Token, e.g., Bearer sk-xxxxxxxxxx
Request Parameters
Model identifier, supported models include:
Qwen series: qwen-image-plus, qwen-image-edit-plus, etc.
GPT Image series: gpt-image-1, etc.
Doubao Seedream series: doubao-seedream-3-0-t2i-250415, doubao-seedream-4-0-250828, doubao-seedream-4-5-251128, doubao-seededit-3-0-i2i-250628, etc.
Gemini series: gemini-2.5-flash-image (Nano Banana), gemini-3-pro-image-preview (Nano Banana Pro), etc.
Response format: b64_json or url Note: Different models have different support for response_format:
Qwen series: Supports both b64_json and url
GPT Image series: Only supports b64_json format
Doubao Seedream series: Usually returns URL links
Gemini series: Only supports b64_json format
Multi-turn content for image-to-image or context conversations
Basic Examples
Gemini
Doubao Seedream
GPT Image
Qwen
Text-to-Image
Image-to-Image
curl -X POST "https://console.mixroute.io/v1/images/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash-image",
"prompt": "A cute orange kitten sitting in a garden, sunny day, high quality photography",
"size": "16:9",
"quality": "high",
"n": 1,
"temperature":1.1,
"top_p":0.95,
"response_format": "b64_json",
"image_size": "2K",
"mime_type": "image/png",
"response_modalities": "image"
}'
curl -X POST "https://console.mixroute.io/v1/images/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash-image",
"size": "16:9",
"quality": "high",
"image_size": "3K",
"temperature":1.1,
"top_p":0.95,
"response_format": "b64_json",
"contents": [
{
"role": "user",
"parts": [
{"text": "Generate an aerial view of Canton Tower based on this image"},
{"image": "data:image/png;base64,iVBORw0KGgoAAxxxx..."}
]
}
]
}'
Text-to-Image
Image-to-Image
curl -X POST "https://console.mixroute.io/v1/images/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-4-0-250828",
"prompt": "A cute orange kitten sitting in a garden, sunny day, high quality photography",
"size": "2048x2048",
"watermark": false,
"seed": 12345,
"optimize_prompt_options": {
"mode": "standard"
}
}'
curl -X POST "https://console.mixroute.io/v1/images/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-4-0-250828",
"prompt": "Transform this image into oil painting style",
"size": "2048x2048",
"watermark": false,
"seed": 12345,
"contents": [
{
"role": "user",
"parts": [
{"image": "data:image/png;base64,iVBORw0KGgoAAxxxx..."},
{"text": "Transform this image into oil painting style"}
]
}
]
}'
Text-to-Image
Image-to-Image
curl -X POST "https://console.mixroute.io/v1/images/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-1",
"prompt": "A cute orange kitten sitting in a garden, sunny day, high quality photography",
"size": "1024x1024",
"quality": "high",
"n": 1
}'
curl -X POST "https://console.mixroute.io/v1/images/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-1",
"prompt": "Transform this image into oil painting style",
"size": "1024x1024",
"quality": "high",
"input_fidelity": "medium",
"n": 1,
"image": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
}'
curl -X POST "https://console.mixroute.io/v1/images/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-plus",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "An elegant couplet hanging in a traditional Chinese hall"
}
]
}
]
},
"parameters": {
"negative_prompt": "1",
"prompt_extend": true,
"seed": "4",
"watermark": true
}
}'
{
"code" : 200 ,
"msg" : "Success" ,
"data" : {
"data" : [
{
"url" : "" ,
"b64_json" : "iVBORw0KGgoAAAANSUhEUgAABAAAAAQA..." ,
"revised_prompt" : ""
}
],
"created" : 1757320007
}
}
Model-Specific Parameters
Doubao Seedream
Image size, depends on model version:
doubao-seedream-4.0/4.5: 2048x2048, 2304x1728, etc. (2K/4K)
doubao-seedream-3.0: 1024x1024, 1152x864, etc.
Random seed for controlling generation randomness. Range: 0 to 2147483647
Guidance coefficient. Recommended range: 1.0-10.0, default: 2.5
sequential_image_generation
Sequential image generation switch: "disabled" (default) or "auto"
GPT Image
Image size: 1024x1024, 1024x1536, 1536x1024. Default: 1024x1024
Image quality: "high", "medium", "low"
Number of images to generate. Range: 1-10
Input fidelity for image-to-image: "auto", "high", "medium", "low"
Gemini
Aspect ratio: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
Image size: 1K (default), 2K, 4K
Output format: image/png (default), image/jpeg
Supported Models
Gemini Series
Model Name Core Capabilities gemini-2.5-flash-image (Nano Banana)Text-to-image, image-to-image, multi-image fusion gemini-3-pro-image-preview (Nano Banana Pro)Higher quality output, text-to-image, image-to-image
Doubao Seedream Series
Model Name Core Capabilities doubao-seedream-3-0-t2i-250415Text-to-image, seed control, guidance coefficient doubao-seedream-4-0-250828Text-to-image, image-to-image, multi-image fusion, 2K/4K doubao-seedream-4-5-251128Text-to-image, image-to-image, prompt optimization doubao-seededit-3-0-i2i-250628Image editing, style transfer
GPT Image Series
Model Name Core Capabilities gpt-image-1Text-to-image, image-to-image, multi-image fusion gpt-image-1-miniLower cost, faster speed
Qwen Series
Model Name Core Capabilities qwen-image-plusText-to-image, text rendering, prompt extension qwen-image-edit-plusImage editing, style transfer
FAQ
What image formats are supported?
How long are generated images valid?
Image URLs are valid for approximately 24 hours. It is recommended to download and save immediately after receiving the response.
Can I generate multiple images at once?
GPT Image: Use n parameter (1-10 images)
Doubao Seedream 4.x: Use sequential image generation (1-4 images)
Qwen: 1 image per request, make multiple concurrent requests for more
cURL
Python
JavaScript
PHP
Go
Java
Ruby
curl --request POST \
--url https://console.mixroute.io/v1/images/generations \
--header 'Authorization: Bearer sk-xxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedream-4.0-base",
"prompt": "A cute orange kitten sitting in a garden",
"size": "1024x1024",
"n": 1
}'
{
"created" : 1709459123 ,
"data" : [
{
"url" : "https://example.com/generated-image.png" ,
"revised_prompt" : "A cute orange kitten sitting in a garden"
}
]
}