GPT Image 2
模型 ID:gpt-image-2。本章适用于 default 分组,使用 异步图片接口。
参数
章节:参数| 字段 | 支持值 |
|---|---|
images | 最多 16 张,非空自动进入图片编辑 |
n | 固定 1 |
resolution | auto、1k、2k、4k、custom |
aspect_ratio | 宽:高;比例范围 1:3–3:1 |
size | auto 或 宽x高,例如 1536x1024 |
quality | auto(默认)、low、medium、high |
moderation | auto(默认)、low;不保证所有内容都可生成 |
output_format | png(默认)、jpeg、webp |
比例加分辨率
章节:比例加分辨率{ "model": "gpt-image-2", "prompt": "A red teapot on a white table, clean product photograph.", "aspect_ratio": "3:2", "resolution": "2k", "quality": "auto", "moderation": "auto", "output_format": "png", "n": 1}网关将比例和档位转换为具体像素尺寸。1K、2K、4K 是目标像素规模而非任意比例下固定长边;最终尺寸按模型约束取整,4K 最大约 829 万像素。
自定义尺寸
章节:自定义尺寸{ "model": "gpt-image-2", "prompt": "A peaceful garden, wide composition.", "resolution": "custom", "size": "1536x1024", "quality": "auto", "output_format": "png", "n": 1}自定义时不要再传 aspect_ratio;size 才是实际像素尺寸。尺寸约束:
- 宽、高都是 16 的倍数。
- 最长边不超过 3840px。
- 长边 / 短边不超过 3。
- 总像素在 655360–8294400 之间。
1920x1080 的高度不是 16 的倍数,不能直接当作本接口的有效自定义尺寸。使用预设比例档位,或选择满足约束的尺寸。
自动尺寸与参考图编辑
章节:自动尺寸与参考图编辑{ "model": "gpt-image-2", "prompt": "Change the teapot color to blue. Keep the composition unchanged.", "images": [ "https://example.com/reference.png" ], "size": "auto", "quality": "high", "output_format": "png", "n": 1}size: "auto" 或 resolution: "auto" 让模型自行决定尺寸,不保证它严格复制原图像素。要求固定构图比例时,读取参考图宽高后传 aspect_ratio 加明确分辨率,或使用合法 size。
计费
章节:计费本章 default 线路按请求计费,不按文本 token 计费。当前基础单价以模型广场为准,quality 不代表本站必定按官方 token 规则收费。提交与成功响应通过 usage 给出预估和实际金额。
GPT Image 2.5 专线
章节:GPT Image 2.5 专线gpt-image-2.5-flare-dedicated 和 gpt-image-2.5-sunburst-dedicated 是独立专线模型,
同样通过异步图片接口调用。dedicated 表示专线,不能与 -official 官渠的尺寸规则混用。
- 支持文生图、最多 16 张参考图编辑,以及
auto / low / medium / high / xhigh / max质量选项。 n可省略或填写1,不支持一次请求多张;平台转发时自动省略上游不接受的n。- 支持下表固定尺寸,不支持
size: "auto"或任意宽高。可传resolution加aspect_ratio,也可直接传表中的size。 - 游乐场和画布的“跟随首张参考图”会匹配最接近的受支持比例,不保证与原图像素完全相同。
-official官渠模型仍支持受约束的自定义尺寸和auto,本次没有取消这些能力。
| 比例 | 1K | 2K | 4K |
|---|---|---|---|
| 3:1 | 1536x512 | 3072x1024 | 3840x1280 |
| 21:9 | 1344x576 | 2688x1152 | 3840x1648 |
| 16:9 | 1280x720 | 2048x1152 | 3840x2160 |
| 3:2 | 1152x768 | 2304x1536 | 3520x2352 |
| 4:3 | 1024x768 | 2048x1536 | 3312x2480 |
| 1:1 | 1024x1024 | 2048x2048 | 2880x2880 |
| 3:4 | 768x1024 | 1536x2048 | 2480x3312 |
| 2:3 | 768x1152 | 1536x2304 | 2352x3520 |
| 9:16 | 720x1280 | 1152x2048 | 2160x3840 |
| 1:3 | 512x1536 | 1024x3072 | 1280x3840 |
1K、2K、4K 为档位名称;部分尺寸经过上游取整,请使用表值。 当前 default 基础售价为 $0.03/张,实际价格和用户优惠以模型广场及估价为准。
