GPT-Image 图片编辑

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

Endpoint

POST /v1/images/edits

鉴权

Authorization: Bearer <YOUR_API_KEY>

参数说明

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

API Reference

查看底层接口定义