Qwen-Image / Plus / 2.0 / Max / Edit 系列文生圖, 同步返回 OSS URL (24h 有效)
POST /v1/images/generations
## Aliyun Qwen-Image 文生圖 通義千問影像生成系列, 適用於以下模型: | 模型 | 說明 | |---|---| | `qwen-image` | 基礎款, 卓越文本渲染能力, 適合海報 / 對聯 / 字型設計 | | `qwen-image-plus` | 旗艦款, 高品質人像 / 場景, 速度較 qwen-image 略慢 | | `qwen-image-plus-2026-01-09` | qwen-image-plus 2026-01-09 快照版 (穩定回滾錨點) | ### 欄位命名風格 - `input.prompt` 字串 — 文本提示詞 - `parameters.size` 字串 — 用 `*` 分隔寬高 (DashScope 風格), 例如 `"1024*1024"` / `"1664*928"` - `parameters.n` 整數 — 生成張數, 當前限 1 張 ### 響應解析 - `output.task_status` — `"SUCCEEDED"` 表示成功 - `output.results[].url` — 圖片 URL (臨時連結, ~24h 過期, 請及時下載) - `usage.image_count` — 實際生成張數 ### 模型編輯能力 如需**影像編輯** (傳入參考圖改寫), 請用 `qwen-image-edit*` 系列, 參見 [Aliyun Qwen-Image Multimodal](/docs/api/aliyun-qwen-image-multimodal) 文件.
model | string | required | Qwen-Image 文生圖非同步模型. `qwen-image` 基礎款 / `qwen-image-plus` 旗艦款 / `-2026-01-09` 是穩定快照 |
input | object | required | 輸入物件, 包含文本提示詞 |
prompt | string | required | 文本提示詞, 支援中英文混合. 詳細描述能顯著提升生成品質 |
parameters | object | 生成參數 | |
size | string | 影像尺寸, 用 `*` 分隔寬高 (DashScope 風格). 支援 16:9 / 5:4 / 1:1 / 4:5 / 9:16 等比例 | |
n | integer | 生成張數, 當前上游限單次 1 張. 需多張請多次呼叫 |
200 — 生成成功, 返回圖片 URL400 — 參數錯誤, 例如 prompt 為空 / size 取值不支援 / model 名不識別等429 — 請求頻次或併發超限, 等待或降低 QPS 後重試curl -X POST "https://api.router.ai/v1/images/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-plus",
"input": {
"prompt": "一只穿着宇航服的橘猫站在月球上, 背景星空, 写实风格"
},
"parameters": {
"size": "1024*1024",
"n": 1
}
}'