> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goenhance.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Qwen-Image 2.1

> Qwen-Image 2.1 in a single endpoint: text to image, editing with up to 10 reference images, transparent PNG output, and background removal. Omit `image_list` for text to image; pass it to edit. Always returns a single PNG.

**Pricing** — flat per image by resolution tier. Text to image, editing and transparent output cost the same, and reference images add nothing:

| image_size | Tokens | USD |
|---|---|---|
| 1K (about 1 MP, default) | 1 | $0.02 |
| 2K (about 4 MP, native) | 4 | $0.08 |

**Editing and reference images**

- Refer to the images in the prompt as `<image1>`, `<image2>` … in `image_list` order. `image1` is the image being edited; the rest are references.
- Up to 10 images at 1K. **At 2K the limit is 3**, because every reference is also encoded at 2K.
- With `ratio: auto` (the default when editing) the output keeps the aspect ratio of `image1`. Choosing a ratio far from `image1` can shift the edit.
- PNG references with transparency are read with their alpha channel.

**Transparent background** — set `background` to `transparent` for a PNG with an alpha channel, for both text to image and editing. To remove the background of one image, send one image in `image_list` with `background: transparent` and no prompt.

- Fully transparent pixels carry an arbitrary colour underneath. Composite the PNG over your own background before converting to JPEG, or the transparent area turns into a solid colour.
- Transparent materials such as glass or lenses come out opaque.
- For plain cut-outs, [Background Remover](/api-reference/image-api/background-remover) is cheaper and gives cleaner hair edges.

**Timing** — about 30 to 60 seconds of processing for 1K, and about 3 to 7 minutes for 2K, plus queue time.



## OpenAPI

````yaml api-reference/image-api/openapi-qwen-image-2-1.json POST /api/v1/images/generations
openapi: 3.1.0
info:
  title: GoEnhance API - Qwen-Image 3.0
  description: Qwen-Image 3.0
  version: 1.0.0
servers:
  - url: https://api.goenhance.ai
security: []
paths:
  /api/v1/images/generations:
    post:
      tags:
        - ImageAPI
      summary: Qwen-Image 2.1
      description: >-
        Qwen-Image 2.1 in a single endpoint: text to image, editing with up to
        10 reference images, transparent PNG output, and background removal.
        Omit `image_list` for text to image; pass it to edit. Always returns a
        single PNG.


        **Pricing** — flat per image by resolution tier. Text to image, editing
        and transparent output cost the same, and reference images add nothing:


        | image_size | Tokens | USD |

        |---|---|---|

        | 1K (about 1 MP, default) | 1 | $0.02 |

        | 2K (about 4 MP, native) | 4 | $0.08 |


        **Editing and reference images**


        - Refer to the images in the prompt as `<image1>`, `<image2>` … in
        `image_list` order. `image1` is the image being edited; the rest are
        references.

        - Up to 10 images at 1K. **At 2K the limit is 3**, because every
        reference is also encoded at 2K.

        - With `ratio: auto` (the default when editing) the output keeps the
        aspect ratio of `image1`. Choosing a ratio far from `image1` can shift
        the edit.

        - PNG references with transparency are read with their alpha channel.


        **Transparent background** — set `background` to `transparent` for a PNG
        with an alpha channel, for both text to image and editing. To remove the
        background of one image, send one image in `image_list` with
        `background: transparent` and no prompt.


        - Fully transparent pixels carry an arbitrary colour underneath.
        Composite the PNG over your own background before converting to JPEG, or
        the transparent area turns into a solid colour.

        - Transparent materials such as glass or lenses come out opaque.

        - For plain cut-outs, [Background
        Remover](/api-reference/image-api/background-remover) is cheaper and
        gives cleaner hair edges.


        **Timing** — about 30 to 60 seconds of processing for 1K, and about 3 to
        7 minutes for 2K, plus queue time.
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: '{{Authorization}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - qwen-image-2-1
                  description: Model name. Must be `qwen-image-2-1`.
                prompt:
                  type: string
                  maxLength: 4000
                  description: >-
                    What to generate, or the edit instruction. Refer to
                    reference images as `<image1>` … `<image10>`. Required,
                    except for background removal (one image in `image_list`
                    with `background: transparent`). Any language is accepted,
                    and text you ask for in the image is rendered as written.
                image_list:
                  type: array
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        format: uri
                    required:
                      - url
                  minItems: 1
                  maxItems: 10
                  description: >-
                    Optional reference images for editing, [{"url":
                    "https://..."}]. Up to 10 at 1K, up to 3 at 2K. The array
                    order is the `<imageN>` order; the first image is the one
                    being edited. Reference images do not change the price.
                ratio:
                  type: string
                  enum:
                    - auto
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '3:4'
                    - '4:3'
                    - '9:16'
                    - '16:9'
                    - '21:9'
                  default: auto
                  description: >-
                    Aspect ratio. `auto` follows the first reference image when
                    editing and means 1:1 for text to image.
                image_size:
                  type: string
                  enum:
                    - 1K
                    - 2K
                  default: 1K
                  description: >-
                    Resolution tier, also the price tier. 1K is about 1
                    megapixel, 2K about 4 megapixels (native). Case-insensitive.
                background:
                  type: string
                  enum:
                    - opaque
                    - transparent
                  default: opaque
                  description: >-
                    `transparent` returns a PNG with an alpha channel. Does not
                    affect pricing.
                seed:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: Optional. Fixing the seed makes results more reproducible.
                custom_callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional. A publicly accessible HTTPS URL. When the task
                    status changes (processing / success / failed), GoEnhance
                    sends a POST request to this URL. The request body is
                    identical to the response of GET /api/v1/jobs/detail. If
                    your server does not respond with HTTP 200, the notification
                    is retried up to 3 times, with a 3-second timeout per
                    attempt.
                  example: https://your-server.com/goenhance/callback
              required:
                - model
            example:
              model: qwen-image-2-1
              prompt: >-
                A red panda barista making latte art in a cozy wooden cafe, warm
                morning light
              ratio: '16:9'
              image_size: 1K
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      img_uuid:
                        type: string
                      cost:
                        type: number
                        description: >-
                          Tokens deducted for this request. This is the amount
                          actually charged, so it already reflects any discount
                          active on your account and can be lower than the
                          listed price. Tokens are deducted when the task is
                          accepted, and refunded automatically if the generation
                          ends in failure.
                        example: 1
                    required:
                      - img_uuid
                      - cost
                required:
                  - code
                  - msg
                  - data
              examples:
                '1':
                  summary: Success
                  value:
                    code: 0
                    msg: Success
                    data:
                      img_uuid: c12b656c-747a-44fd-9c80-add79b0c52d5
                      cost: 1
                '2':
                  summary: Insufficient tokens
                  value:
                    code: 100
                    msg: tokens is not enough
                quota:
                  summary: API key quota exceeded
                  value:
                    code: 101
                    msg: 'API key quota exceeded: 4990 of 5000 tokens used (monthly)'
          headers: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                required:
                  - code
                  - msg
          headers: {}
      deprecated: false
      security: []

````