Qwen Image 2 Pro API, Qwen Image Edit API (Free), Qwen Image API: Pricing, Documentation
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 API Documentation
https://gateway.pixazo.ai/qwen-image-max-edit/v1/qwen-image-max-edit-request
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 submit request to receive a POST callback when the job completes — no polling required.
Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.
Webhook Headers
| Header | Required | Default | Description |
|---|---|---|---|
X-Webhook-URL | Yes (to enable) | — | HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed). |
X-Webhook-Mode | No | terminal | terminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates. |
Example: enable webhook
X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal
Callback Payload
Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):
{
"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-xxxx-xxxx-xxxxxxxxxxxx/output.png"
],
"media_type": "image/png"
},
"created_at": "2026-05-22T13:17:32.110Z",
"updated_at": "2026-05-22 13:19:23",
"completed_at": "2026-05-22 13:19:23"
}
Failure callback shape
{
"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,
"created_at": "...",
"updated_at": "...",
"completed_at": "..."
}
Delivery semantics
- terminal mode (default) — exactly one
POSTwhen the request reaches a terminal status. No callback duringPROCESSING. - sync mode —
POSTon every status poll (with delay capped at ~15s) plus a finalPOSTat terminal status. Use when you want progress updates. - Idempotency — use
request_idas your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates. - Response — respond
200 OKwithin a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries. - HTTPS required — plain
http://URLs are rejected.
Request Parameters - Qwen Image Max Edit generate request
| Parameter | Required | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|---|
| prompt | Yes | string | — | Max 800 characters | Text prompt describing the desired edit. Supports Chinese and English. Be specific about the change (subject, context, lighting, environment). |
| negative_prompt | No | string | "" | Max 500 characters | Describes unwanted elements or artifacts to avoid in the output. Improves quality by exclusion. |
| image_size | No | string or object | — | square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, or a custom {width, height} object | Dimensions of the generated image. If omitted, the size of the input image is used. |
| enable_prompt_expansion | No | boolean | true | true, false | Automatically rewrites and enriches your prompt with extra detail before generation to improve results. |
| seed | No | integer | — | 0–2147483647 | Random seed for reproducible results. Reuse the same seed with the same inputs to regenerate a similar image. |
| enable_safety_checker | No | boolean | true | true, false | Turns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it. |
| sync_mode | No | boolean | false | true, false | When true, the image is returned inline as a data URI in the response instead of a hosted URL, and the output is not saved to your request history. |
| num_images | No | integer | 1 | 1–6 | Number of edited images to generate. Must be between 1 and 6. |
| output_format | No | string | png | png, jpeg, webp | Output image format. Supported values: png, jpeg, webp. |
| image_urls | Yes | array of strings | — | 1–3 image URLs | Public URLs of the reference image(s) to edit (1–3 images). Order matters — the first URL is image 1, the second image 2, and so on; reference them by position in your prompt. Each image 384–5000px per dimension, max 10 MB; JPG, PNG (no alpha), or WEBP. |
Content Item Types & Limits
| Type | Max | Format / Size | Description |
|---|---|---|---|
| image | — | JPG, PNG, WEBP · < 10 MB | Image(s) to edit. |
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
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 API Pricing
Qwen Image Max t2i API Documentation
https://gateway.pixazo.ai/qwen-image-max/v1/qwen-image-max-request
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 submit request to receive a POST callback when the job completes — no polling required.
Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.
Webhook Headers
| Header | Required | Default | Description |
|---|---|---|---|
X-Webhook-URL | Yes (to enable) | — | HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed). |
X-Webhook-Mode | No | terminal | terminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates. |
Example: enable webhook
X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal
Callback Payload
Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):
{
"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-xxxx-xxxx-xxxxxxxxxxxx/output.png"
],
"media_type": "image/png"
},
"created_at": "2026-05-22T13:17:32.110Z",
"updated_at": "2026-05-22 13:19:23",
"completed_at": "2026-05-22 13:19:23"
}
Failure callback shape
{
"request_id": "qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "ERROR",
"model_id": "qwen-image-max",
"error": "Description of the error",
"output": null,
"created_at": "...",
"updated_at": "...",
"completed_at": "..."
}
Delivery semantics
- terminal mode (default) — exactly one
POSTwhen the request reaches a terminal status. No callback duringPROCESSING. - sync mode —
POSTon every status poll (with delay capped at ~15s) plus a finalPOSTat terminal status. Use when you want progress updates. - Idempotency — use
request_idas your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates. - Response — respond
200 OKwithin a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries. - HTTPS required — plain
http://URLs are rejected.
Request Parameters - Qwen Image Max generate request
| Parameter | Required | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|---|
| prompt | Yes | string | — | — | A detailed text description of the desired image. Supports English and Chinese; up to 800 characters. Be specific about subjects, styles, lighting, and composition. |
| negative_prompt | No | string | — | — | A description of elements to avoid in the generated image (up to 500 characters). Helps refine output quality by excluding unwanted features. |
| image_size | No | string | square_hd | square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9 | The resolution and aspect ratio of the output image. Choose one of the preset enum values, or pass a custom {width, height} object. |
| enable_prompt_expansion | No | boolean | true | true, false | Automatically rewrites and enriches your prompt with an LLM before generation to improve results. |
| enable_safety_checker | No | boolean | true | true, false | Turns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it. |
| seed | No | integer | — | 0–2147483647 | Random seed for reproducibility. Reuse the same seed with identical inputs to reproduce a result; omit for a random seed each request. |
| num_images | No | integer | 1 | 1–4 | Number of images to generate in a single request. |
| output_format | No | string | png | png, jpeg, webp | 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 |
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 API Pricing
Qwen Image Edit API Documentation
https://gateway.pixazo.ai/qwen-image/v1/generateMultimodeTextToImageEditRequest
Image Edit(Img2Img) - Qwen Image API
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 | Default | Allowed values / range | Description |
|---|---|---|---|---|---|
| model | Yes | string | — | qwen-image-edit | Model to use for this operation. Available value: "qwen-image-edit" (Qwen image editing model). |
| input | Yes | object | — | — | Container for the request payload. Holds the messages array. |
| input.messages | Yes | array | — | exactly 1 message object | Message list describing the edit. Only single-turn requests are supported, so the array must contain exactly one message object. |
| input.messages[].role | Yes | string | — | user | Role of the message sender. Must be "user" for image editing requests. |
| input.messages[].content | Yes | array | — | 1 image item + 1 text item | Content items for the message: one image item ({"image": "..."}) and one editing instruction ({"text": "..."}). The qwen-image-edit model edits a single image per request (multi-image input is only available on the qwen-image-edit-plus / -max series). |
| input.messages[].content[].image | Yes | string | — | JPG, JPEG, PNG, BMP, TIFF, WEBP, GIF · < 10 MB · 384–3072 px per side | Input image to edit. Either a publicly accessible HTTP/HTTPS URL or Base64 data in the form data:{MIME_type};base64,{base64_data}. For animated GIFs only the first frame is processed. The generated image is returned as PNG. |
| input.messages[].content[].text | Yes | string | — | ≤ 800 tokens | Editing instruction describing the desired changes (English or Chinese). Supports text editing, colour and style changes, and adding, removing or moving objects. Text beyond the limit is truncated. |
| parameters | No | object | — | — | Optional controls for the image generation. |
| parameters.negative_prompt | No | string | — | ≤ 500 characters | Describes content that should NOT appear in the edited image (for example "low resolution, blurry, extra fingers"). Empty by default. |
| parameters.watermark | No | boolean | false | true, false | Whether to add the "Qwen-Image" watermark to the bottom-right corner of the edited image. |
| parameters.seed | No | integer | random | 0 – 2147483647 | Random seed used for generation. Reuse the same seed with the same input to get repeatable results. If omitted, a random seed is used. |
Content Item Types & Limits
| Type | Max | Format / Size | Description |
|---|---|---|---|
| image | — | JPG, PNG, WEBP · < 10 MB | Image(s) to edit. |
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 API Pricing
Qwen Image Edit 2509 API Documentation
https://gateway.pixazo.ai/qwen-image-lite/v1/qwen-image-lite-request
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 Edit Request - Qwen Image Edit
Request Code
POST https://gateway.pixazo.ai/qwen-image-lite/v1/qwen-image-lite-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY
{
"image_url": "https://your-host.com/input.png",
"prompt": "Add a small bright red party hat on top, keep everything else identical",
"negative_prompt": "",
"num_inference_steps": 4,
"true_cfg_scale": 1.0,
"guidance_scale": 1.0,
"seed": 42,
"num_images": 1,
"output_format": "png"
}
import requests
url = "https://gateway.pixazo.ai/qwen-image-lite/v1/qwen-image-lite-request"
headers = {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
"image_url": "https://your-host.com/input.png",
"prompt": "Add a small bright red party hat on top, keep everything else identical",
"negative_prompt": "",
"num_inference_steps": 4,
"true_cfg_scale": 1.0,
"guidance_scale": 1.0,
"seed": 42,
"num_images": 1,
"output_format": "png"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/qwen-image-lite/v1/qwen-image-lite-request';
const headers = {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
image_url: 'https://your-host.com/input.png',
prompt: 'Add a small bright red party hat on top, keep everything else identical',
negative_prompt: '',
num_inference_steps: 4,
true_cfg_scale: 1.0,
guidance_scale: 1.0,
seed: 42,
num_images: 1,
output_format: '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-lite/v1/qwen-image-lite-request" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
"image_url": "https://your-host.com/input.png",
"prompt": "Add a small bright red party hat on top, keep everything else identical",
"negative_prompt": "",
"num_inference_steps": 4,
"true_cfg_scale": 1.0,
"guidance_scale": 1.0,
"seed": 42,
"num_images": 1,
"output_format": "png"
}'
Output
{
"request_id": "qwen-image-lite_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-lite_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Webhook (Optional)
Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.
Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.
Webhook Headers
| Header | Required | Default | Description |
|---|---|---|---|
X-Webhook-URL | Yes (to enable) | — | HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed). |
X-Webhook-Mode | No | terminal | terminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates. |
Example: enable webhook
X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal
Callback Payload
Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):
{
"request_id": "qwen-image-lite_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "COMPLETED",
"model_id": "qwen-image-lite",
"error": null,
"output": {
"media_url": [
"https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-lite_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
],
"media_type": "image/png"
},
"created_at": "2026-05-22T13:17:32.110Z",
"updated_at": "2026-05-22 13:19:23",
"completed_at": "2026-05-22 13:19:23"
}
Failure callback shape
{
"request_id": "qwen-image-lite_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "ERROR",
"model_id": "qwen-image-lite",
"error": "Description of the error",
"output": null,
"created_at": "...",
"updated_at": "...",
"completed_at": "..."
}
Delivery semantics
- terminal mode (default) — exactly one
POSTwhen the request reaches a terminal status. No callback duringPROCESSING. - sync mode —
POSTon every status poll (with delay capped at ~15s) plus a finalPOSTat terminal status. Use when you want progress updates. - Idempotency — use
request_idas your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates. - Response — respond
200 OKwithin a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries. - HTTPS required — plain
http://URLs are rejected.
Request Parameters - Qwen Image Edit Request
| Parameter | Required | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|---|
| image_url | Yes (one source) | string | — | Public http(s) URL | Source image to edit. Recommended. Provide exactly one image source — image_url, image_base64, or image_urls. |
| image_base64 | Yes (one source) | string | — | Raw base64 (no data: prefix) | Base64-encoded source image. Alternative to image_url. |
| image_urls | Yes (one source) | array of strings | — | Array of public URLs (1 – 3 recommended) | One or more source image URLs (multi-image edit). Qwen-Image-Edit-2509 is tuned for 1–3 reference images (e.g. person + product, person + scene); more images may degrade quality. Alternative to image_url. |
| prompt | Yes | string | — | Any text | Edit instruction describing the change. Be specific for best results. |
| negative_prompt | No | string | " " (space) | Any text | Concepts to steer away from in the output. Only takes effect when true_cfg_scale is greater than 1.0 — at the default true_cfg_scale of 1.0 the negative prompt is ignored. |
| num_inference_steps | No | integer | 4 | ≥ 1 | Denoising steps. This Lightning model is tuned for 4 steps; higher values rarely improve quality. |
| true_cfg_scale | No | number | 1.0 | ≥ 1.0 | True classifier-free guidance scale — the control that actually affects prompt adherence. 1.0 (default) disables CFG, which is what the 4-step Lightning schedule expects. Set it above 1.0 together with a negative_prompt to enable CFG: stronger prompt adherence, but roughly 2× slower and often lower image quality. |
| guidance_scale | No | number | 1.0 | ≥ 1.0 | Embedded (distillation) guidance value. It is accepted for compatibility but has no effect on this pipeline — raising it will not increase prompt adherence. Use true_cfg_scale instead. |
| seed | No | integer | 42 | Any integer | Random seed for reproducible results. |
| num_images | No | integer | 1 | 1 – 4 | Number of edited images to generate. |
| output_format | No | string | png | png, jpg | Output image format. |
Content Item Types & Limits
| Type | Max | Format / Size | Description |
|---|---|---|---|
| image_url | 1 | JPG, PNG, WEBP · < 10 MB | Image to edit. |
| image_urls | — | JPG, PNG, WEBP · < 10 MB | Additional reference image(s). |
Minimum Request
{
"image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/upscaler_019ed0c8-bb34-7854-afbc-b2a164758a15b/output.png",
"prompt": "Add a small bright red party hat on top"
}
Full Request (all options)
{
"image_url": "https://your-host.com/input.png",
"prompt": "Add a small bright red party hat on top, keep everything else identical",
"negative_prompt": "",
"num_inference_steps": 4,
"true_cfg_scale": 1.0,
"guidance_scale": 1.0,
"seed": 42,
"num_images": 1,
"output_format": "png"
}
Response
{
"request_id": "qwen-image-lite_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "QUEUED",
"polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-lite_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 Edit 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 |
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-lite' not found or is disabled"
}
Error via Status/Webhook
{
"request_id": "qwen-image-lite_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "ERROR",
"model_id": "qwen-image-lite",
"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-lite_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Response (Completed)
{
"request_id": "qwen-image-lite_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "COMPLETED",
"model_id": "qwen-image-lite",
"error": null,
"output": {
"media_url": [
"https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-lite_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
],
"media_type": "image/png"
},
"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 Edit 2509 API Pricing
Qwen Image API Documentation
https://gateway.pixazo.ai/qwen-image/v1/generateMultimodeTextToImageRequest
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
| Parameter | Required | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|---|
| model | Yes | string | — | qwen-image | Model to call. This endpoint serves Qwen-Image text-to-image generation, so pass "qwen-image". |
| input.messages | Yes | array | — | exactly 1 message | Message array carrying the request. Only single-turn generation is supported, so it must contain exactly one message object. |
| input.messages[].role | Yes | string | — | user | Role of the message sender. Fixed value "user". |
| input.messages[].content | Yes | array | — | exactly 1 text object | Content array for the message. It must contain exactly one text object — omitting it, or passing more than one, returns an error. |
| input.messages[].content[].text | Yes | string | — | up to 800 tokens | Positive prompt describing the content, style and composition you want. Chinese and English are supported, and the model is particularly strong at rendering text inside the image. |
| parameters.negative_prompt | No | string | — | up to 500 characters | Describes what you do not want to see in the image, for example "blurry, extra fingers, low quality". Chinese and English are supported. |
| parameters.size | No | string | 1664*928 | 1664*928 (16:9), 1472*1104 (4:3), 1328*1328 (1:1), 1104*1472 (3:4), 928*1664 (9:16) | Output resolution, written as "width*height". This model accepts only the five sizes listed; custom dimensions are not supported. |
| parameters.prompt_extend | No | boolean | true | true, false | Lets the model rewrite and enrich a short prompt with extra detail before generating. Set false when you want your prompt followed exactly. |
| parameters.watermark | No | boolean | false | true, false | Adds a "Qwen-Image" watermark to the bottom-right corner of the generated image. |
| parameters.seed | No | integer | random | 0 – 2147483647 | Random seed. Reusing the same seed with the same prompt and settings keeps results relatively stable; leave it out to get a different image each time. |
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 API Pricing
Qwen LoRA v1 API Documentation
https://gateway.pixazo.ai/qwen-image-edit-plus/v1/qwen-image-edit-plus-lora/generate
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 submit request to receive a POST callback when the job completes — no polling required.
Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.
Webhook Headers
| Header | Required | Default | Description |
|---|---|---|---|
X-Webhook-URL | Yes (to enable) | — | HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed). |
X-Webhook-Mode | No | terminal | terminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates. |
Example: enable webhook
X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal
Callback Payload
Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):
{
"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-xxxx-xxxx-xxxxxxxxxxxx/output.png"
],
"media_type": "image/png"
},
"created_at": "2026-05-22T13:17:32.110Z",
"updated_at": "2026-05-22 13:19:23",
"completed_at": "2026-05-22 13:19:23"
}
Failure callback shape
{
"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,
"created_at": "...",
"updated_at": "...",
"completed_at": "..."
}
Delivery semantics
- terminal mode (default) — exactly one
POSTwhen the request reaches a terminal status. No callback duringPROCESSING. - sync mode —
POSTon every status poll (with delay capped at ~15s) plus a finalPOSTat terminal status. Use when you want progress updates. - Idempotency — use
request_idas your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates. - Response — respond
200 OKwithin a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries. - HTTPS required — plain
http://URLs are rejected.
Request Parameters - Generate Image Edit Request
| Parameter | Required | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|---|
| prompt | Yes | string | — | — | The text instruction describing the edit you want applied to the input image(s). |
| image_urls | Yes | array | — | — | Publicly accessible URLs of the images to edit. Provide one or more reference images (or Base64 data URIs). |
| loras | No | array | [] (no LoRA) | up to 3 entries | LoRA weights to apply on top of the base model. Each entry is an object with path (required — URL of the LoRA weights) and scale (number, default 1, range 0-4). Up to 3 LoRAs are merged together for the final image. |
| image_size | No | string or object | size of the final input image | square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, or a custom {"width": …, "height": …} object (1-14142 px per side) | Size of the generated image. If omitted, the size of the final input image is used. |
| num_inference_steps | No | integer | 28 | 2-50 | Number of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster. |
| seed | No | integer | — | — | Random seed that controls the generation's randomness. Reuse the same seed with identical settings to reproduce the same result; leave it empty for a different output each time. |
| guidance_scale | No | number | 4 | 0-20 | CFG scale — controls how closely the output follows your prompt (prompt adherence). Higher values stick more strictly to the prompt; lower values allow more creative variation. |
| num_images | No | integer | 1 | 1-4 | Number of images to generate in a single request. |
| output_format | No | string | png | png, jpeg | The file format of the generated image. |
| negative_prompt | No | string | " " (a single space) | — | A description of elements to avoid in the generated image. |
| acceleration | No | string | regular | none, regular | Acceleration level for image generation. "regular" balances speed and quality; "none" disables acceleration. |
| enable_safety_checker | No | boolean | true | true, false | Turns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it. |
| webhook | No | string | — | — | Webhook URL for async notifications |
| webhook_events_filter | No | array | — | — | Event types to receive: ["start"], ["complete"], ["*"] |
Content Item Types & Limits
| Type | Max | Format / Size | Description |
|---|---|---|---|
| image | — | JPG, PNG, WEBP · < 10 MB | Image(s) to edit. |
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 API Pricing
Qwen LoRA v1 API Documentation
https://gateway.pixazo.ai/qwen-image-edit-plus-trainer/v1/qwen-image-edit-plus-trainer/generate
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 submit request to receive a POST callback when the job completes — no polling required.
Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.
Webhook Headers
| Header | Required | Default | Description |
|---|---|---|---|
X-Webhook-URL | Yes (to enable) | — | HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed). |
X-Webhook-Mode | No | terminal | terminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates. |
Example: enable webhook
X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal
Callback Payload
Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):
{
"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-xxxx-xxxx-xxxxxxxxxxxx/output.png"
],
"media_type": "image/png"
},
"created_at": "2026-05-22T13:17:32.110Z",
"updated_at": "2026-05-22 13:19:23",
"completed_at": "2026-05-22 13:19:23"
}
Failure callback shape
{
"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,
"created_at": "...",
"updated_at": "...",
"completed_at": "..."
}
Delivery semantics
- terminal mode (default) — exactly one
POSTwhen the request reaches a terminal status. No callback duringPROCESSING. - sync mode —
POSTon every status poll (with delay capped at ~15s) plus a finalPOSTat terminal status. Use when you want progress updates. - Idempotency — use
request_idas your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates. - Response — respond
200 OKwithin a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries. - HTTPS required — plain
http://URLs are rejected.
Request Parameters - Training Request
| Parameter | Required | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|---|
| image_data_url | Yes | string | — | — | URL to the ZIP archive of training data. The ZIP holds image pairs named ROOT_start.EXT / ROOT_end.EXT (e.g. photo_start.jpg and photo_end.jpg). Extra reference images per pair are named ROOT_start2.EXT, ROOT_start3.EXT, … and an optional ROOT.txt per pair supplies that pair's edit instruction. |
| learning_rate | No | number | 0.0001 | — | Learning rate for the LoRA parameters. Lower values train more slowly but more reliably; higher values train faster but risk instability. |
| steps | No | integer | 1000 | 1-30000 | Number of training steps to run. More steps generally improve fidelity but increase training time and cost. |
| default_caption | No | string | — | — | Caption used for any image pair that has no ROOT.txt caption file. If it is omitted and a caption file is missing, the training run fails. |
| reference_image_count | No | integer | — | — | Number of reference images supplied per training pair in the ZIP archive (the ROOT_start2/ROOT_start3 files). |
| 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://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/upscaler_019ed0c8-bb34-7854-afbc-b2a164758a15b/output.png",
"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 API Pricing
Qwen LoRA v1 API Documentation
https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request
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 submit request to receive a POST callback when the job completes — no polling required.
Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.
Webhook Headers
| Header | Required | Default | Description |
|---|---|---|---|
X-Webhook-URL | Yes (to enable) | — | HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed). |
X-Webhook-Mode | No | terminal | terminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates. |
Example: enable webhook
X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal
Callback Payload
Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):
{
"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-xxxx-xxxx-xxxxxxxxxxxx/output.png"
],
"media_type": "image/png"
},
"created_at": "2026-05-22T13:17:32.110Z",
"updated_at": "2026-05-22 13:19:23",
"completed_at": "2026-05-22 13:19:23"
}
Failure callback shape
{
"request_id": "qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "ERROR",
"model_id": "qwen-image-layered",
"error": "Description of the error",
"output": null,
"created_at": "...",
"updated_at": "...",
"completed_at": "..."
}
Delivery semantics
- terminal mode (default) — exactly one
POSTwhen the request reaches a terminal status. No callback duringPROCESSING. - sync mode —
POSTon every status poll (with delay capped at ~15s) plus a finalPOSTat terminal status. Use when you want progress updates. - Idempotency — use
request_idas your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates. - Response — respond
200 OKwithin a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries. - HTTPS required — plain
http://URLs are rejected.
Request Parameters - Qwen Image Layered generate request
| Parameter | Required | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|---|
| image_url | Yes | string | — | — | The input image to be decomposed into layers. Must be a publicly accessible URL reachable by the server. |
| prompt | No | string | — | — | Optional caption describing the input image. A short, accurate caption helps the model separate the layers more reliably. |
| num_layers | No | integer | 4 | 1-10 | Number of layers to decompose the input image into. |
| num_inference_steps | No | integer | 28 | 1-50 | Number of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster. |
| guidance_scale | No | number | 5 | 1-20 | Controls how closely the output follows your prompt (prompt adherence). Higher values stick more strictly to the prompt; lower values allow more creative variation. |
| num_images | No | integer | 1 | 1 | Number of layer sets to generate (currently only 1 is supported). |
| negative_prompt | No | string | "" (empty) | — | A description of elements to avoid in the generated layers. |
| seed | No | integer | — | — | Random seed that controls the generation's randomness. Reuse the same seed with identical settings to reproduce the same result; leave it empty for a different output each time. |
| acceleration | No | string | regular | none, regular, high | Acceleration level for generation. "high" is fastest, "regular" balances speed and quality, "none" disables acceleration. |
| enable_safety_checker | No | boolean | true | true, false | Turns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it. |
| output_format | No | string | png | png, webp | The file format of the generated layers. Use png to preserve transparency. |
Content Item Types & Limits
| Type | Max | Format / Size | Description |
|---|---|---|---|
| image | 1 | JPG, PNG, WEBP · < 10 MB | Image to decompose into layers. |
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.