Pixazo APIModelsQwen Image
Pixazo APIModelsQwen Image

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.

Get API Key
Qwen AI API

Models Version

WELCOME BONUS

Get $5 Free Credit on First Payment

No strings attached — add funds and get $5 bonus instantly

Claim Your $5 →

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

HeaderRequiredDefaultDescription
X-Webhook-URLYes (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-ModeNoterminalterminal — 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 POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within 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

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringMax 800 charactersText prompt describing the desired edit. Supports Chinese and English. Be specific about the change (subject, context, lighting, environment).
negative_promptNostring""Max 500 charactersDescribes unwanted elements or artifacts to avoid in the output. Improves quality by exclusion.
image_sizeNostring or objectsquare_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, or a custom {width, height} objectDimensions of the generated image. If omitted, the size of the input image is used.
enable_prompt_expansionNobooleantruetrue, falseAutomatically rewrites and enriches your prompt with extra detail before generation to improve results.
seedNointeger0–2147483647Random seed for reproducible results. Reuse the same seed with the same inputs to regenerate a similar image.
enable_safety_checkerNobooleantruetrue, falseTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
sync_modeNobooleanfalsetrue, falseWhen 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_imagesNointeger11–6Number of edited images to generate. Must be between 1 and 6.
output_formatNostringpngpng, jpeg, webpOutput image format. Supported values: png, jpeg, webp.
image_urlsYesarray of strings1–3 image URLsPublic 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

TypeMaxFormat / SizeDescription
imageJPG, PNG, WEBP · < 10 MBImage(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
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal Server Error

Notes & Tips

  1. Poll the results endpoint every 2–3 seconds until status is COMPLETED or FAILED
  2. Implement exponential backoff for retry logic on 500 or 429 responses
  3. Use clear, specific prompts that describe the desired change in context, lighting, or environment
  4. Avoid overly vague prompts like “make it better”; specify elements such as “replace sky with sunset”
  5. Validate image URLs are publicly accessible and use HTTPS before submission
  6. 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_KEY

    cURL 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

    FieldTypeDescription
    request_idstringUnique request identifier
    statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
    model_idstringModel that processed the request
    errorstring|nullError message if failed
    output.media_urlarrayURLs to generated media (R2 CDN)
    output.media_typestringMIME type of the output
    created_atstringWhen request was created
    completed_atstring|nullWhen request completed
    polling_urlstringStatus URL (initial response only)

    Status Values

    StatusDescription
    QUEUEDRequest accepted, waiting to be processed
    PROCESSINGBeing processed by the model
    COMPLETEDDone — output contains the result
    FAILEDFailed — check error field
    ERRORSystem error — not charged

    Status Flow

    QUEUED → PROCESSING → COMPLETED
                        → FAILED
                        → ERROR

    Typical Workflow

    1. Send a generate request to the API endpoint
    2. Save the request_id from the response
    3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
    4. When status is "COMPLETED", download from output.media_url

    Tip: Use X-Webhook-URL header to get a callback instead of polling.

Qwen Image Max Edit API Pricing

Your request will cost $0.075 per image.
2. Qwen Image Max t2i

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

HeaderRequiredDefaultDescription
X-Webhook-URLYes (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-ModeNoterminalterminal — 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 POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within 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

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringA detailed text description of the desired image. Supports English and Chinese; up to 800 characters. Be specific about subjects, styles, lighting, and composition.
negative_promptNostringA description of elements to avoid in the generated image (up to 500 characters). Helps refine output quality by excluding unwanted features.
image_sizeNostringsquare_hdsquare_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9The resolution and aspect ratio of the output image. Choose one of the preset enum values, or pass a custom {width, height} object.
enable_prompt_expansionNobooleantruetrue, falseAutomatically rewrites and enriches your prompt with an LLM before generation to improve results.
enable_safety_checkerNobooleantruetrue, falseTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
seedNointeger0–2147483647Random seed for reproducibility. Reuse the same seed with identical inputs to reproduce a result; omit for a random seed each request.
num_imagesNointeger11–4Number of images to generate in a single request.
output_formatNostringpngpng, jpeg, webpThe 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
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
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

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Qwen Image Max t2i API Pricing

Your request will cost $0.075 per image.
3. Qwen Image Edit

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)

ParameterRequiredTypeDefaultAllowed values / rangeDescription
modelYesstringqwen-image-editModel to use for this operation. Available value: "qwen-image-edit" (Qwen image editing model).
inputYesobjectContainer for the request payload. Holds the messages array.
input.messagesYesarrayexactly 1 message objectMessage list describing the edit. Only single-turn requests are supported, so the array must contain exactly one message object.
input.messages[].roleYesstringuserRole of the message sender. Must be "user" for image editing requests.
input.messages[].contentYesarray1 image item + 1 text itemContent 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[].imageYesstringJPG, JPEG, PNG, BMP, TIFF, WEBP, GIF · < 10 MB · 384–3072 px per sideInput 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[].textYesstring≤ 800 tokensEditing 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.
parametersNoobjectOptional controls for the image generation.
parameters.negative_promptNostring≤ 500 charactersDescribes content that should NOT appear in the edited image (for example "low resolution, blurry, extra fingers"). Empty by default.
parameters.watermarkNobooleanfalsetrue, falseWhether to add the "Qwen-Image" watermark to the bottom-right corner of the edited image.
parameters.seedNointegerrandom0 – 2147483647Random 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

TypeMaxFormat / SizeDescription
imageJPG, PNG, WEBP · < 10 MBImage(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-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes for Image Edit(Img2Img).

Code Meaning
200 Success
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal Server Error

Qwen Image Edit API Pricing

Your request will cost $0.045 per image.
4. Qwen Image Edit 2509

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

HeaderRequiredDefaultDescription
X-Webhook-URLYes (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-ModeNoterminalterminal — 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 POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within 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

TypeMaxFormat / SizeDescription
image_url1JPG, PNG, WEBP · < 10 MBImage to edit.
image_urlsJPG, PNG, WEBP · < 10 MBAdditional 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
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
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

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Qwen Image Edit 2509 API Pricing

Your request is Free
5. Qwen Image

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

ParameterRequiredTypeDefaultAllowed values / rangeDescription
modelYesstringqwen-imageModel to call. This endpoint serves Qwen-Image text-to-image generation, so pass "qwen-image".
input.messagesYesarrayexactly 1 messageMessage array carrying the request. Only single-turn generation is supported, so it must contain exactly one message object.
input.messages[].roleYesstringuserRole of the message sender. Fixed value "user".
input.messages[].contentYesarrayexactly 1 text objectContent array for the message. It must contain exactly one text object — omitting it, or passing more than one, returns an error.
input.messages[].content[].textYesstringup to 800 tokensPositive 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_promptNostringup to 500 charactersDescribes what you do not want to see in the image, for example "blurry, extra fingers, low quality". Chinese and English are supported.
parameters.sizeNostring1664*9281664*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_extendNobooleantruetrue, falseLets the model rewrite and enrich a short prompt with extra detail before generating. Set false when you want your prompt followed exactly.
parameters.watermarkNobooleanfalsetrue, falseAdds a "Qwen-Image" watermark to the bottom-right corner of the generated image.
parameters.seedNointegerrandom0 – 2147483647Random 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
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal Server Error

Qwen Image API Pricing

Your request will cost $0.045 per image.
6. Qwen LoRA v1

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.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour 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

HeaderRequiredDefaultDescription
X-Webhook-URLYes (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-ModeNoterminalterminal — 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 POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within 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

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringThe text instruction describing the edit you want applied to the input image(s).
image_urlsYesarrayPublicly accessible URLs of the images to edit. Provide one or more reference images (or Base64 data URIs).
lorasNoarray[] (no LoRA)up to 3 entriesLoRA 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_sizeNostring or objectsize of the final input imagesquare_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_stepsNointeger282-50Number of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster.
seedNointegerRandom 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_scaleNonumber40-20CFG 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_imagesNointeger11-4Number of images to generate in a single request.
output_formatNostringpngpng, jpegThe file format of the generated image.
negative_promptNostring" " (a single space)A description of elements to avoid in the generated image.
accelerationNostringregularnone, regularAcceleration level for image generation. "regular" balances speed and quality; "none" disables acceleration.
enable_safety_checkerNobooleantruetrue, falseTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
webhookNostringWebhook URL for async notifications
webhook_events_filterNoarrayEvent types to receive: ["start"], ["complete"], ["*"]

Content Item Types & Limits

TypeMaxFormat / SizeDescription
imageJPG, PNG, WEBP · < 10 MBImage(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-Typeapplication/json

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal 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

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Qwen LoRA v1 API Pricing

Your request will cost $0.055 per image.
Image to Image (LoRA Trainer)

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.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour 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

HeaderRequiredDefaultDescription
X-Webhook-URLYes (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-ModeNoterminalterminal — 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 POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within 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

ParameterRequiredTypeDefaultAllowed values / rangeDescription
image_data_urlYesstringURL 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_rateNonumber0.0001Learning rate for the LoRA parameters. Lower values train more slowly but more reliably; higher values train faster but risk instability.
stepsNointeger10001-30000Number of training steps to run. More steps generally improve fidelity but increase training time and cost.
default_captionNostringCaption 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_countNointegerNumber of reference images supplied per training pair in the ZIP archive (the ROOT_start2/ROOT_start3 files).
webhookNostringWebhook URL for training completion notifications
webhook_events_filterNoarrayEvent 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-Typeapplication/json
Ocp-Apim-Subscription-KeyYour subscription key

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal 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

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Qwen LoRA v1 API Pricing

Your request will cost $0.04 per LoRA training job.
Image to Image (Image Editing — Layered)

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.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour 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

HeaderRequiredDefaultDescription
X-Webhook-URLYes (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-ModeNoterminalterminal — 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 POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within 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

ParameterRequiredTypeDefaultAllowed values / rangeDescription
image_urlYesstringThe input image to be decomposed into layers. Must be a publicly accessible URL reachable by the server.
promptNostringOptional caption describing the input image. A short, accurate caption helps the model separate the layers more reliably.
num_layersNointeger41-10Number of layers to decompose the input image into.
num_inference_stepsNointeger281-50Number of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster.
guidance_scaleNonumber51-20Controls how closely the output follows your prompt (prompt adherence). Higher values stick more strictly to the prompt; lower values allow more creative variation.
num_imagesNointeger11Number of layer sets to generate (currently only 1 is supported).
negative_promptNostring"" (empty)A description of elements to avoid in the generated layers.
seedNointegerRandom 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.
accelerationNostringregularnone, regular, highAcceleration level for generation. "high" is fastest, "regular" balances speed and quality, "none" disables acceleration.
enable_safety_checkerNobooleantruetrue, falseTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
output_formatNostringpngpng, webpThe file format of the generated layers. Use png to preserve transparency.

Content Item Types & Limits

TypeMaxFormat / SizeDescription
image1JPG, PNG, WEBP · < 10 MBImage 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-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal 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

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Qwen LoRA v1 API Pricing

Your request will cost $0.05 per image.