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

# Qwen Image

> Qwen Image：根據文字生成圖片。請使用 `input.prompt`，不要使用 `input.messages`。

根據文字生成圖片。請使用 `input.prompt`，不要使用 `input.messages`。

`POST /v1/images/generations`

## 快速範例

執行前請設定 `MIXROUTE_API_KEY`。

```bash theme={null}
curl --request POST 'https://api.mixroute.ai/v1/images/generations' \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "qwen-image",
  "input": {
    "prompt": "A red ceramic mug on a white table."
  },
  "parameters": {
    "size": "1024*1024",
    "n": 1
  }
}'
```

當 `output.task_status` 為 `SUCCEEDED` 時，從 `output.results[].url` 取得圖片網址。

## 參數與限制

| 欄位 | 說明 |
| - | - |
| `model` | `qwen-image`. 請填寫範例中的完整模型 ID。 |
| `input.prompt` | 描述要生成的圖片。 |
| `parameters.size` | 使用 `寬度*高度`，例如 `1024*1024`。 |
| `parameters.n` | 每次請求只支援 `1`。 |

## API 參考

* [Qwen 圖片生成](https://mixroute.ai/docs/zh-Hant/api-reference/endpoint/qwen-image.md)


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