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

# Qwen-Image 2.1 Turbo

> Qwen-Image 2.1 Turbo：通义千问的文生图模型，Qwen-Image 2.1 的 8 步蒸馏版，出图快、价格最低，适合批量生成。按张计费。

Qwen-Image 2.1 Turbo（`qwen-image-2.1-turbo`）是阿里通义的文生图模型：Qwen-Image 2.1 的 8 步蒸馏版，出图快、价格最低，适合批量生成。擅长中英文文字渲染。同系列的 [Qwen-Image 2.1 Pro](https://docs.dreamto.ai/image/models/qwen-image-2-1-pro.md) 画质和细节更好。需要图片编辑或多图合成时用 [Qwen-Image 3.0](https://docs.dreamto.ai/image/models/qwen-image-3-0.md)。接口兼容 OpenAI Images，可以直接使用 OpenAI 官方 SDK。

## 接入

| | DreamTo |
| - | - |
| 服务地址 | `https://api.dreamto.ai/v1` |
| API Key | DreamTo 控制台的 API Key，放在 `Authorization: Bearer` 请求头 |

## 接口

| 接口 | 用途 |
| - | - |
| [`POST /v1/images/generations`](https://docs.dreamto.ai/api-reference/qwen-image-2-1-turbo/create-image) | 生成图片 |

## 参数范围

| 字段 | 取值 |
| - | - |
| `prompt` | 必填，中英文均可；要写进图里的文字用引号标出 |
| `size` | `宽x高`，总像素 512×512 \~ 2048×2048，宽高比 1:8 \~ 8:1；不传时模型按提示词推荐尺寸 |
| `n` | 1 \~ 6，默认 1 |

常用尺寸：

| `size` |
| - |
| `1024x1024` |
| `1536x1024` |
| `1024x1536` |
| `1472x1104` |
| `1104x1472` |
| `1664x928` |
| `928x1664` |
| `2048x2048` |

## 计费

按张计费，\$0.016 / 张，以[模型广场](https://www.dreamto.ai/models)和控制台显示的价格为准。参数错误和生成失败不扣费。

## 快速开始

示例中的 `$DREAMTO_API_KEY` 为你的 API Key。

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/v1/images/generations" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-2.1-turbo",
    "prompt": "一张电影感的城市夜景海报，顶部写着“夜行”",
    "size": "1024x1024"
  }'
```

```python Python theme={null}
import os

from openai import OpenAI

client = OpenAI(base_url="https://api.dreamto.ai/v1", api_key=os.environ["DREAMTO_API_KEY"])

result = client.images.generate(
    model="qwen-image-2.1-turbo",
    prompt="一张电影感的城市夜景海报，顶部写着“夜行”",
    size="1024x1024",
)
print(result.data[0].url)
```

## 使用说明

* 响应里的 `data[].url` 是图片链接，请及时下载保存。
* `usage` 返回 `image_count`（按张计费）和图片的 `width` / `height`。
* 只支持文生图；不支持 `negative_prompt`、图片编辑和参考图。
* 错误响应使用 DreamTo 的错误结构（见接口的错误示例）。


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