Skip to content

GPT-Image 图片编辑 ​

GPT-Image 图片编辑使用 multipart/form-data,源图片通过文件字段传入。

Endpoint ​

POST /v1/images/edits

鉴权 ​

Authorization: Bearer <YOUR_API_KEY>

参数说明 ​

参数类型必填说明
modelstring是gpt-image-1.5 或 gpt-image-2。
promptstring是编辑指令。
imagefile 或 file[]是源图片文件;多图编辑时重复传 image[]。
maskfile否用于局部重绘的 PNG 蒙版,尺寸需与输入图片一致。
ninteger否生成数量,默认为 1。
sizestring否输出尺寸,例如 1024x1024、1024x1536、1536x1024、auto。
qualitystring否auto、high、medium、low。
input_fidelitystring否high 或 low;需要保留输入图身份、布局或商品细节时建议使用 high。
backgroundstring否auto、transparent、opaque。
output_formatstring否png 或 jpeg。
output_compressioninteger否JPEG 压缩质量,范围 0-100。
response_formatstring否仅支持 b64_json。

API Reference ​

查看底层接口定义