图像接口
POST /v1/images/generations。GPT Image、nano-banana 与 Gemini 图像模型都走这一条。
路径
POST /v1/images/generations
全部图像模型统一走这一条,同步返回图片。
模型与尺寸写法
| 模型 | 尺寸写法 | 档位 |
|---|---|---|
gpt-image-2.0-vip | 像素 | 1K |
gpt-image-2.5-vip | 像素 | 1K |
gpt-image-2.0-pro | 像素 | 2K / 4K |
gpt-image-2.5-pro | 像素 | 2K / 4K |
nano-banana-2 / nano-banana-pro / gemini-3.1-flash-image-preview / gemini-3-pro-image-preview | 画幅 + quality | 1K / 2K / 4K |
seedream-5.0-pro | 像素 | 1K / 2K / 4K |
像素类请求
curl -X POST https://api.oiovideo.com/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.0-vip",
"prompt": "A cinematic city at night, no text",
"size": "1920x1080",
"n": 1
}'
像素对照表
| 画幅 | gpt-image-2.0-vip · 1K | gpt-image-2.5-vip · 1K | gpt-image-2.0-pro · 2K | gpt-image-2.0-pro · 4K | gpt-image-2.5-pro · 2K | gpt-image-2.5-pro · 4K |
|---|---|---|---|---|---|---|
| 1:1 | 1024x1024 | 1024x1024 | 2048x2048 | 2880x2880 | 2048x2048 | 4096x4096 |
| 4:3 | 1536x1152 | 1024x768 | 2048x1536 | 3840x2880 | 2048x1536 | 3840x2880 |
| 3:4 | 1152x1536 | 768x1024 | 1536x2048 | 2880x3840 | 1536x2048 | 2880x3840 |
| 16:9 | 1920x1080 | 1024x576 | 2048x1152 | 3840x2160 | 2048x1152 | 3840x2160 |
| 9:16 | 1080x1920 | 576x1024 | 1152x2048 | 2160x3840 | 1152x2048 | 2160x3840 |
seedream-5.0-pro 像素
| 画幅 | 1K | 2K | 4K |
|---|---|---|---|
| 1:1 | 1024x1024 | 2048x2048 | 4096x4096 |
| 4:3 | 1024x768 | 2048x1536 | 3840x2880 |
| 3:4 | 768x1024 | 1536x2048 | 2880x3840 |
| 16:9 | 1920x1080 | 2560x1440 | 3840x2160 |
| 9:16 | 1080x1920 | 1440x2560 | 2160x3840 |
size 必须用表中的原生值;像素类模型不要传 quality、aspect_ratio。
画幅类请求(nano-banana / Gemini)
curl -X POST https://api.oiovideo.com/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-pro",
"prompt": "Keep the subject, change the background to a beach at sunset",
"size": "3:4",
"quality": "hd",
"n": 1,
"images": [
"https://img.oiovideo.com/samples/ref-character.jpg"
]
}'
| 档位 | quality | size 写法 |
|---|---|---|
| 1K | 不传 | 1:1 / 3:4 / 4:3 / 16:9 / 9:16 |
| 2K | hd | 同上 |
| 4K | 4K | 同上 |
不要传 aspect_ratio,也不要把 1K / 2K / 4K 写进 size。
参考图
先 上传素材 换公网 HTTPS,写入 images 数组;不传则为文生图。本站只接收公网 URL:随请求文件或 Data URI 会被 413 拒绝。
字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 官网模型广场的模型名 |
prompt | string | 是 | 提示词 |
size | string | 是 | 像素类填对照表像素值;画幅类填 3:4 / 16:9 等画幅 |
quality | string | 否 | 仅画幅类:1K 省略、2K 传 hd、4K 传 4K |
n | integer | 否 | 默认 1 |
images | string[] | 否 | 参考图公网 HTTPS 数组 |
response_format | string | 否 | 固定 url;传入 b64_json 会被 400 拒绝 |
取图
响应里的 data[].url 就是图(对象存储公网直链,无需 Key,可直接展示或下载;约 24 小时内有效,请及时保存)。