z-image
- 轻量快速文生图
- 提示词上限 800 字符
- 1K / 2K 两档,固定单张
认证
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 |
只有文生图一种模式,没有 n 参数,每次固定出 1 张。
| Scenario | Field combination |
|---|---|
| Text to image | prompt |
Text to image is the only mode. There's no n parameter; every call produces exactly one image.
请求参数
提交成功只返回任务 ID,不含图片本身。拿结果用 task_id 轮询获取任务状态,图片地址在 result.images[0].url,该地址会过期,请及时转存。
取值为 z-image-turbo。
画面描述,中英文均可,上限 800 字符。
宽高比,取值 1:1(默认)、4:3、3:4、16:9、9:16、3:2、2:3。
取值 1K(默认)、2K。
自动扩写提示词,默认 false,开启后费用更高。
为 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.
Always z-image-turbo.
The scene description, in Chinese or English, up to 800 characters.
Aspect ratio: 1:1 (default), 4:3, 3:4, 16:9, 9:16, 3:2, or 2:3.
Either 1K (default) or 2K.
Auto-extend the prompt. Defaults to false; enabling it costs more.
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 |
Only successfully generated images are billed; failures aren't charged.
响应
提交成功返回受理结构:
{
"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 | 定位 |
|---|---|
z-image-turbo | 轻量快速,按张固定计费 |
GET https://api.oairoute.com/api/pricing。| Model ID | Positioning |
|---|---|
z-image-turbo | Lightweight and fast, billed at a flat per-image rate |
GET https://api.oairoute.com/api/pricing.