Edits or inpaints images with OpenAI-compatible image editing models.
Authorization: Bearer {API_KEY} 鉴权multipart/form-dataimage 与 prompt,mask 用于限定可编辑区域gpt-image-1 与 dall-e-2 的输入限制差异较大,特别是文件大小、是否支持多图和 input_fidelityurl,建议由服务端尽快转存;如果返回 b64_json,避免前端一次性解码过多大图Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Input image or images to edit.
Text instruction describing the desired edit.
"在图片中添加一朵红色的玫瑰花"
Only supported by gpt-image-1.
transparent, opaque, auto Only supported by gpt-image-1.
high, low Optional PNG mask file. Usually must match the image dimensions.
Image editing model.
gpt-image-1, dall-e-2 Number of edited images to generate.
1 <= x <= 10Compression level for gpt-image-1 jpeg/webp output.
0 <= x <= 100Only supported by gpt-image-1.
png, jpeg, webp Number of partial images for streaming previews.
0 <= x <= 3Supported values vary by model.
auto, high, medium, low, standard Only applies to dall-e-2.
url, b64_json Allowed values depend on the selected model.
1024x1024, 1536x1024, 1024x1536, auto, 256x256, 512x512 Streams edited image output when supported.
Unique identifier for the end user.