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

# Qwen Image 2.1

qwen-image-2.1-pro balances speed, quality, and cost. It accepts up to 10 reference images for image-to-image generation and uses the prompt to decide whether to output a regular image or one with an alpha channel.

qwen-image-2.1-turbo offers the best overall value in the Qwen-Image series. It accepts up to 10 reference images for image-to-image generation and uses the prompt to decide whether to output a regular image or one with an alpha channel.

### Model parameters

* Model IDs: `qwen-image-2.1-turbo`/`qwen-image-2.1-pro`
* Pricing: See the model pages for [Qwen-Image-2.1-turbo](https://geekai.co/models/qwen-image-2.1-turbo) and [Qwen-Image-2.1-pro](https://geekai.co/models/qwen-image-2.1-pro).
* Endpoint: `https://geekai.co/api/v1/images/generations`
* Parameters: See the [Image API reference](https://docs.geekai.co/en/api/image/generations.md).
* Authentication: [Get an API key](https://geekai.co/user/api_keys).

> [!NOTE]
>
> The following Image API parameters are not supported:
>
> * `strength`
> * `aspect_ratio`
> * `quality`
> * `style_preset`
> * `response_format`
> * `output_format`
> * `mask`
> * `background`
>
> See also: [Official Qwen Image Generation and Editing 2.1 API documentation](https://docs.bailian.console.aliyun.com/zh/model-studio/qwen-image-generation-and-editing-api-reference).

Set the output resolution with `size` as a `widthxheight` string, such as "1024x1024". If omitted, the model recommends a resolution based on the prompt:

* Text-to-image (T2I): Any dimensions with a total pixel count between `512x512` and `2048x2048` and an aspect ratio between `1:8` and `8:1`.
* Image-to-image (I2I): Any dimensions with a total pixel count between `512x512` and `2048x2048` and an aspect ratio between `1:8` and `8:1`.

In GeekAI, use `enhance_prompt` instead of the official `prompt_extend` to expand and refine the original prompt for better image quality and detail.

Set `extra_body.prompt_extend_mode` to select the prompt optimization mode:

* `direct`: Direct prompt enhancement (DPE), the default. Suitable for most use cases and supported for both text-to-image and image-to-image generation.
* `agent`: Agentic prompt enhancement (APE) provides more detailed rewrites. Text-to-image only; passing `agent` for image-to-image generation returns a `400` error.

Set `n` to specify the number of images, up to 6. The default is 1.

For image-to-image generation, pass reference images in `image` as URLs or Base64-encoded data. Supply up to 10 images, using an array for multiple images. Requirements:

* Supported formats: PNG, JPG, JPEG, WEBP, BMP, TIFF, and GIF.
* Each image must be no larger than 10 MB, with a long-to-short side ratio no greater than 10:1.
* For best results, use images with both dimensions between 384 and 2048 pixels.

Set `extra_body.enable_thinking` to enable thinking mode. It defaults to `true` and takes effect only when `enhance_prompt=true`. Enabling it improves image quality but takes longer.

### Pricing

Like GPT-Image-2, Qwen-Image-2.1 supports any resolution from `512x512` to `2048x2048`. Prices are as follows:

| Model ID | Price (CNY/image) |
| - | - |
| `qwen-image-2.1-turbo` | 0.1 |
| `qwen-image-2.1-pro` | 0.25 |

Generated images are billed per image, regardless of size or quality.

### Text-to-image generation

Give the model a clear, precise description to quickly generate a high-quality image:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "qwen-image-2.1-turbo",
    "prompt": "An elegant, stately pair of calligraphy scrolls hangs in a quiet, traditionally furnished Chinese hall. Blue-and-white porcelain sits on the table. The left scroll reads ‘义本生知人机同道善思新’, the right reads ‘通云赋智乾坤启数高志远’, and the horizontal inscription reads ‘智启通义’. Use flowing calligraphy. Hang a traditional Chinese painting of Yueyang Tower between the scrolls.",
    "size": "1024x1024",
    "negative_prompt ": "Low resolution, low image quality, malformed limbs or fingers, oversaturation, waxy appearance, featureless faces, excessive smoothing, artificial-looking imagery, chaotic composition, blurry or distorted text.",
    "watermark": false
}'
```

To enable prompt enhancement, set `enhance_prompt` to `true`:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "qwen-image-2.1-turbo",
    "prompt": "An elegant, stately pair of calligraphy scrolls hangs in a quiet, traditionally furnished Chinese hall. Blue-and-white porcelain sits on the table. The left scroll reads ‘义本生知人机同道善思新’, the right reads ‘通云赋智乾坤启数高志远’, and the horizontal inscription reads ‘智启通义’. Use flowing calligraphy. Hang a traditional Chinese painting of Yueyang Tower between the scrolls.",
    "size": "1024x1024",
    "negative_prompt ": "Low resolution, low image quality, malformed limbs or fingers, oversaturation, waxy appearance, featureless faces, excessive smoothing, artificial-looking imagery, chaotic composition, blurry or distorted text.",
    "enhance_prompt": true,
    "extra_body": {
        "prompt_extend_mode": "agent"
    },
    "watermark": false
}'
```

The response is a JSON object containing the generated image URL and Base64-encoded image data:

```json theme={null}
{
    "model": "qwen-image-2.1-turbo",
    "created": 1792549242,
    "task_id": "0c1be9e7-cd28-4e22-9e65-a21dd379d80a",
    "task_status": "succeed",
    "data": [
        {
            "url": "https://static.geekai.co/image/2026/10/21/575a8737fda209b77bd18535ebb66cfc.png"
        }
    ],
    "usage": {
        "billed_units": 1
    }
}
```

`billed_units` is the billable number of generated images.

### Image-to-image generation

**Single image**

Pass a single image in `image` to edit it or generate an image based on it:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "qwen-image-2.1-turbo",
    "prompt": "Generate an image matching the depth map: a battered red bicycle stands on a muddy path with dense old-growth forest in the background",
    "image": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/fpakfo/image36.webp",
    "negative_prompt ": "Low quality"
}'
```

**Multiple images**

Pass multiple images in `image` to generate an image based on several references:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "qwen-image-2.1-turbo",
    "prompt": "Replace the clothing of the girl in image 2 with the clothing of the girl in image 1",
    "image": [
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_1.png", 
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_5_imagesToimage_2.png",
    ]
}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.