Qwen 图像
- 文生图与参考图编辑
- 参考图最多 3 张,一次最多 6 张
- 文字渲染与版面密度见长
认证
All endpoints authenticate with a Bearer token.
Get an API key: open the console and create one.
Add it to the request header:
Authorization: Bearer YOUR_OAIRoute_KEY请求结构
请求体是平铺的 JSON,创作字段与输出字段都在顶层,没有 content 数组包装。
The body is flat JSON: creative fields and output fields sit at the top level, with no content array wrapper.
支持的场景
| 场景 | 字段组合 |
|---|---|
| 文生图 | prompt |
| 单图编辑 | prompt + image(1 张) |
| 多图参考 | prompt + image(2 到 3 张) |
不传 size 也不传 resolution 时固定输出 1024×1024。
| Scenario | Field combination |
|---|---|
| Text to image | prompt |
| Single-image edit | prompt + image (1 image) |
| Multi-image reference | prompt + image (2 to 3 images) |
Without either size or resolution, output is fixed at 1024×1024.
请求参数
提交成功只返回任务 ID,不含图片本身。拿结果用 task_id 轮询获取任务状态,图片地址在 result.images[0].url,该地址会过期,请及时转存。
取值 qwen-image-3.0 或 qwen-image-3.0-pro。
-pro 面向报纸、漫画分镜、菜单、试卷这类版面密集的内容。
画面描述,上限约 4500 token。
参考图,1 到 3 张。公网地址或 Base64。
格式 jpg、jpeg、png、bmp、tiff、webp、gif,单张不超过 10MB,建议单边 384 到 2048 像素。
默认 1:1。
可写宽高比 1:1、4:3、3:4、16:9、9:16、3:2、2:3,也接受 16x9 写法;或精确像素如 1024x1024(单边 512 到 2048,比例 1:8 到 8:1)。
取值 1K(默认)、2K,兼容小写。决定计费档。
size 写精确像素时按面积判档,超过 2.25MP 按 2K 计费。
生成张数,取值 1 到 6,默认 1。超过 6 会被静默截断为 6。
反向描述,写不希望出现的内容。
自动扩写提示词,默认 false。默认关闭以保证结果可预测。
取值 direct 或 agent,需配合 prompt_extend: true。
agent 更激进,只能在文生图使用,图生图传 agent 返回 400。
为 true 时先做内容审查,默认 false。
A successful submission returns only the task ID, not the image itself. Poll Get task status with the task_id; the image URL is at result.images[0].url and expires, so copy it promptly.
qwen-image-3.0 or qwen-image-3.0-pro.
-pro targets layout-dense content such as newspapers, comic storyboards, menus, and exam papers.
The scene description, up to about 4500 tokens.
Reference images, 1 to 3. Public URLs or Base64.
Formats jpg, jpeg, png, bmp, tiff, webp, gif; up to 10MB each; each side of 384 to 2048 pixels is recommended.
Defaults to 1:1.
Accepts aspect ratios 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3 (the 16x9 form is also accepted), or exact pixels such as 1024x1024 (each side 512 to 2048, ratio 1:8 to 8:1).
1K (default) or 2K; lowercase accepted. Determines the billing tier.
When size is exact pixels, the tier is judged by area: above 2.25MP bills as 2K.
Number of images, 1 to 6, default 1. Values above 6 are silently truncated to 6.
A negative description of what you don't want to appear.
Auto-extend the prompt; defaults to false. Off by default to keep results predictable.
direct or agent; requires prompt_extend: true.
agent is more aggressive and works only for text to image; passing agent for image to image returns a 400.
When true, runs a content check first. Defaults to false.
尺寸对照
| 比例 | 1K | 2K |
|---|---|---|
| 1:1 | 1024×1024 | 2048×2048 |
| 4:3 | 1152×864 | 2048×1536 |
| 3:4 | 864×1152 | 1536×2048 |
| 16:9 | 1280×720 | 2048×1152 |
| 9:16 | 720×1280 | 1152×2048 |
| 3:2 | 1248×832 | 2048×1360 |
| 2:3 | 832×1248 | 1360×2048 |
| Ratio | 1K | 2K |
|---|---|---|
| 1:1 | 1024×1024 | 2048×2048 |
| 4:3 | 1152×864 | 2048×1536 |
| 3:4 | 864×1152 | 1536×2048 |
| 16:9 | 1280×720 | 2048×1152 |
| 9:16 | 720×1280 | 1152×2048 |
| 3:2 | 1248×832 | 2048×1360 |
| 2:3 | 832×1248 | 1360×2048 |
响应
提交成功返回受理结构:
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
}
]
}状态码,200 表示任务已受理。
本次提交的任务列表。
受理状态,提交成功时为 submitted。
任务 ID,用它轮询结果。
完成态返回:
{
"code": 200,
"data": {
"id": "task_01K8SGYNNNVBQTXNR4MM964S7K",
"status": "completed",
"progress": 100,
"result": {
"images": [
{ "url": ["https://cdn.oairoute.com/f/image/task_01K8_0.png"], "expires_at": 1763174708 }
]
},
"created": 1763088289,
"completed": 1763088302
}
}A successful submission returns an accepted structure:
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
}
]
}The status code; 200 means the task was accepted.
The list of tasks submitted this time.
The acceptance status; submitted on success.
The task ID; use it to poll for the result.
The completed state returns:
{
"code": 200,
"data": {
"id": "task_01K8SGYNNNVBQTXNR4MM964S7K",
"status": "completed",
"progress": 100,
"result": {
"images": [
{ "url": ["https://cdn.oairoute.com/f/image/task_01K8_0.png"], "expires_at": 1763174708 }
]
},
"created": 1763088289,
"completed": 1763088302
}
}错误码
| HTTP | 含义 |
|---|---|
| 400 | 参数错误,type 为 invalid_request_error |
| 401 | Token 缺失或无效,type 为 authentication_error |
| 402 | 余额不足,type 为 payment_required |
| 429 | 触发限流 |
| HTTP | Meaning |
|---|---|
| 400 | Invalid parameters, with type invalid_request_error |
| 401 | Token missing or invalid, with type authentication_error |
| 402 | Insufficient balance, with type payment_required |
| 429 | Rate limit hit |
For more status codes and retry guidance see Error codes and rate limits; for troubleshooting steps on common errors see the FAQ.
支持的模型列表
| 模型 ID | 定位 |
|---|---|
qwen-image-3.0 | 标准版,指令遵循与文字渲染稳定,日常出图成本更低 |
qwen-image-3.0-pro | 版面密集内容,适合报纸、分镜、菜单、试卷 |
两个模型不能与 2.0 系列互换。
GET https://api.oairoute.com/api/pricing。| Model ID | Positioning |
|---|---|
qwen-image-3.0 | Standard: stable instruction following and text rendering, cheaper for everyday output |
qwen-image-3.0-pro | Layout-dense content: newspapers, storyboards, menus, exam papers |
These two models aren't interchangeable with the 2.0 series.
GET https://api.oairoute.com/api/pricing.