- 异步处理模式,返回任务 ID 用于后续查询
- 支持文生图、图生图(1-3 张参考图编辑)
- 支持 1K / 2K 分辨率,单次最多 6 张
- 提供标准版与 Pro 版(密集排版、图文更强)
请求示例
bash
curl --request POST \
--url https://api.openveer.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-3.0",
"prompt": "一张咖啡馆海报,主标题写着「秋日限定」,暖色调,排版精致",
"size": "16:9",
"resolution": "1K"
}'
```python
import requests
url = "https://api.openveer.com/v1/images/generations"
payload = {
"model": "qwen-image-3.0",
"prompt": "一张咖啡馆海报,主标题写着「秋日限定」,暖色调,排版精致",
"size": "16:9",
"resolution": "1K",
}
headers = {
"Authorization": "Bearer
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript
const url = "https://api.openveer.com/v1/images/generations";
const payload = {
model: "qwen-image-3.0",
prompt: "一张咖啡馆海报,主标题写着「秋日限定」,暖色调,排版精致",
size: "16:9",
resolution: "1K",
};
const headers = {
Authorization: "Bearer
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
```
响应示例
json
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
json
{
"error": {
"code": 400,
"message": "请求参数无效",
"type": "invalid_request_error"
}
}
json
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥",
"type": "authentication_error"
}
}
json
{
"error": {
"code": 402,
"message": "账户余额不足,请充值后再试",
"type": "payment_required"
}
}
json
{
"error": {
"code": 429,
"message": "请求过于频繁,请稍后再试",
"type": "rate_limit_error"
}
}
支持的模型
| 模型名 | 说明 | 最大张数 | 分辨率 |
|---|---|---|---|
qwen-image-3.0 |
指令理解清晰,文字渲染稳定,常规出图更划算 | 6 张 | 1K / 2K |
qwen-image-3.0-pro |
内容更丰实,适合报纸、分镜、菜单、试卷等密集排版 | 6 张 | 1K / 2K |
Authorizations
Authorization stringBody
model stringprompt stringimage_urls string[]resolution stringsize stringn integernegative_prompt stringprompt_extend booleanprompt_extend_mode string尺寸对照表
通过 resolution(档位)+ size(比例)组合控制输出尺寸:
| 分辨率 | 1:1 | 4:3 | 3:4 | 16:9 | 9:16 | 3:2 | 2:3 |
|---|---|---|---|---|---|---|---|
| 1K | 1024×1024 | 1152×864 | 864×1152 | 1280×720 | 720×1280 | 1248×832 | 832×1248 |
| 2K | 2048×2048 | 2048×1536 | 1536×2048 | 2048×1152 | 1152×2048 | 2048×1360 | 1360×2048 |
使用场景示例
文生图(多张)
{
"model": "qwen-image-3.0",
"prompt": "扁平插画风格的城市天际线,黄昏,暖橙色调",
"size": "16:9",
"resolution": "1K",
"n": 4
}
文生图(密集排版,开改写)
{
"model": "qwen-image-3.0-pro",
"prompt": "一份西餐厅菜单,分前菜/主菜/甜品三栏,每栏 5 道菜带价格,衬线字体,米色底",
"size": "3:4",
"resolution": "2K",
"prompt_extend": true,
"prompt_extend_mode": "agent"
}
图生图(图像编辑)
{
"model": "qwen-image-3.0-pro",
"prompt": "把画面里的招牌文字改成「营业中」,其余保持不变",
"image_urls": ["https://example.com/shop.jpg"],
"size": "1:1"
}
带反向提示词
{
"model": "qwen-image-3.0",
"prompt": "写实风格的山间小屋,清晨薄雾",
"negative_prompt": "文字, 水印, 人物, 低分辨率",
"size": "3:2"
}
限制
| 项 | 限制 |
|---|---|
| 提示词 | ≤ 4.5k token |
| 输出尺寸 | 自定义像素时宽、高各自 512 \~ 2048;宽高比 1:8 \~ 8:1 |
| 出图张数 | 1-6(超出自动截断) |
| 参考图数量 | 1-3 张 |
| 参考图格式 | JPG / JPEG / PNG / BMP / TIFF / WEBP / GIF |
| 参考图大小 | ≤ 10MB,宽高建议 384-2048 像素 |
Response
code integerdata arraytask_id string与 2.0 的差异
| 2.0 系列 | 3.0 系列 | |
|---|---|---|
| 提示词长度 | 较短 | 约 4.5k token |
prompt_extend_mode |
不支持 | direct / agent |
| 分辨率 | 1K / 2K | 1K / 2K(Pro 的 2K 档位价格更高) |
| 参考图 | 支持 | 1-3 张 |
注意事项
- 异步处理:提交后返回
task_id,使用 获取任务状态 轮询;建议每 3\~5 秒一次,超时约 3 分钟(2K + 多张更慢)。 - 图片存储:生成图片已镜像到平台 CDN,返回地址长期可用。
- 计费:按实际出图张数 × 分辨率档位计费;档位按实际像素面积判定(> 225 万像素为 2K)。
qwen-image-3.0的 1K/2K 同价;-pro的 2K 为 1K 的两倍。任务失败全额退款;参考图不额外收费。 - 常见错误:自定义
size宽或高不在 512–2048、比例越界、agent用在图生图、参考图不可访问或超 10MB 等返回 400;限流 429。