GPT Image 2 API
接入 API 之前,先试试 GPT Image 2
正式接入前,先测出图质量、看清一次请求的 token 成本,并生成一张样图。
Create image task
Fixed to gpt-image-2Text-to-image, image-to-image and mask-guided editing. Billed by the tokens the upstream usage object reports.
Upload source or reference images for image-to-image and editing. Each one adds image input tokens.
Pixel budget for the chosen ratio: 1K about 1.05 MP, 2K about 4.19 MP, 4K is 8.29 MP.
Rendering effort. It drives the output token count, so it is the single biggest cost lever.
Transparent keeps an alpha channel in the output. This is a Preview feature — results may be unstable.
Number of images per request (1-10). Cost scales linearly with the count.

生成结果保留 24 小时,需要的请及时下载。
充值之前,先算清测试要花多少
从单张样图的成本出发选一个测试预算,再用计算器算你自己的场景。最下面是 token 原始单价。
First Test Cost
Text-to-Image - 1K - 1:1 - mediumOne 1K prompt-only image
About 208 tests with $10 in credits.
Iterate prompts on low quality at 1K to save tokens, then promote the final render to high. Each reference image in image_urls adds input tokens.
Testing Budget Guide
Pick an amount based on how many tests you expect.Good for a first validation.
Good for prompt iteration.
Good before production integration.
Common Cost Examples
Estimated cost for one generated 1:1 image. Final cost is settled against the token counts the upstream usage object reports.
Model Pricing
This page serves two models and they are billed differently. Each block states its own rule, so read the badge before comparing the numbers.
gpt-image-2Token-basedBilled by token, so there is no fixed per-image price. These are the raw rates; what a request actually costs depends on its size, quality, reference images and count. Use the calculator below to price your own case.
| Item | Rule | Rate | Billing |
|---|---|---|---|
| Image output tokens | The generated image itself. Token count grows with the resolution tier and the quality tier. | $0.027/1K tokens-10% 1.836 cr/1K tokens$0.030 官方价 | Output tokens |
| Image input tokens | Applied to each reference image in image_urls, and to a mask when one is sent. | $0.0072/1K tokens-10% 0.4896 cr/1K tokens$0.0080 官方价 | Input tokens |
| Image cached input tokens | Charged only when the upstream usage object reports cached image tokens. | $0.0018/1K tokens-10% 0.1224 cr/1K tokens$0.0020 官方价 | Input tokens |
| Text input tokens | Produced by the prompt itself. Typically under 1% of a request. | $0.0045/1K tokens-10% 0.306 cr/1K tokens$0.0050 官方价 | Input tokens |
| Text cached input tokens | Charged only when the upstream usage object reports cached text tokens. | $0.0012/1K tokens-10% 0.0765 cr/1K tokens$0.0013 官方价 | Input tokens |
Figures are estimates. Final charges are based on actual token usage.
gpt-image-2-betaFlat per callOne flat rate per call, whatever the aspect ratio - no token accounting and nothing to estimate. Auto or aspect-ratio sizes at the 1K tier only, one image per call. The OpenAI list price has no equivalent for this route, so no official comparison is shown.
| Item | Rule | Rate | Billing |
|---|---|---|---|
| 1K output | Any aspect ratio or auto, at the 1K tier. One image per call, regardless of prompt length or reference images. | $0.015/image 1.02 cr/image | Per call |
GPT Image 2 API 快速了解
GPT Image 2 与 ChatGPT Images 2.0 同期发布,并可通过模型 ID gpt-image-2 接入 API,用于文字密集型图像生成和高保真编辑;ChatGPT 产品还可能叠加推理、网页搜索和多图编排能力,不能与原始图像模型完全等同。
GPT Image 2 能生成什么
基于文字提示词或参考图生成高保真图像,尤其擅长海报排版、信息密集的图表、角色设定图、产品创意,以及蒙版引导的编辑工作流。
效果预览

信息密集排版中的文字清晰度提升

多分格角色设定图

海报级构图与字体排版
你可以用它做什么
文字密集的海报与信息图
角色设定图与一致性 IP 形象
电商产品图与 UGC 风格广告
通过 API 批量生成营销活动素材
参考图编辑、风格迁移与蒙版重绘
AI 视频工作流的首帧素材
根据任务选择合适的图像模型
| 维度 | GPT Image 2 | Nano Banana | Seedream |
|---|---|---|---|
| 起步价 | 约 $0.048/张 | 有更低价选项 | 按张分档 |
| 计费方式 | 按 token | 按生成张数 | 按输出档位计张 |
| 输出画质 | Low / Medium / High × 1K / 2K / 4K | 按模型分 1K / 2K / 4K | 1K / 1.5K / 2K |
| 参考图输入 | 最多 16 张,另支持蒙版 | 取决于具体模型 | 最多 10 张 |
| 最适合 | 海报、信息图、图内文字 | 高质量图像生成 | 广告、产品创意、图像编辑 |
关键细节
size 和 resolution 是配合关系
比例模式下由 resolution 决定像素预算(1K 约 1.05 MP,2K 约 4.19 MP,4K 为 8.29 MP);auto 或自定义像素模式下 resolution 会被忽略。
quality 代表渲染力度
low / medium / high 决定模型花多少输出 token。调提示词时用 low,最终成片再切到 high。
计费以 usage 为准
按上游 usage 返回的 token 数扣费,下单前先按参数预估、跑完再按真实数字结算。
主要请求参数
这些字段决定 POST /v1/images/generations 的输出与成本。生成为异步任务 —— 轮询返回的 task ID 或使用回调;图片链接仅 24 小时内有效,请及时保存结果。完整 schema 与代码示例见 API 标签页。
| 参数 | 类型 | 作用 |
|---|---|---|
| model | string · 必填 | 'gpt-image-2' 走按 token 计费的官方线路,'gpt-image-2-beta' 走按次固定价的 1K 线路。 |
| prompt | string · 必填 | 文本指令。token 线路上 prompt 按文本输入 token 计量。 |
| size | string · 默认 auto | 'auto'、15 种比例之一(如 1:1、16:9),或以 16 的倍数显式指定 WxH 像素。 |
| resolution | string · 1K / 2K / 4K | 比例模式下的像素预算;size 为 auto 或显式像素时被忽略。 |
| quality | string · low / medium / high | 渲染力度。token 线路上决定输出 token 消耗 —— 调提示词用 low,最终成片再切到 high。 |
| background | string · opaque / transparent | 输出的背景通道。默认 opaque;transparent 为 Preview 功能,效果可能不稳定。 |
| n | integer · 1–10 | gpt-image-2 单次请求的出图数,成本线性叠加。GPT Image 2 Beta 每次调用只返回 1 张。 |
| image_urls | array · 最多 16 张 | 图生图与编辑用的参考图。每张都会增加图像输入 token。 |
| mask_url | string · 可选 | 带 alpha 通道的 PNG,像素尺寸需与参考图一致;透明区域会被重新生成。 |
| callback_url | string · 可选 | 接收任务结果的 HTTPS webhook,可替代轮询。 |
生产使用前需要考虑的限制
文字与排版仍需检查
文字渲染已有改善,但精确位置、清晰度和结构化构图仍可能偏离提示词。
大尺寸输出仍属实验性能力
自定义尺寸单边最高可达 3840 px,但总像素超过 3,686,400(即 2560×1440 的像素量)的输出目前仍属实验性能力。
透明背景为 Preview
background: "transparent" 已可使用,但仍处于 Preview,效果可能不稳定。
复杂请求可能更慢
OpenAI 提示复杂提示词最长可能需要两分钟处理。
为什么通过 EvoLink 使用 GPT Image 2
生成前就能算准成本
token 计费是 GPT Image 2 最难做预算的部分:图像输出 token 随分辨率和画质档位增长,每张参考图都会追加输入 token,提示词本身也按量计费。EvoLink 把这一切变成提交前就能看到的报价 —— 价格计算器和 Playground 都会按你即将发送的尺寸、分辨率、画质和参考图组合精确计价。
这会改变你的测试方式:在 low 档位迭代提示词,观察每次改动对预估的影响,只把最终成片提到 high —— 而不是等到月底账单才发现成本规律。
逐项低于 OpenAI 官方标价
本页定价区把每种 token 类型 —— 图像输出、图像输入、缓存输入和文本 —— 的 EvoLink 价格与 OpenAI 官方价并排列出,并逐行显示当前节省幅度,背后是 EvoLink 的最低价保证。
这份对比按实时 SKU 价格计算,而不是营销话术,所以你可以在接入时当场核实,也可以在用量增长到差价开始重要时随时复查。
同页两条计费路线
gpt-image-2 和 gpt-image-2-beta 并排提供:一条是官方按 token 计费路线,具备完整的 1K/2K/4K、画质档位、蒙版和多参考图能力;另一条是固定按次路线,每张 1K 图像价格相同,与提示词长度和参考图数量无关。
实践中,团队会把草稿、提示词迭代和批量 1K 任务放到成本完全可预测的固定路线上,把 2K/4K 成片、蒙版和多参考图编辑留给 token 路线。切换只是改一个 model ID,不是换供应商。
一把 API Key 通用图像、视频、音频和 LLM 路线
调用 gpt-image-2 的同一把 API Key,也能调用 Seedance 做视频、Nano Banana 2 和 Seedream 做备选图像路线,以及整个 LLM 目录 —— 一份余额、一份任务历史、一条认证路径。
这对图像工作尤其重要,因为流水线很少停在静态图:用 GPT Image 2 生成关键帧,用 Seedance 让它动起来,任务更适合别的图像模型时再回退 —— 无需维护多个供应商的账号、密钥和账单记录。
付费前可核查的任务状态
每次生成都会报告已提交、处理中、已完成或失败,响应和控制台里都附带错误详情。失败任务不会被当成计费成功的生成,一批出错的任务不会悄悄变成账单。
对生产系统来说,这就是"请求已发出"和"图像已交付"的区别:轮询任务、确认最终状态,需要解释某个数字时,再对照控制台里按任务的记录核对开销。
GPT Image 模型家族

EvoLink 上的其他图像模型




常见问题
GPT Image 2 与 ChatGPT Images 2.0 有什么关系?
GPT Image 2 是与 ChatGPT Images 2.0 同期发布、可通过 API 接入的图像模型,模型 ID 为 gpt-image-2。ChatGPT 可能会把图像生成与推理、网页搜索或多图编排结合,因此原始 API 模型不应被视为与所有 ChatGPT 产品工作流完全相同。
GPT Image 2 和 GPT Image 2 Beta 有什么区别?
这是 EvoLink 的两个独立路线变体。gpt-image-2 走按 token 计费的官方路线,支持 low/medium/high 画质、1K/2K/4K 分辨率、显式 WxH 像素、n 最多 10 张及局部重绘蒙版。gpt-image-2-beta 是 EvoLink 提供的 1K 固定按次路线,单次只出一张图,并非 OpenAI 官方模型 ID。
GPT Image 2 怎么收费?
按 token 计费。图像输出 token 是账单主体,随分辨率档和画质档增长;每张参考图会追加图像输入 token;提示词产生文本输入 token。Playground 会在提交前按所选组合给出预估。如果想要固定的单张价格,GPT Image 2 Beta 按次固定计费;定价区的计算器也能估算单张成本。
EvoLink 的 GPT Image 2 价格与 OpenAI 相比如何?
定价区会对比当前 EvoLink 价格与 OpenAI 官方标价,并显示查看时可获得的节省幅度。请使用计算器核算自己的尺寸、画质与参考图组合,不依赖不限定条件的统一单张价格。
GPT Image 2 应该使用 Image API 还是 Responses API?
使用 Image API 时,可直接选择 gpt-image-2 进行生成或编辑。使用 Responses API 时,需要选择支持 image_generation 工具的主模型,再由该工具处理图像模型选择,适合对话式或多步骤工作流。EvoLink 则提供自己的统一路由,用于直接调用模型。
接入 API 前能先试用吗?
可以。用 Playground 测出图质量、估算积分消耗,并在接进产品之前先看清请求 JSON。
size 和 resolution 有什么区别?
size 决定形状 —— auto、15 种比例之一,或显式 WxH 像素。resolution 只在比例模式下决定像素预算,size 为 auto 或显式像素时会被忽略。
参考图会计费吗?
会。image_urls 里的每张图都会增加图像输入 token。蒙版在预估阶段按额外一张输入图预留,最终按上游真实 usage 结算。
自定义像素有哪些限制?
宽高必须是 16 的倍数,总像素需落在 655,360 到 8,294,400 之间,任一边不超过 3840 px,长宽比需在 1:3 到 3:1 之间。总像素超过 3,686,400(即 2560×1440 的像素量)的输出目前仍属实验性能力。
一次请求能生成多张图吗?
gpt-image-2 可以,n 取值 1 到 10,成本线性增长。GPT Image 2 Beta 每次调用只返回一张。
局部重绘蒙版怎么用?
mask_url 需要一张带透明通道的 PNG,像素尺寸必须与参考图完全一致。透明像素表示要重绘的区域,不透明像素会被保留。没有参考图时蒙版会被丢弃。
生成失败了怎么办?
在响应或控制台里查看任务状态和错误详情。失败任务不应被当成计费成功的生成。
GPT Image 2 有哪些主要限制?
复杂提示词最长可能需要两分钟处理。文字位置、重复角色的一致性和精确的结构化构图仍可能需要多次迭代。
GPT Image 2 指南
API Reference
Select endpoint
Authentication
All APIs require Bearer Token authentication.
Authorization:
Bearer YOUR_API_KEY/v1/images/generationsGenerate Image
Create an image generation task using text prompts. Supports text-to-image and reference-image-assisted generation.
Asynchronous processing mode, use the returned task ID to query status.
Generated image links are valid for 24 hours, please save them promptly.
Request Parameters
modelstringRequiredDefault: gpt-image-2Image generation model name.
| Value | Description |
|---|---|
| gpt-image-2 | Official GPT Image 2 — token-based billing |
gpt-image-2promptstringRequiredPrompt describing the image to be generated or how to edit the reference image.
Notes
- Max 32,000 characters (counted by Unicode code points — works for CJK and other languages)
A beautiful colorful sunset over the oceansizestringOptionalDefault: autoAspect ratio or explicit pixel dimensions (WxH).
| Value | Description |
|---|---|
| auto | Default — let the model decide |
| 1:1 / 1:2 / 2:1 / 1:3 / 3:1 / 2:3 / 3:2 / 3:4 / 4:3 / 4:5 / 5:4 / 9:16 / 16:9 / 21:9 / 9:21 | Aspect ratio — pixel size decided together with the resolution tier |
| 1024x1024 (or any WxH) | Explicit pixels — multiples of 16, pixel budget 655K~8.29M, edges ≤3840, aspect ≤3:1 |
Notes
- When size is explicit WxH pixels, the resolution parameter is ignored.
- In auto mode the model decides the final size; resolution has no effect.
- Combinations that exceed the 8.29 MP pixel budget are proportionally scaled down (e.g. 4K 1:1 → 2880×2880).
autoresolutionstringOptionalDefault: 1KResolution tier shortcut. Only effective when size is a ratio; ignored for explicit pixels and auto.
| Value | Description |
|---|---|
| 1K | Pixel budget ≈ 1024² = 1.05MP (1:1 → 1024×1024, 16:9 → 1360×768) |
| 2K | Pixel budget ≈ 2048² = 4.19MP (1:1 → 2048×2048, 16:9 → 2736×1536) |
| 4K | Pixel budget = 8.29MP / MaxPixels (1:1 → 2880×2880, 16:9 → 3840×2160 UHD) |
2KqualitystringOptionalDefault: mediumRendering quality / reasoning depth. Directly drives output token count (tile base 16/48/96 for low/medium/high).
| Value | Description |
|---|---|
| low | Tile base 16 — fastest, ~0.11× cost vs medium |
| medium | Tile base 48 — balanced (default) |
| high | Tile base 96 — highest fidelity, ~4× cost vs medium |
mediumbackgroundstringOptionalDefault: opaqueAlpha channel of the output image. Transparent is a Preview feature and results may be unstable.
| Value | Description |
|---|---|
| opaque | Flat background, no alpha channel (default) |
| transparent | Keeps an alpha channel (Preview, may be unstable) |
opaquenintegerOptionalDefault: 1Number of images to generate (1-10). Each image is billed independently; text input tokens scale linearly with n.
1image_urlsarrayOptionalReference image URL list for image-to-image and image editing features.
Notes
- 1–16 images per request
- Each image ≤ 50 MB
- Supported formats: .jpeg, .jpg, .png, .webp
- URLs must be directly accessible by the server, or URLs that trigger direct download (typically URLs ending with image extensions like .png, .jpg)
- Reference images themselves consume additional image-input tokens in edit / image-to-image mode
https://example.com/image1.pngmask_urlstringOptionalInpainting mask image URL — marks the region of the reference image to regenerate. Only valid in image edit mode (combined with image_urls); ignored in pure text-to-image.
Notes
- Only PNG with an alpha channel is accepted — transparent pixels (alpha < 255) mark areas to regenerate, opaque pixels are preserved
- Mask dimensions must EXACTLY match the reference image dimensions (width × height in pixels)
- Requires at least one image in image_urls — mask alone has no effect
- Single mask per request
https://example.com/mask.pngcallback_urlstringOptionalHTTPS callback address after task completion.
Notes
- Triggered on completion, failure, or cancellation
- Sent after billing confirmation
- HTTPS only, no internal IPs
- Max length: 2048 chars
- Timeout: 10s, Max 3 retries
https://your-domain.com/webhooks/image-task-completed