GPT-image-2 AI 图像 API
GPT Image 2 是 OpenAI 的图像模型,通过 Flatkey 的图像生成流程提供。使用 /v1/images/generations,发送前配置数量、尺寸、质量、格式、背景和 moderation 字段。
输出
预览
使用 Image 2 生成
请求摘要
- 接口
- POST /v1/images/generations
- 模型 ID
- GPT-image-2
- 画面比例
- 16:9
- 分辨率
- 1536x1024
- 质量
- high
- 输出数量
- 1
仅供预览。登录后即可向 Flatkey 提交此请求。
{
"model": "gpt-image-2",
"prompt": "Scene: On a rain-soaked observatory roof at sunrise, a lone figure in a long dark coat walks toward a large telescope beside an open dome. Wet stone reflects the warm doorway light; cloud-covered mountains sit beyond. Hold the screen direction and end on the telescope and figure in the same wide composition. No readable text, logos, or watermark.\n\nComposition and rendering: Deliver one 16:9 storyboard keyframe, not a collage or an action sequence. Separate foreground, character plane and background through the existing light and atmospheric depth. Keep the stated pose and eyelines readable, and retain environmental landmarks for continuity. Match the described photographic, illustrated or puppet medium; give fabric and surfaces texture appropriate to that medium.\n\nAvoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.",
"n": 1,
"size": "1536x1024",
"quality": "high",
"output_format": "png",
"background": "opaque",
"moderation": "auto"
}能力
GPT Image 2 API 性能与可用性
当 Flatkey 实时请求流量足够时,这里会显示 GPT Image 2 的请求遥测;不据此推断基准测试或质量评分。
API
GPT Image 2 API 使用与请求活动
此区块反映 Flatkey 对 GPT Image 2 的实时请求;收集到足够流量前不会报告数据。
价格
GPT Image 2 按 token 与图像尺寸计价
下方价格来自当前模型的 Flatkey 定价数据,以及定价 API 返回的可见分组。
充值余额
图像、视频、音频和文本模型共用同一个 Flatkey 余额和 API Key。
- 模型类型
- 文生图
- API
- /v1/images/generations
- 计费依据
- 图像
- 输出数量
- 1–10
GPT Image 2 图像生成与编辑能力
下方只展示已记录的集成字段,不推断基准测试或质量承诺。
文生图与图像编辑
通过 /v1/images/generations 生成新画面,也可通过 /v1/images/edits 修改已有图片。
参考图驱动创作
使用图片上下文保留主体与构图细节,适合产品、编辑和营销素材制作。
多场景视觉变体
围绕同一创意生成方形、竖版或横版素材,适配不同版位和渠道。
安全且适合交付
结合模型已记录的质量、格式、背景和内容审核行为,整理可直接进入制作流程的结果。
对比
GPT Image 2 与 GPT Image 1 的迁移字段对比
下方只展示已记录的集成字段,不推断基准测试或质量承诺。
| 能力 | GPT Image 1 | GPT Image 2 |
|---|---|---|
| 端点 | 此处未知 | /v1/images/generations; /v1/images/edits |
| 尺寸 | 此处未知 | 1024x1024, 1536x1024, 1024x1536, auto |
| 格式 | 此处未知 | PNG, JPEG, WebP |
| 质量/背景/moderation | 此处未知 | 见上方文档 |
| 图像质量排名 | 未声明 | 未声明 |
接入前先选对请求方式
核对支持的工作流、当前配置的实时费用,以及 Flatkey 实际使用的参数契约。
当目录提供固定单价时,根据当前 Playground 配置和实时目录价格计算。
- 当前配置
- 1536x1024 · high · 1×
- 实时单价
- $0.0088 / 图像
- 本次预估
- $0.0088
最终费用以实际提交的请求和账户分组为准。Token 或分层计费无法简化成一个固定预估值。
工作流与 Model ID
只使用标记为可用的工作流。Flatkey 对外保持一个模型 ID,由请求体选择输入方式。
文生图
通过文本提示词和输出参数生成新图片。
- 模型 ID
gpt-image-2- 接口
/v1/images/generations
参考图生成与编辑
用参考图片完成编辑、变体或主体与构图引导。
- 模型 ID
gpt-image-2- 接口
/v1/images/generations
参数兼容矩阵
以下取值与 Playground 和请求预览使用同一份模型配置。
n图片数量1–10
默认值: 1size尺寸1024x1024 · 1536x1024 · 1024x1536 · auto
默认值: 1024x1024quality质量auto · high · medium · low
默认值: highoutput_format输出格式png · jpeg · webp
默认值: pngbackground背景opaque · auto
默认值: opaquemoderation审核强度auto · low
默认值: autoimage参考素材上限4 个文件
接口: /v1/images/generations从首次测试到生产接入
Playground 与 API 使用同一套请求契约,并明确处理参数校验、余额、任务状态和产物获取。
请求生命周期
- 1
校验模型、提示词、参考素材和输出设置。
- 2
使用已文档化字段提交图片请求。
- 3
读取路由返回的生成结果或异步任务结果。
- 4
在自己的工作流中保存生成文件和请求元数据。
生产检查项
提交前拦截不支持的尺寸、时长、比例、格式或参考素材数量。
分别处理无效密钥、余额不足、限流和账户分组价格。
明确指出被拒绝的提示词或素材,让用户只替换失败的输入。
保留任务 ID,限制重试次数,且不能把超时当成生成成功。
提示词库
GPT Image 2 产品与营销图像提示词示例
从具体主体、动作、镜头或构图和明确的输出设置开始;请求字段与提示词分开配置。
使用 Image 2 生成
Scene: A 16:9 sci-fi game loadout screen in a blue-purple spaceship hangar. A female armored character stands centered with a glowing violet rifle; armor slots line the left, three weapon slots line the right, and the lower slot is highlighted. Keep the HUD hierarchy, pose, lighting, and equipment geometry fixed for an exact equipment-switch frame. No readable words, logos, invented stats, or watermark. Composition and rendering: Deliver one 16:9 game-interface keyframe. Separate the character, held equipment and HUD into clear depth layers; keep slot spacing and icon scale consistent, with the selected item visually dominant. Preserve the scene-specific game art style. Let material edges catch the existing light without letting interface glow obscure the silhouette. Keep all equipment fully inside the frame. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
使用 Image 2 生成
Scene: A rainy night soccer broadcast frame under bright stadium floodlights. A black-uniform player strikes the ball while two white-uniform defenders close in, with the goal and a blurred crowd behind. Keep the broadcast camera angle, blank blue score bars, spray, and motion blur consistent; leave overlays abstract and text-free. No real teams, athletes, logos, or watermark. Composition and rendering: Deliver one 16:9 broadcast still at the decisive instant. Use coherent perspective for the playing surface and equipment, readable separation between competitors, and a softer crowd behind the action. Keep the principal subject sharp, with directional blur limited to fast extremities and spray. Preserve the specified broadcast angle and reserve overlay areas clear of the action. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
使用 Image 2 生成
Scene: A closed matte-black square smartwatch with a black strap rests on a wet glossy black tabletop. Water droplets catch a cool blue rim light and a soft reflection sits beneath the watch. Use a low three-quarter product camera and preserve the case, strap, highlights, and empty dark background. No readable branding, extra products, hands, or watermark. Composition and rendering: Deliver one 16:9 commercial product still. Keep the complete product silhouette inside generous crop-safe margins. Resolve edges, seams and material transitions precisely; shape highlights to describe volume without clipping bright surfaces or crushing dark details. Align reflections with the object and light source. Retain the stated camera angle and existing negative space; add no decorative props. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
使用 Image 2 生成
Scene: On a rain-soaked observatory roof at sunrise, a lone figure in a long dark coat walks toward a large telescope beside an open dome. Wet stone reflects the warm doorway light; cloud-covered mountains sit beyond. Hold the screen direction and end on the telescope and figure in the same wide composition. No readable text, logos, or watermark. Composition and rendering: Deliver one 16:9 storyboard keyframe, not a collage or an action sequence. Separate foreground, character plane and background through the existing light and atmospheric depth. Keep the stated pose and eyelines readable, and retain environmental landmarks for continuity. Match the described photographic, illustrated or puppet medium; give fabric and surfaces texture appropriate to that medium. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
使用 Image 2 生成
Scene: In a bright home kitchen, a surprised cook in a blue shirt and cream apron reaches toward pancakes, a frying pan, flour, bowl, and whisk suspended midair. Freeze the comic cause-and-effect moment with believable weight, warm daylight, and a clear path for each object. No injury, logos, readable words, or watermark. Composition and rendering: Deliver one 16:9 physical-comedy still at the described instant. Make the cause of the gag readable through body balance, grip and object spacing. Separate the reaction from the airborne props; retain believable gravity and contact points. Keep the face and important props sharp, with only restrained directional blur on fast edges. Preserve the stated lighting and room or stage layout. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
使用 Image 2 生成
Scene: A rainy period harbor platform shelters people in era-appropriate coats and umbrellas as a vintage green tram arrives on wet tracks. Wooden waterfront buildings and misty mountains sit behind the reflections. Preserve the historical clothing, tram shape, rain direction, and stable wide composition; no readable signage, logos, or watermark. Composition and restoration: Deliver one 16:9 archival-style still. Preserve the original framing, period-specific construction and restrained tonal range; retain monochrome, sepia or faded color as described. Recover modest detail in faces, clothing and architecture without synthetic sharpening. Keep fine grain and authentic aging consistent across the frame; repair damage without replacing historical features. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
为什么选择 Flatkey
为什么通过 Flatkey 使用 GPT Image 2?
在从测试请求走向生产流量时,清楚展示 GPT Image 2 的事实、请求字段和价格边界。
集中展示已记录控制项
在请求交给控制台前,设置 n、size、quality、output format、background 和 moderation。
价格维度清晰
分别查看 GPT Image 2 已记录的输入、输出和缓存维度,不要把一个标题价格当作统一价格。
贴合工作流的起点
将产品、广告和分镜示例作为可编辑的提示词起点。
不做未经核实的承诺
在事实未核实的情况下,本页不承诺透明输出、免费生成或固定单图价格。
API
GPT Image 2 API endpoint 与请求设置
将模型 ID 与支持的图像控制项一同发送。
curl https://router.flatkey.ai/v1/images/generations \ -H "Content-Type: application/json" \ -H "Authorization: Bearer sk-***" \ -d '{"model":"gpt-image-2","prompt":"Creative direction: Create a vertical illustrated fantasy narrative poster with a large dark-haired profile silhouette on the left, a layered mountain temple city in the center, a red torii gate, drifting cherry blossoms, and small travelers along the bottom edge. Use a cream paper texture with ink-and-wash detail, a restrained charcoal, vermilion, and muted violet palette, and reserve a clean right margin for the title and credits.\n\nComposition, material and finish: Build the silhouette and temple city as nested visual layers, with the gate as the vermilion focal accent. Keep small travelers distinct from architectural detail. Use delicate ink edges and paper grain rather than photographic skin or glossy 3D surfaces. Leave the right title margin genuinely empty; avoid added lettering, duplicated gates, muddied silhouettes and watermarks.","n":1,"size":"1024x1024","quality":"high","output_format":"png","background":"opaque","moderation":"auto"}'
常见问题
GPT Image 2
API: 价格与提示词问题
价格、兼容性、限制与模型专属请求细节。




