Skip to main content
更新日期:2026-06-06

GPT Image

gpt-image-2 通过 OpenAI Images API 兼容路径调用:
gpt-image-2 图片生成请求请优先使用主承接线路 https://api.crazyrouter.com/v1。完整生成端点为 https://api.crazyrouter.com/v1/images/generations。账号登录、充值和控制台仍使用 https://crazyrouter.com

生成图像

请求参数

为兼容旧 DALL-E / OpenAI Images 客户端,gpt-image-2 会接收 response_format=urlresponse_format=b64_jsonquality=standardstyle=vivid/natural。其中 response_formatstyle 不会透传给上游,quality=standard 会归一为 auto
response_format 只是 Crazyrouter 为旧客户端保留的兼容字段,不是 gpt-image-2 上游参数。新接入请优先使用 output_format="png""jpeg""webp" 控制图片文件格式,并默认读取响应里的 data[0].url。如果旧客户端传 response_format="b64_json",服务端会尽量保留 base64 响应语义。
仍会被拒绝的参数组合包括:input_fidelitybackground=transparentoutput_format=png 搭配 output_compression

请求示例

流式生成

gpt-image-2 支持 stream=true。如果请求中包含 partial_images,必须同时开启 stream,且取值范围为 0-3
cURL
quality=high 或兼容写法 quality=hd 的同步请求可能耗时较长。图片生成业务请优先走 https://api.crazyrouter.com/v1;高质量请求建议使用 stream=true,或确保客户端超时大于 180 秒。

响应示例


编辑图像

基于已有图像进行编辑,支持遮罩区域编辑,也支持传入多张参考图做融合、风格迁移或局部组合。

请求参数

单图编辑示例

Python

多图参考编辑示例

多图编辑请求必须使用 multipart/form-data。推荐用多个 image[] 字段传参考图;服务端也兼容重复的 image 字段。
gpt-image-2 多图参考最多支持 16 张图片。多图请求会优先路由到支持多图参考的官方 OpenAI 承载渠道。