模型概览
- 端点
- /api/v1/images/generations
- 积分成本
- 5 credits / image
- 典型耗时
- 15-45 sec
- 输入与输出
- Text or images → PNG, JPEG, WebP
能力
- Low per-image cost
- Text-to-image
- Multi-image editing
- Flexible pixel sizes
请求参数
| 参数 | 类型 | 要求 | 说明 |
|---|---|---|---|
| model | string | 必填 | Model identifier. 默认值: qwen-image-2512 |
| prompt | string | 必填 | Generation or edit prompt. |
| images | string[] | 可选 | Source image URLs for editing. |
| size | string | 可选 | Pixel dimensions using width*height. 默认值: 1024*1024 |
| output_format | png | jpeg | webp | 可选 | Generated file format. 默认值: jpeg |
请求示例
curl https://qwenapi.org/api/v1/images/generations \
-H "Authorization: Bearer $QWEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-2512",
"prompt": "Minimal packaging design for a botanical sparkling water brand",
"size": "1024*1024",
"output_format": "jpeg"
}'生成端点为异步任务。请使用同一个 Bearer 密钥轮询 GET /api/v1/tasks/。
