# Qwen AI API

> Provider: **Alibaba**
> Source: https://www.pixazo.ai/models/qwen-image

Comprehensive AI suite including image, text, and audio capabilities by Alibaba.

## Qwen Image Max Edit

### Image to Image (Image Editing)

## Base URL

```
https://gateway.pixazo.ai/qwen-image-max-edit/v1
```

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Qwen Image Max Edit generate request - Qwen Image Max Edit

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=qwen-image-max-edit&operation=qwen-image-max-edit-request)

## Webhook (Optional)

Add the `X-Webhook-URL` header to your generate request to receive a POST callback instead of polling.

```
X-Webhook-URL: https://your-server.com/webhook/callback
```

## Request Parameters - Qwen Image Max Edit generate request

Field

Type

Required

Default

Description

prompt

string

Yes

—

Detailed text description of the desired image edit. Specifies what changes to apply to the input image.

negative\_prompt

string

No

—

Describes unwanted elements or artifacts to avoid in the output. Improves output quality by exclusion.

enable\_prompt\_expansion

boolean

No

true

Enables AI-driven expansion of the prompt for richer, more detailed interpretations.

enable\_safety\_checker

boolean

No

true

Activates content safety filtering to block inappropriate or harmful outputs.

num\_images

integer

No

1

Number of edited images to generate. Must be between 1 and 4.

output\_format

string

No

png

Output image format. Supported values: png, jpeg, webp.

image\_urls

array of strings

Yes

—

Array of one or more public HTTP URLs pointing to the source images to be edited. Only the first URL is processed if multiple are provided.

## Minimum Request

```
{
  "prompt": "Transform the background into a serene mountain landscape with snow-capped peaks and a clear blue sky",
  "image_urls": [
    "https://imagesai.appypie.com/7686410/JUEOHp2Y3FDjmXwOQJVy_017731476841749.png"
  ]
}
```

## Full Request (all options)

```
{
  "prompt": "Transform the background into a serene mountain landscape with snow-capped peaks and a clear blue sky",
  "negative_prompt": "low resolution, error, worst quality, low quality, deformed",
  "enable_prompt_expansion": true,
  "enable_safety_checker": true,
  "num_images": 1,
  "output_format": "png",
  "image_urls": [
    "https://imagesai.appypie.com/7686410/JUEOHp2Y3FDjmXwOQJVy_017731476841749.png"
  ]
}
```

## Response

```
{
  "request_id": "qwen-image-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

## Request Headers

Header

Value

Content-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

Your API subscription key

## Response Handling

Common status codes for Qwen Image Max Edit generate request.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

Too Many Requests

500

Internal Server Error

## Notes & Tips

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
    
    ## Response Handling
    
    Common status codes.
    
    Code
    
    Meaning
    
    202
    
    Accepted — Request queued
    
    400
    
    Bad Request
    
    401
    
    Unauthorized
    
    402
    
    Insufficient Balance
    
    403
    
    Forbidden
    
    429
    
    Too Many Requests
    
    500
    
    Internal Server Error
    
    ## Error Responses
    
    Queue system errors and model validation errors.
    
    ### Queue System Errors
    
    ```
    // 402 — Insufficient balance
    {
      "error": "Insufficient Balance",
      "message": "Your wallet does not have enough balance."
    }
    ```
    
    ```
    // 400 — Model not found
    {
      "error": "Model not found",
      "message": "Model 'qwen-image-max-edit' not found or is disabled"
    }
    ```
    
    ### Error via Status/Webhook
    
    ```
    {
      "request_id": "qwen-image-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "status": "ERROR",
      "model_id": "qwen-image-max-edit",
      "error": "Description of the error",
      "output": null
    }
    ```
    
    ## Retrieving Results
    
    Poll the universal status endpoint to check progress and retrieve results.
    
    ### Endpoint
    
    ```
    GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
    Ocp-Apim-Subscription-Key: YOUR_API_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
    
    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
    
    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

### Text to Image

## Base URL

```
https://gateway.pixazo.ai/qwen-image-max/v1
```

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Qwen Image Max generate request - Qwen Image Max

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=qwen-image-max&operation=qwen-image-max-request)

## Webhook (Optional)

Add the `X-Webhook-URL` header to your generate request to receive a POST callback instead of polling.

```
X-Webhook-URL: https://your-server.com/webhook/callback
```

## Request Parameters - Qwen Image Max generate request

Field

Type

Required

Default

Description

prompt

string

Yes

—

A detailed text description of the desired image. Be specific about subjects, styles, lighting, and composition.

negative\_prompt

string

No

—

A description of elements to avoid in the generated image. Helps refine output quality by excluding unwanted features.

image\_size

string

No

square\_hd

The resolution and aspect ratio of the output image. Supported values: square\_hd, portrait\_hd, landscape\_hd.

enable\_prompt\_expansion

boolean

No

true

Enables AI-driven enhancement of the prompt for richer, more detailed generation.

enable\_safety\_checker

boolean

No

true

Activates content filtering to block inappropriate or harmful outputs.

num\_images

integer

No

1

Number of images to generate in a single request. Maximum value is 4.

output\_format

string

No

png

The file format of the generated image. Supported values: png, jpeg, webp.

## Minimum Request

```
{
  "prompt": "A majestic white tiger resting on a mossy rock beside a waterfall in a tropical rainforest, photorealistic"
}
```

## Full Request (all options)

```
{
  "prompt": "A majestic white tiger resting on a mossy rock beside a waterfall in a tropical rainforest, photorealistic",
  "negative_prompt": "low resolution, error, worst quality, low quality, deformed",
  "image_size": "square_hd",
  "enable_prompt_expansion": true,
  "enable_safety_checker": true,
  "num_images": 1,
  "output_format": "png"
}
```

## Response

```
{
  "request_id": "qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

## Request Headers

Header

Value

Content-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

Your API subscription key

## Response Handling

Common status codes for Qwen Image Max generate request.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

Too Many Requests

500

Internal Server Error

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal Server Error

## Error Responses

Queue system errors and model validation errors.

### Queue System Errors

```
// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
```

```
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'qwen-image-max' not found or is disabled"
}
```

### Error via Status/Webhook

```
{
  "request_id": "qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "qwen-image-max",
  "error": "Description of the error",
  "output": null
}
```

## Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

### Endpoint

```
GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY
```

## cURL Example

```
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```

## Response (Completed)

```
{
  "request_id": "qwen-image-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "qwen-image-max",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-max_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}
```

## Response Fields

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System error — not charged

## Status Flow

```
QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR
```

## Typical Workflow

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

### Image to Image (Image Editing)

## Image Edit(Img2Img) - Qwen Image API

## Request Code

HTTP Python JavaScript cURL

```
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"
            }
          ]
        }
      }
    ]
  }
}
```

[Try Now](https://api.pixazo.ai/api-details#api=qwen-image-api&operation=image-edit)

## Request Parameters - Image Edit(Img2Img)

Parameter

Required

Type

Description

model

Yes

string

Model to use. Available value: "qwen-image-edit" (Qwen image editing model).

input.messages

Yes

array

Array of message objects containing the image editing request. Must contain at least one user message.

input.messages\[\].role

Yes

string

Role of the message sender. Must be "user" for image editing requests.

input.messages\[\].content

Yes

array

Array of content objects containing both the input image and editing instructions.

input.messages\[\].content\[\].image

Yes

string

Input image for editing. Can be a publicly accessible HTTP/HTTPS URL or Base64-encoded image data in format data:{MIME\_type};base64,{base64\_data}.

input.messages\[\].content\[\].text

Yes

string

Text instructions describing the desired edits. Supports complex editing tasks including text editing, color adjustment, style transfer, and object manipulation.

parameters.negative\_prompt

No

string

Negative prompt to specify what should not appear in the edited image. Default: "" (empty string).

parameters.watermark

No

boolean

Whether to add a watermark to the edited image. Default: false.

## Example Request

```
{
  "model": "qwen-image-edit",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/manwithbear.jpg"
          },
          {
            "text": "Change the person to a walking position, bending over to hold the bear's front paws."
          }
        ]
      }
    ]
  },
  "parameters": {
    "negative_prompt": "",
    "watermark": false
  }
}
```

## Response

```
{
  "status_code": 200,
  "request_id": "3daccb10-10ca-9399-8b6a-xxxxxx",
  "code": "",
  "message": "",
  "output": {
    "text": null,
    "finish_reason": null,
    "choices": [
      {
        "finish_reason": "stop",
        "message": {
          "role": "assistant",
          "content": [
            {
              "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/qwen-image-edit/qwen-image-edit-3daccb10-10ca-9399-8b6a-xxxxxx-1703123456789.png"
            }
          ]
        }
      }
    ]
  },
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "width": 1248,
    "image_count": 1,
    "height": 832
  }
}
```

## Request Headers

Header

Value

Content-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes for Image Edit(Img2Img).

Code

Meaning

200

Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

Too Many Requests

500

Internal Server Error

## Qwen Image

### Text to Image

## Base URL

```
https://gateway.pixazo.ai/qwen-image/v1
```

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Text To Image Request - Qwen Image API

## Request Code

HTTP Python JavaScript cURL

```
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": ""
}
```

[Try Now](https://api.pixazo.ai/api-details#api=qwen-image&operation=text-to-image-request)

## Request Parameters - Text To Image Request

Field

Type

Required

Default

Description

model

string

Yes

—

Model to use. Available value: "qwen-image" (Qwen text-to-image generation model).

input.messages

array

Yes

—

Array of message objects containing the generation request. Must contain at least one user message.

input.messages\[\].role

string

Yes

—

Role of the message sender. Must be "user" for text-to-image generation requests.

input.messages\[\].content

array

Yes

—

Array of content objects containing the text prompt for image generation.

input.messages\[\].content\[\].text

string

Yes

—

Text prompt describing the image to generate. Supports complex descriptions, multi-line layouts, and fine-grained details. Excels at Chinese and English text rendering.

parameters.negative\_prompt

string

No

""

Negative prompt to specify what should not appear in the generated image.

parameters.prompt\_extend

boolean

No

true

Whether to extend and enhance the input prompt automatically.

parameters.watermark

boolean

No

true

Whether to add a watermark to the generated image.

parameters.size

string

No

1328\*1328

Output image dimensions in format "WIDTHxHEIGHT". Available sizes: "1328\*1328", "1024\*1024", "768\*768", "512\*512".

## Minimum Request

```
{
  "model": "qwen-image",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "text": "A serene lake at sunset, with mountains reflected in the water and a lone canoe on the shore."
          }
        ]
      }
    ]
  },
  "parameters": {
    "size": "1328*1328"
  }
}
```

## Full Request (all options)

```
{
  "model": "qwen-image",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "text": "A serene lake at sunset, with mountains reflected in the water and a lone canoe on the shore."
          }
        ]
      }
    ]
  },
  "parameters": {
    "negative_prompt": "",
    "prompt_extend": true,
    "watermark": true,
    "size": "1328*1328"
  }
}
```

## Response

```
{
  "images": [
    {
      "file_name": "nano-banana-pro-edit-output.png",
      "content_type": "image/png",
      "url": "[RESPONSE_URL]"
    }
  ],
  "description": ""
}
```

## Response Fields - Text To Image Request

Field

Type

Description

images

array

Array of generated image objects.

images\[\].file\_name

string

Name of the generated image file.

images\[\].content\_type

string

MIME type of the image, typically "image/png".

images\[\].url

string

URL where the generated image can be downloaded.

description

string

Optional descriptive text about the generated image, currently always empty.

## Request Headers

Header

Value

Content-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

Your API subscription key

## Response Handling

Common status codes for Text To Image Request.

Code

Meaning

200

Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

Too Many Requests

500

Internal Server Error

## Qwen LoRA v1

### Text to Image (LoRA)

## Base URL

```
https://gateway.pixazo.ai/qwen-image-edit-plus/v1
```

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Generate Image Edit Request - Qwen Image Edit Plus Lora API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=qwen-image-edit-plus-lora&operation=generate-request)

## Webhook (Optional)

Add the `X-Webhook-URL` header to your generate request to receive a POST callback instead of polling.

```
X-Webhook-URL: https://your-server.com/webhook/callback
```

## Request Parameters - Generate Image Edit Request

Parameter

Required

Type

Description

prompt

Yes

string

Text prompt describing the desired image edit or generation

image\_urls

Yes

array

Array of reference image URLs (1-10 images)

image\_size

No

string or object

Output image size (see Image Size Options below)

num\_inference\_steps

No

number

Number of inference steps (higher = better quality, slower)

seed

No

number

Random seed for reproducibility

guidance\_scale

No

number

CFG (Classifier Free Guidance) scale (1-20)

num\_images

No

number

Number of images to generate (1-4)

output\_format

No

string

Output format: "png" or "jpeg"

negative\_prompt

No

string

What to avoid in the generated image

acceleration

No

string

Acceleration level: "none" or "regular"

enable\_safety\_checker

No

boolean

Enable NSFW content safety checker

webhook

No

string

Webhook URL for async notifications

webhook\_events\_filter

No

array

Event types to receive: \["start"\], \["complete"\], \["\*"\]

## Example Request

```
{
  "prompt": "Close shot of a woman standing next to this car on this highway",
  "image_urls": [
    "https://example.com/reference1.png",
    "https://example.com/reference2.png",
    "https://example.com/reference3.png"
  ],
  "image_size": "square_hd",
  "num_inference_steps": 50,
  "guidance_scale": 4,
  "num_images": 1,
  "output_format": "png",
  "negative_prompt": " ",
  "acceleration": "regular",
  "enable_safety_checker": true
}
```

## Response

```
{
  "request_id": "qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

## Request Headers

Header

Value

Content-Type

application/json

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal Server Error

## Error Responses

Queue system errors and model validation errors.

### Queue System Errors

```
// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
```

```
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'qwen-image-edit-plus-lora' not found or is disabled"
}
```

### Error via Status/Webhook

```
{
  "request_id": "qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "qwen-image-edit-plus-lora",
  "error": "Description of the error",
  "output": null
}
```

## Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

### Endpoint

```
GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY
```

## cURL Example

```
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```

## Response (Completed)

```
{
  "request_id": "qwen-image-edit-plus-lora_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "qwen-image-edit-plus-lora",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-edit-plus-lora_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}
```

## Response Fields

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System error — not charged

## Status Flow

```
QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR
```

## Typical Workflow

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.

### Image to Image (LoRA Trainer)

## Base URL

```
https://gateway.pixazo.ai/qwen-image-edit-plus-trainer/v1
```

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Training Request - Qwen Image Edit Plus Trainer API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=qwen-image-edit-plus-trainer&operation=training-request)

## Webhook (Optional)

Add the `X-Webhook-URL` header to your generate request to receive a POST callback instead of polling.

```
X-Webhook-URL: https://your-server.com/webhook/callback
```

## Request Parameters - Training Request

Parameter

Required

Type

Description

image\_data\_url

Yes

string

URL to ZIP archive containing training image pairs

learning\_rate

No

number

Learning rate for LoRA parameters (0.0-1.0)

steps

No

number

Number of training steps (1-10000)

default\_caption

No

string

Default caption when caption files are missing

reference\_image\_count

No

number

Number of reference images per entry (1-10)

webhook

No

string

Webhook URL for training completion notifications

webhook\_events\_filter

No

array

Event types to receive ("\*" for all)

## Example Request

```
{
  "image_data_url": "https://example.com/lighting-training.zip",
  "learning_rate": 0.0002,
  "steps": 2000,
  "default_caption": "professional cinematic lighting with dramatic shadows",
  "reference_image_count": 2,
  "webhook": "https://your-domain.com/training-complete"
}
```

## Response

```
{
  "request_id": "qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

## Request Headers

Header

Value

Content-Type

application/json

Ocp-Apim-Subscription-Key

Your subscription key

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal Server Error

## Error Responses

Queue system errors and model validation errors.

### Queue System Errors

```
// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
```

```
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'qwen-image-edit-plus-trainer' not found or is disabled"
}
```

### Error via Status/Webhook

```
{
  "request_id": "qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "qwen-image-edit-plus-trainer",
  "error": "Description of the error",
  "output": null
}
```

## Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

### Endpoint

```
GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY
```

## cURL Example

```
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```

## Response (Completed)

```
{
  "request_id": "qwen-image-edit-plus-trainer_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "qwen-image-edit-plus-trainer",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-edit-plus-trainer_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}
```

## Response Fields

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System error — not charged

## Status Flow

```
QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR
```

## Typical Workflow

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.

### Image to Image (Image Editing — Layered)

## Base URL

```
https://gateway.pixazo.ai/qwen-image-layered/v1
```

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Qwen Image Layered generate request - Qwen Image Layered API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=qwen-image-layered-api&operation=qwen-image-layered-request)

## Webhook (Optional)

Add the `X-Webhook-URL` header to your generate request to receive a POST callback instead of polling.

```
X-Webhook-URL: https://your-server.com/webhook/callback
```

## Request Parameters - Qwen Image Layered generate request

Parameter

Required

Type

Description

image\_url

Yes

string

Publicly accessible URL of the input image to be decomposed into layers. Must be reachable by the server.

num\_inference\_steps

No

integer

Number of denoising steps during the decomposition process. Higher values yield finer details at the cost of processing time.

guidance\_scale

No

number

Controls the strength of the decomposition guidance. Higher values enforce stronger adherence to input structure.

num\_images

No

integer

Number of layer sets to generate (currently supports only 1).

enable\_safety\_checker

No

boolean

Enables content safety filtering to block potentially harmful or inappropriate outputs.

output\_format

No

string

Output format for the generated layers. Only "png" is currently supported to preserve transparency.

acceleration

No

string

Processing mode. Use "regular" for standard quality, "fast" for quicker but lower resolution outputs.

## Example Request

```
{
  "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg",
  "num_inference_steps": 28,
  "guidance_scale": 5.0,
  "num_images": 1,
  "enable_safety_checker": true,
  "output_format": "png",
  "acceleration": "regular"
}
```

## Response

```
{
  "request_id": "qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

## Request Headers

Header

Value

Content-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal Server Error

## Error Responses

Queue system errors and model validation errors.

### Queue System Errors

```
// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
```

```
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'qwen-image-layered' not found or is disabled"
}
```

### Error via Status/Webhook

```
{
  "request_id": "qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "qwen-image-layered",
  "error": "Description of the error",
  "output": null
}
```

## Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

### Endpoint

```
GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY
```

## cURL Example

```
curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```

## Response (Completed)

```
{
  "request_id": "qwen-image-layered_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "qwen-image-layered",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/qwen-image-layered_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}
```

## Response Fields

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System error — not charged

## Status Flow

```
QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR
```

## Typical Workflow

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.
