Qwen Image 2 Pro API, Qwen Image Edit API, Qwen Image API - AI Image Generation & Editing APIs
by Alibaba
Qwen Image 2 Pro API, developers can access text-to-image generation, image editing, layered image creation, and LoRA training features. The API represents Alibaba's advanced AI research applied to visual content creation, suitable for both consumer applications and enterprise workflows.

Models Version
Get $5 Free Credit on First Payment
No strings attached — add funds and get $5 bonus instantly
Qwen Image Max Edit Image to Image (Image Editing) API Documentation
https://gateway.pixazo.ai/qwen-image-max-edit/v1
Authentication
All requests require an API key passed via header.
| Header | Type | Required | Description |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | string | Yes | Your API subscription key |
Qwen Image Max Edit generate request - Qwen Image Max Edit
Request Code
POST https://gateway.pixazo.ai/qwen-image-max-edit/v1/qwen-image-max-edit-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY
{
"prompt": "Transform the background into a serene mountain landscape with snow-capped peaks and a clear blue sky",
"image_urls": [
"https://imagesai.appypie.com/7686410/JUEOHp2Y3FDjmXwOQJVy_017731476841749.png"
]
}
import requests
url = "https://gateway.pixazo.ai/qwen-image-max-edit/v1/qwen-image-max-edit-request"
headers = {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
"prompt": "Transform the background into a serene mountain landscape with snow-capped peaks and a clear blue sky",
"image_urls": [
"https://imagesai.appypie.com/7686410/JUEOHp2Y3FDjmXwOQJVy_017731476841749.png"
]
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/qwen-image-max-edit/v1/qwen-image-max-edit-request';
const headers = {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
prompt: 'Transform the background into a serene mountain landscape with snow-capped peaks and a clear blue sky',
image_urls: [
'https://imagesai.appypie.com/7686410/JUEOHp2Y3FDjmXwOQJVy_017731476841749.png'
]
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/qwen-image-max-edit/v1/qwen-image-max-edit-request" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
"prompt": "Transform the background into a serene mountain landscape with snow-capped peaks and a clear blue sky",
"image_urls": [
"https://imagesai.appypie.com/7686410/JUEOHp2Y3FDjmXwOQJVy_017731476841749.png"
]
}'
Output
{
"request_id": "qwen-image-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Webhook (Optional)
Add the X-Webhook-URL header to your generate request to receive a POST callback instead of polling.
X-Webhook-URL: https://your-server.com/webhook/callback
Request Parameters - Qwen Image Max Edit generate request
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt | string | Yes | — | Detailed text description of the desired image edit. Specifies what changes to apply to the input image. |
| negative_prompt | string | No | — | Describes unwanted elements or artifacts to avoid in the output. Improves output quality by exclusion. |
| enable_prompt_expansion | boolean | No | true | Enables AI-driven expansion of the prompt for richer, more detailed interpretations. |
| enable_safety_checker | boolean | No | true | Activates content safety filtering to block inappropriate or harmful outputs. |
| num_images | integer | No | 1 | Number of edited images to generate. Must be between 1 and 4. |
| output_format | string | No | png | Output image format. Supported values: png, jpeg, webp. |
| image_urls | array of strings | Yes | — | Array of one or more public HTTP URLs pointing to the source images to be edited. Only the first URL is processed if multiple are provided. |
Minimum Request
{
"prompt": "Transform the background into a serene mountain landscape with snow-capped peaks and a clear blue sky",
"image_urls": [
"https://imagesai.appypie.com/7686410/JUEOHp2Y3FDjmXwOQJVy_017731476841749.png"
]
}
Full Request (all options)
{
"prompt": "Transform the background into a serene mountain landscape with snow-capped peaks and a clear blue sky",
"negative_prompt": "low resolution, error, worst quality, low quality, deformed",
"enable_prompt_expansion": true,
"enable_safety_checker": true,
"num_images": 1,
"output_format": "png",
"image_urls": [
"https://imagesai.appypie.com/7686410/JUEOHp2Y3FDjmXwOQJVy_017731476841749.png"
]
}
Response
{
"request_id": "qwen-image-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Request Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Cache-Control | no-cache |
| Ocp-Apim-Subscription-Key | Your API subscription key |
Response Handling
Common status codes for Qwen Image Max Edit generate request.
| Code | Meaning |
|---|---|
| 202 | Accepted — Request queued |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Too Many Requests |
| 500 | Internal Server Error |
Notes & Tips
- Poll the results endpoint every 2–3 seconds until status is COMPLETED or FAILED
- Implement exponential backoff for retry logic on 500 or 429 responses
- Use clear, specific prompts that describe the desired change in context, lighting, or environment
- Avoid overly vague prompts like “make it better”; specify elements such as “replace sky with sunset”
- Validate image URLs are publicly accessible and use HTTPS before submission
- Limit num_images to 1 unless multiple variations are required to
Response Handling
Common status codes.
Code Meaning 202 Accepted — Request queued 400 Bad Request 401 Unauthorized 402 Insufficient Balance 403 Forbidden 429 Too Many Requests 500 Internal Server Error Error Responses
Queue system errors and model validation errors.
Queue System Errors
// 402 — Insufficient balance { "error": "Insufficient Balance", "message": "Your wallet does not have enough balance." }// 400 — Model not found { "error": "Model not found", "message": "Model 'qwen-image-max-edit' not found or is disabled" }Error via Status/Webhook
{ "request_id": "qwen-image-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "status": "ERROR", "model_id": "qwen-image-max-edit", "error": "Description of the error", "output": null }Retrieving Results
Poll the universal status endpoint to check progress and retrieve results.
Endpoint
GET https://gateway.pixazo.ai/v2/requests/status/{request_id} Ocp-Apim-Subscription-Key: YOUR_API_KEYcURL Example
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ "https://gateway.pixazo.ai/v2/requests/status/qwen-image-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"Response (Completed)
{ "request_id": "qwen-image-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "status": "COMPLETED", "model_id": "qwen-image-max-edit", "error": null, "output": { "media_url": [ "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-max-edit_019dxxxx-xxxx/output.ext" ], "media_type": "application/octet-stream" }, "created_at": "2026-03-31T10:00:00.000Z", "updated_at": "2026-03-31T10:00:15.000Z", "completed_at": "2026-03-31T10:00:15.000Z" }Response Fields
Field Type Description request_id string Unique request identifier status string QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR model_id string Model that processed the request error string|null Error message if failed output.media_url array URLs to generated media (R2 CDN) output.media_type string MIME type of the output created_at string When request was created completed_at string|null When request completed polling_url string Status URL (initial response only) Status Values
Status Description QUEUED Request accepted, waiting to be processed PROCESSING Being processed by the model COMPLETED Done — output contains the result FAILED Failed — check error field ERROR System error — not charged Status Flow
QUEUED → PROCESSING → COMPLETED → FAILED → ERRORTypical Workflow
- Send a generate request to the API endpoint
- Save the
request_idfrom the response - Poll every 5-10 seconds:
GET /v2/requests/status/{request_id} - When
statusis"COMPLETED", download fromoutput.media_url
Tip: Use
X-Webhook-URLheader to get a callback instead of polling.
Qwen Image Max Edit Image to Image (Image Editing) API Pricing
No data available
Could not load current pricing
Qwen Image Max t2i Text to Image API Documentation
https://gateway.pixazo.ai/qwen-image-max/v1
Authentication
All requests require an API key passed via header.
| Header | Type | Required | Description |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | string | Yes | Your API subscription key |
Qwen Image Max generate request - Qwen Image Max
Request Code
POST https://gateway.pixazo.ai/qwen-image-max/v1/qwen-image-max-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY
{
"prompt": "A majestic white tiger resting on a mossy rock beside a waterfall in a tropical rainforest, photorealistic"
}
import requests
url = "https://gateway.pixazo.ai/qwen-image-max/v1/qwen-image-max-request"
headers = {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
"prompt": "A majestic white tiger resting on a mossy rock beside a waterfall in a tropical rainforest, photorealistic"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = "https://gateway.pixazo.ai/qwen-image-max/v1/qwen-image-max-request";
const headers = {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
};
const data = {
prompt: "A majestic white tiger resting on a mossy rock beside a waterfall in a tropical rainforest, photorealistic"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
curl -X POST "https://gateway.pixazo.ai/qwen-image-max/v1/qwen-image-max-request" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
"prompt": "A majestic white tiger resting on a mossy rock beside a waterfall in a tropical rainforest, photorealistic"
}'
Output
{
"request_id": "qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Webhook (Optional)
Add the X-Webhook-URL header to your generate request to receive a POST callback instead of polling.
X-Webhook-URL: https://your-server.com/webhook/callback
Request Parameters - Qwen Image Max generate request
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt | string | Yes | — | A detailed text description of the desired image. Be specific about subjects, styles, lighting, and composition. |
| negative_prompt | string | No | — | A description of elements to avoid in the generated image. Helps refine output quality by excluding unwanted features. |
| image_size | string | No | square_hd | The resolution and aspect ratio of the output image. Supported values: square_hd, portrait_hd, landscape_hd. |
| enable_prompt_expansion | boolean | No | true | Enables AI-driven enhancement of the prompt for richer, more detailed generation. |
| enable_safety_checker | boolean | No | true | Activates content filtering to block inappropriate or harmful outputs. |
| num_images | integer | No | 1 | Number of images to generate in a single request. Maximum value is 4. |
| output_format | string | No | png | The file format of the generated image. Supported values: png, jpeg, webp. |
Minimum Request
{
"prompt": "A majestic white tiger resting on a mossy rock beside a waterfall in a tropical rainforest, photorealistic"
}
Full Request (all options)
{
"prompt": "A majestic white tiger resting on a mossy rock beside a waterfall in a tropical rainforest, photorealistic",
"negative_prompt": "low resolution, error, worst quality, low quality, deformed",
"image_size": "square_hd",
"enable_prompt_expansion": true,
"enable_safety_checker": true,
"num_images": 1,
"output_format": "png"
}
Response
{
"request_id": "qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Request Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Cache-Control | no-cache |
| Ocp-Apim-Subscription-Key | Your API subscription key |
Response Handling
Common status codes for Qwen Image Max generate request.
| Code | Meaning |
|---|---|
| 202 | Accepted — Request queued |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Too Many Requests |
| 500 | Internal Server Error |
Response Handling
Common status codes.
| Code | Meaning |
|---|---|
| 202 | Accepted — Request queued |
| 400 | Bad Request |
| 401 | Unauthorized |
| 402 | Insufficient Balance |
| 403 | Forbidden |
| 429 | Too Many Requests |
| 500 | Internal Server Error |
Error Responses
Queue system errors and model validation errors.
Queue System Errors
// 402 — Insufficient balance
{
"error": "Insufficient Balance",
"message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
"error": "Model not found",
"message": "Model 'qwen-image-max' not found or is disabled"
}
Error via Status/Webhook
{
"request_id": "qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "ERROR",
"model_id": "qwen-image-max",
"error": "Description of the error",
"output": null
}
Retrieving Results
Poll the universal status endpoint to check progress and retrieve results.
Endpoint
GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY
cURL Example
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
"https://gateway.pixazo.ai/v2/requests/status/qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Response (Completed)
{
"request_id": "qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "COMPLETED",
"model_id": "qwen-image-max",
"error": null,
"output": {
"media_url": [
"https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-max_019dxxxx-xxxx/output.ext"
],
"media_type": "application/octet-stream"
},
"created_at": "2026-03-31T10:00:00.000Z",
"updated_at": "2026-03-31T10:00:15.000Z",
"completed_at": "2026-03-31T10:00:15.000Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| request_id | string | Unique request identifier |
| status | string | QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR |
| model_id | string | Model that processed the request |
| error | string|null | Error message if failed |
| output.media_url | array | URLs to generated media (R2 CDN) |
| output.media_type | string | MIME type of the output |
| created_at | string | When request was created |
| completed_at | string|null | When request completed |
| polling_url | string | Status URL (initial response only) |
Status Values
| Status | Description |
|---|---|
| QUEUED | Request accepted, waiting to be processed |
| PROCESSING | Being processed by the model |
| COMPLETED | Done — output contains the result |
| FAILED | Failed — check error field |
| ERROR | System error — not charged |
Status Flow
QUEUED → PROCESSING → COMPLETED
→ FAILED
→ ERROR
Typical Workflow
- Send a generate request to the API endpoint
- Save the
request_idfrom the response - Poll every 5-10 seconds:
GET /v2/requests/status/{request_id} - When
statusis"COMPLETED", download fromoutput.media_url
Tip: Use X-Webhook-URL header to get a callback instead of polling.
Qwen Image Max t2i Text to Image API Pricing
No data available
Could not load current pricing
Qwen Image Edit Image to Image (Image Editing) API Documentation
Request Code
POST https://gateway.pixazo.ai/qwen-image/v1/generateMultimodeTextToImageEditRequest
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY
{
"model": "qwen-image-edit",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/manwithbear.jpg"
},
{
"text": "Change the person to a walking position, bending over to hold the bears front paws."
}
]
}
]
},
"parameters": {
"negative_prompt": "",
"watermark": false
}
}
import requests
url = "https://gateway.pixazo.ai/qwen-image/v1/generateMultimodeTextToImageEditRequest"
headers = {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
"model": "qwen-image-edit",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/manwithbear.jpg"
},
{
"text": "Change the person to a walking position, bending over to hold the bears front paws."
}
]
}
]
},
"parameters": {
"negative_prompt": "",
"watermark": False
}
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/qwen-image/v1/generateMultimodeTextToImageEditRequest';
const headers = {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
model: 'qwen-image-edit',
input: {
messages: [
{
role: 'user',
content: [
{
image: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/manwithbear.jpg'
},
{
text: 'Change the person to a walking position, bending over to hold the bears front paws.'
}
]
}
]
},
parameters: {
negative_prompt: '',
watermark: false
}
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/qwen-image/v1/generateMultimodeTextToImageEditRequest" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
"model": "qwen-image-edit",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/manwithbear.jpg"
},
{
"text": "Change the person to a walking position, bending over to hold the bears front paws."
}
]
}
]
},
"parameters": {
"negative_prompt": "",
"watermark": false
}
}'
Output
{
"status_code": 200,
"request_id": "3daccb10-10ca-9399-8b6a-xxxxxx",
"output": {
"choices": [
{
"message": {
"content": [
{
"image": "https://pub-...png"
}
]
}
}
]
}
}
Request Parameters - Image Edit(Img2Img)
| Parameter | Required | Type | Description |
|---|---|---|---|
| model | Yes | string | Model to use. Available value: "qwen-image-edit" (Qwen image editing model). |
| input.messages | Yes | array | Array of message objects containing the image editing request. Must contain at least one user message. |
| input.messages[].role | Yes | string | Role of the message sender. Must be "user" for image editing requests. |
| input.messages[].content | Yes | array | Array of content objects containing both the input image and editing instructions. |
| input.messages[].content[].image | Yes | string | Input image for editing. Can be a publicly accessible HTTP/HTTPS URL or Base64-encoded image data in format data:{MIME_type};base64,{base64_data}. |
| input.messages[].content[].text | Yes | string | Text instructions describing the desired edits. Supports complex editing tasks including text editing, color adjustment, style transfer, and object manipulation. |
| parameters.negative_prompt | No | string | Negative prompt to specify what should not appear in the edited image. Default: "" (empty string). |
| parameters.watermark | No | boolean | Whether to add a watermark to the edited image. Default: false. |
Example Request
{
"model": "qwen-image-edit",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/manwithbear.jpg"
},
{
"text": "Change the person to a walking position, bending over to hold the bear's front paws."
}
]
}
]
},
"parameters": {
"negative_prompt": "",
"watermark": false
}
}
Response
{
"status_code": 200,
"request_id": "3daccb10-10ca-9399-8b6a-xxxxxx",
"code": "",
"message": "",
"output": {
"text": null,
"finish_reason": null,
"choices": [
{
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": [
{
"image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/qwen-image-edit/qwen-image-edit-3daccb10-10ca-9399-8b6a-xxxxxx-1703123456789.png"
}
]
}
}
]
},
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"width": 1248,
"image_count": 1,
"height": 832
}
}
Request Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Cache-Control | no-cache |
| Ocp-Apim-Subscription-Key | YOUR_SUBSCRIPTION_KEY |
Response Handling
Common status codes for Image Edit(Img2Img).
| Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Too Many Requests |
| 500 | Internal Server Error |
Qwen Image Edit Image to Image (Image Editing) API Pricing
| Resolution | Price (USD) |
|---|---|
| All Resolution | $0.045 |
Qwen Image Text to Image API Documentation
https://gateway.pixazo.ai/qwen-image/v1
Authentication
All requests require an API key passed via header.
| Header | Type | Required | Description |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | string | Yes | Your API subscription key |
Text To Image Request - Qwen Image API
Request Code
POST /generateMultimodeTextToImageRequest HTTP/1.1
Host: gateway.pixazo.ai
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY
{
"model": "qwen-image",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "A serene lake at sunset, with mountains reflected in the water and a lone canoe on the shore."
}
]
}
]
},
"parameters": {
"size": "1328*1328"
}
}
import requests
url = "https://gateway.pixazo.ai/qwen-image/v1/generateMultimodeTextToImageRequest"
headers = {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
"model": "qwen-image",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "A serene lake at sunset, with mountains reflected in the water and a lone canoe on the shore."
}
]
}
]
},
"parameters": {
"size": "1328*1328"
}
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
fetch('https://gateway.pixazo.ai/qwen-image/v1/generateMultimodeTextToImageRequest', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
},
body: JSON.stringify({
model: 'qwen-image',
input: {
messages: [
{
role: 'user',
content: [
{
text: 'A serene lake at sunset, with mountains reflected in the water and a lone canoe on the shore.'
}
]
}
]
},
parameters: {
size: '1328*1328'
}
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/qwen-image/v1/generateMultimodeTextToImageRequest" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
"model": "qwen-image",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "A serene lake at sunset, with mountains reflected in the water and a lone canoe on the shore."
}
]
}
]
},
"parameters": {
"size": "1328*1328"
}
}'
Output
{
"images": [
{
"file_name": "nano-banana-pro-edit-output.png",
"content_type": "image/png",
"url": "[RESPONSE_URL]"
}
],
"description": ""
}
Request Parameters - Text To Image Request
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | Yes | — | Model to use. Available value: "qwen-image" (Qwen text-to-image generation model). |
| input.messages | array | Yes | — | Array of message objects containing the generation request. Must contain at least one user message. |
| input.messages[].role | string | Yes | — | Role of the message sender. Must be "user" for text-to-image generation requests. |
| input.messages[].content | array | Yes | — | Array of content objects containing the text prompt for image generation. |
| input.messages[].content[].text | string | Yes | — | Text prompt describing the image to generate. Supports complex descriptions, multi-line layouts, and fine-grained details. Excels at Chinese and English text rendering. |
| parameters.negative_prompt | string | No | "" | Negative prompt to specify what should not appear in the generated image. |
| parameters.prompt_extend | boolean | No | true | Whether to extend and enhance the input prompt automatically. |
| parameters.watermark | boolean | No | true | Whether to add a watermark to the generated image. |
| parameters.size | string | No | 1328*1328 | Output image dimensions in format "WIDTHxHEIGHT". Available sizes: "1328*1328", "1024*1024", "768*768", "512*512". |
Minimum Request
{
"model": "qwen-image",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "A serene lake at sunset, with mountains reflected in the water and a lone canoe on the shore."
}
]
}
]
},
"parameters": {
"size": "1328*1328"
}
}
Full Request (all options)
{
"model": "qwen-image",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "A serene lake at sunset, with mountains reflected in the water and a lone canoe on the shore."
}
]
}
]
},
"parameters": {
"negative_prompt": "",
"prompt_extend": true,
"watermark": true,
"size": "1328*1328"
}
}
Response
{
"images": [
{
"file_name": "nano-banana-pro-edit-output.png",
"content_type": "image/png",
"url": "[RESPONSE_URL]"
}
],
"description": ""
}
Response Fields - Text To Image Request
| Field | Type | Description |
|---|---|---|
| images | array | Array of generated image objects. |
| images[].file_name | string | Name of the generated image file. |
| images[].content_type | string | MIME type of the image, typically "image/png". |
| images[].url | string | URL where the generated image can be downloaded. |
| description | string | Optional descriptive text about the generated image, currently always empty. |
Request Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Cache-Control | no-cache |
| Ocp-Apim-Subscription-Key | Your API subscription key |
Response Handling
Common status codes for Text To Image Request.
| Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Too Many Requests |
| 500 | Internal Server Error |
Qwen Image Text to Image API Pricing
| Resolution | Price (USD) |
|---|---|
| All Resolution | $0.045 |
Qwen LoRA v1 Text to Image (LoRA) API Documentation
https://gateway.pixazo.ai/qwen-image-edit-plus/v1
Authentication
All requests require an API key passed via header.
| Header | Type | Required | Description |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | string | Yes | Your API subscription key |
Generate Image Edit Request - Qwen Image Edit Plus Lora API
Request Code
POST https://gateway.pixazo.ai/qwen-image-edit-plus/v1/qwen-image-edit-plus-lora/generate
Content-Type: application/json
{
"prompt": "Close shot of a woman standing next to this car on this highway",
"image_urls": [
"https://example.com/reference1.png",
"https://example.com/reference2.png",
"https://example.com/reference3.png"
]
}
import requests
url = "https://gateway.pixazo.ai/qwen-image-edit-plus/v1/qwen-image-edit-plus-lora/generate"
headers = {
"Content-Type": "application/json"
}
data = {
"prompt": "Close shot of a woman standing next to this car on this highway",
"image_urls": [
"https://example.com/reference1.png",
"https://example.com/reference2.png",
"https://example.com/reference3.png"
]
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/qwen-image-edit-plus/v1/qwen-image-edit-plus-lora/generate';
const data = {
prompt: 'Close shot of a woman standing next to this car on this highway',
image_urls: [
'https://example.com/reference1.png',
'https://example.com/reference2.png',
'https://example.com/reference3.png'
]
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST https://gateway.pixazo.ai/qwen-image-edit-plus/v1/qwen-image-edit-plus-lora/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "Close shot of a woman standing next to this car on this highway",
"image_urls": [
"https://example.com/reference1.png",
"https://example.com/reference2.png",
"https://example.com/reference3.png"
]
}'
Output
{
"request_id": "qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Webhook (Optional)
Add the X-Webhook-URL header to your generate request to receive a POST callback instead of polling.
X-Webhook-URL: https://your-server.com/webhook/callback
Request Parameters - Generate Image Edit Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| prompt | Yes | string | Text prompt describing the desired image edit or generation |
| image_urls | Yes | array | Array of reference image URLs (1-10 images) |
| image_size | No | string or object | Output image size (see Image Size Options below) |
| num_inference_steps | No | number | Number of inference steps (higher = better quality, slower) |
| seed | No | number | Random seed for reproducibility |
| guidance_scale | No | number | CFG (Classifier Free Guidance) scale (1-20) |
| num_images | No | number | Number of images to generate (1-4) |
| output_format | No | string | Output format: "png" or "jpeg" |
| negative_prompt | No | string | What to avoid in the generated image |
| acceleration | No | string | Acceleration level: "none" or "regular" |
| enable_safety_checker | No | boolean | Enable NSFW content safety checker |
| webhook | No | string | Webhook URL for async notifications |
| webhook_events_filter | No | array | Event types to receive: ["start"], ["complete"], ["*"] |
Example Request
{
"prompt": "Close shot of a woman standing next to this car on this highway",
"image_urls": [
"https://example.com/reference1.png",
"https://example.com/reference2.png",
"https://example.com/reference3.png"
],
"image_size": "square_hd",
"num_inference_steps": 50,
"guidance_scale": 4,
"num_images": 1,
"output_format": "png",
"negative_prompt": " ",
"acceleration": "regular",
"enable_safety_checker": true
}
Response
{
"request_id": "qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Request Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
Response Handling
Common status codes.
| Code | Meaning |
|---|---|
| 202 | Accepted — Request queued |
| 400 | Bad Request |
| 401 | Unauthorized |
| 402 | Insufficient Balance |
| 403 | Forbidden |
| 429 | Too Many Requests |
| 500 | Internal Server Error |
Error Responses
Queue system errors and model validation errors.
Queue System Errors
// 402 — Insufficient balance
{
"error": "Insufficient Balance",
"message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
"error": "Model not found",
"message": "Model 'qwen-image-edit-plus-lora' not found or is disabled"
}
Error via Status/Webhook
{
"request_id": "qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "ERROR",
"model_id": "qwen-image-edit-plus-lora",
"error": "Description of the error",
"output": null
}
Retrieving Results
Poll the universal status endpoint to check progress and retrieve results.
Endpoint
GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY
cURL Example
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
"https://gateway.pixazo.ai/v2/requests/status/qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Response (Completed)
{
"request_id": "qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "COMPLETED",
"model_id": "qwen-image-edit-plus-lora",
"error": null,
"output": {
"media_url": [
"https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-edit-plus-lora_019dxxxx-xxxx/output.ext"
],
"media_type": "application/octet-stream"
},
"created_at": "2026-03-31T10:00:00.000Z",
"updated_at": "2026-03-31T10:00:15.000Z",
"completed_at": "2026-03-31T10:00:15.000Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| request_id | string | Unique request identifier |
| status | string | QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR |
| model_id | string | Model that processed the request |
| error | string|null | Error message if failed |
| output.media_url | array | URLs to generated media (R2 CDN) |
| output.media_type | string | MIME type of the output |
| created_at | string | When request was created |
| completed_at | string|null | When request completed |
| polling_url | string | Status URL (initial response only) |
Status Values
| Status | Description |
|---|---|
| QUEUED | Request accepted, waiting to be processed |
| PROCESSING | Being processed by the model |
| COMPLETED | Done — output contains the result |
| FAILED | Failed — check error field |
| ERROR | System error — not charged |
Status Flow
QUEUED → PROCESSING → COMPLETED
→ FAILED
→ ERROR
Typical Workflow
- Send a generate request to the API endpoint
- Save the
request_idfrom the response - Poll every 5-10 seconds:
GET /v2/requests/status/{request_id} - When
statusis"COMPLETED", download fromoutput.media_url
Tip: Use X-Webhook-URL header to get a callback instead of polling.
Qwen LoRA v1 Text to Image (LoRA) API Pricing
| Resolution | Price (USD) |
|---|---|
| All Resolution | $0.055 |
Qwen LoRA v1 Image to Image (LoRA Trainer) API Documentation
https://gateway.pixazo.ai/qwen-image-edit-plus-trainer/v1
Authentication
All requests require an API key passed via header.
| Header | Type | Required | Description |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | string | Yes | Your API subscription key |
Training Request - Qwen Image Edit Plus Trainer API
Request Code
POST https://gateway.pixazo.ai/qwen-image-edit-plus-trainer/v1/qwen-image-edit-plus-trainer/generate
Content-Type: application/json
Ocp-Apim-Subscription-Key: your-subscription-key
{
"image_data_url": "https://example.com/lighting-training.zip",
"steps": 1000
}
import requests
url = "https://gateway.pixazo.ai/qwen-image-edit-plus-trainer/v1/qwen-image-edit-plus-trainer/generate"
headers = {
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "your-subscription-key"
}
data = {
"image_data_url": "https://example.com/lighting-training.zip",
"steps": 1000
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/qwen-image-edit-plus-trainer/v1/qwen-image-edit-plus-trainer/generate';
const headers = {
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': 'your-subscription-key'
};
const data = {
image_data_url: 'https://example.com/lighting-training.zip',
steps: 1000
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST https://gateway.pixazo.ai/qwen-image-edit-plus-trainer/v1/qwen-image-edit-plus-trainer/generate \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: your-subscription-key" \
-d '{
"image_data_url": "https://example.com/lighting-training.zip",
"steps": 1000
}'
Output
{
"request_id": "qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Webhook (Optional)
Add the X-Webhook-URL header to your generate request to receive a POST callback instead of polling.
X-Webhook-URL: https://your-server.com/webhook/callback
Request Parameters - Training Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| image_data_url | Yes | string | URL to ZIP archive containing training image pairs |
| learning_rate | No | number | Learning rate for LoRA parameters (0.0-1.0) |
| steps | No | number | Number of training steps (1-10000) |
| default_caption | No | string | Default caption when caption files are missing |
| reference_image_count | No | number | Number of reference images per entry (1-10) |
| webhook | No | string | Webhook URL for training completion notifications |
| webhook_events_filter | No | array | Event types to receive ("*" for all) |
Example Request
{
"image_data_url": "https://example.com/lighting-training.zip",
"learning_rate": 0.0002,
"steps": 2000,
"default_caption": "professional cinematic lighting with dramatic shadows",
"reference_image_count": 2,
"webhook": "https://your-domain.com/training-complete"
}
Response
{
"request_id": "qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Request Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Ocp-Apim-Subscription-Key | Your subscription key |
Response Handling
Common status codes.
| Code | Meaning |
|---|---|
| 202 | Accepted — Request queued |
| 400 | Bad Request |
| 401 | Unauthorized |
| 402 | Insufficient Balance |
| 403 | Forbidden |
| 429 | Too Many Requests |
| 500 | Internal Server Error |
Error Responses
Queue system errors and model validation errors.
Queue System Errors
// 402 — Insufficient balance
{
"error": "Insufficient Balance",
"message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
"error": "Model not found",
"message": "Model 'qwen-image-edit-plus-trainer' not found or is disabled"
}
Error via Status/Webhook
{
"request_id": "qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "ERROR",
"model_id": "qwen-image-edit-plus-trainer",
"error": "Description of the error",
"output": null
}
Retrieving Results
Poll the universal status endpoint to check progress and retrieve results.
Endpoint
GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY
cURL Example
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
"https://gateway.pixazo.ai/v2/requests/status/qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Response (Completed)
{
"request_id": "qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "COMPLETED",
"model_id": "qwen-image-edit-plus-trainer",
"error": null,
"output": {
"media_url": [
"https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-edit-plus-trainer_019dxxxx-xxxx/output.ext"
],
"media_type": "application/octet-stream"
},
"created_at": "2026-03-31T10:00:00.000Z",
"updated_at": "2026-03-31T10:00:15.000Z",
"completed_at": "2026-03-31T10:00:15.000Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| request_id | string | Unique request identifier |
| status | string | QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR |
| model_id | string | Model that processed the request |
| error | string|null | Error message if failed |
| output.media_url | array | URLs to generated media (R2 CDN) |
| output.media_type | string | MIME type of the output |
| created_at | string | When request was created |
| completed_at | string|null | When request completed |
| polling_url | string | Status URL (initial response only) |
Status Values
| Status | Description |
|---|---|
| QUEUED | Request accepted, waiting to be processed |
| PROCESSING | Being processed by the model |
| COMPLETED | Done — output contains the result |
| FAILED | Failed — check error field |
| ERROR | System error — not charged |
Status Flow
QUEUED → PROCESSING → COMPLETED
→ FAILED
→ ERROR
Typical Workflow
- Send a generate request to the API endpoint
- Save the
request_idfrom the response - Poll every 5-10 seconds:
GET /v2/requests/status/{request_id} - When
statusis"COMPLETED", download fromoutput.media_url
Tip: Use X-Webhook-URL header to get a callback instead of polling.
Qwen LoRA v1 Image to Image (LoRA Trainer) API Pricing
| Resolution | Price (USD) |
|---|---|
| All Resolution | $0.04 |
Qwen LoRA v1 Image to Image (Image Editing — Layered) API Documentation
https://gateway.pixazo.ai/qwen-image-layered/v1
Authentication
All requests require an API key passed via header.
| Header | Type | Required | Description |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | string | Yes | Your API subscription key |
Qwen Image Layered generate request - Qwen Image Layered API
Request Code
POST https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY
{
"image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg",
"num_inference_steps": 28,
"guidance_scale": 5.0,
"num_images": 1,
"enable_safety_checker": true,
"output_format": "png",
"acceleration": "regular"
}
import requests
url = "https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request"
headers = {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
"image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg",
"num_inference_steps": 28,
"guidance_scale": 5.0,
"num_images": 1,
"enable_safety_checker": True,
"output_format": "png",
"acceleration": "regular"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request';
const headers = {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
image_url: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg',
num_inference_steps: 28,
guidance_scale: 5.0,
num_images: 1,
enable_safety_checker: true,
output_format: 'png',
acceleration: 'regular'
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
"image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg",
"num_inference_steps": 28,
"guidance_scale": 5.0,
"num_images": 1,
"enable_safety_checker": true,
"output_format": "png",
"acceleration": "regular"
}'
Output
{
"request_id": "qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Webhook (Optional)
Add the X-Webhook-URL header to your generate request to receive a POST callback instead of polling.
X-Webhook-URL: https://your-server.com/webhook/callback
Request Parameters - Qwen Image Layered generate request
| Parameter | Required | Type | Description |
|---|---|---|---|
| image_url | Yes | string | Publicly accessible URL of the input image to be decomposed into layers. Must be reachable by the server. |
| num_inference_steps | No | integer | Number of denoising steps during the decomposition process. Higher values yield finer details at the cost of processing time. |
| guidance_scale | No | number | Controls the strength of the decomposition guidance. Higher values enforce stronger adherence to input structure. |
| num_images | No | integer | Number of layer sets to generate (currently supports only 1). |
| enable_safety_checker | No | boolean | Enables content safety filtering to block potentially harmful or inappropriate outputs. |
| output_format | No | string | Output format for the generated layers. Only "png" is currently supported to preserve transparency. |
| acceleration | No | string | Processing mode. Use "regular" for standard quality, "fast" for quicker but lower resolution outputs. |
Example Request
{
"image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg",
"num_inference_steps": 28,
"guidance_scale": 5.0,
"num_images": 1,
"enable_safety_checker": true,
"output_format": "png",
"acceleration": "regular"
}
Response
{
"request_id": "qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Request Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Cache-Control | no-cache |
| Ocp-Apim-Subscription-Key | YOUR_SUBSCRIPTION_KEY |
Response Handling
Common status codes.
| Code | Meaning |
|---|---|
| 202 | Accepted — Request queued |
| 400 | Bad Request |
| 401 | Unauthorized |
| 402 | Insufficient Balance |
| 403 | Forbidden |
| 429 | Too Many Requests |
| 500 | Internal Server Error |
Error Responses
Queue system errors and model validation errors.
Queue System Errors
// 402 — Insufficient balance
{
"error": "Insufficient Balance",
"message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
"error": "Model not found",
"message": "Model 'qwen-image-layered' not found or is disabled"
}
Error via Status/Webhook
{
"request_id": "qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "ERROR",
"model_id": "qwen-image-layered",
"error": "Description of the error",
"output": null
}
Retrieving Results
Poll the universal status endpoint to check progress and retrieve results.
Endpoint
GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY
cURL Example
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
"https://gateway.pixazo.ai/v2/requests/status/qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Response (Completed)
{
"request_id": "qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "COMPLETED",
"model_id": "qwen-image-layered",
"error": null,
"output": {
"media_url": [
"https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-layered_019dxxxx-xxxx/output.ext"
],
"media_type": "application/octet-stream"
},
"created_at": "2026-03-31T10:00:00.000Z",
"updated_at": "2026-03-31T10:00:15.000Z",
"completed_at": "2026-03-31T10:00:15.000Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| request_id | string | Unique request identifier |
| status | string | QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR |
| model_id | string | Model that processed the request |
| error | string|null | Error message if failed |
| output.media_url | array | URLs to generated media (R2 CDN) |
| output.media_type | string | MIME type of the output |
| created_at | string | When request was created |
| completed_at | string|null | When request completed |
| polling_url | string | Status URL (initial response only) |
Status Values
| Status | Description |
|---|---|
| QUEUED | Request accepted, waiting to be processed |
| PROCESSING | Being processed by the model |
| COMPLETED | Done — output contains the result |
| FAILED | Failed — check error field |
| ERROR | System error — not charged |
Status Flow
QUEUED → PROCESSING → COMPLETED
→ FAILED
→ ERROR
Typical Workflow
- Send a generate request to the API endpoint
- Save the
request_idfrom the response - Poll every 5-10 seconds:
GET /v2/requests/status/{request_id} - When
statusis"COMPLETED", download fromoutput.media_url
Tip: Use X-Webhook-URL header to get a callback instead of polling.
Qwen LoRA v1 Image to Image (Image Editing — Layered) API Pricing
| Resolution | Price (USD) |
|---|---|
| All Resolution | $0.05 |