Edits or inpaints images with OpenAI-compatible image editing models.
Authorization: Bearer {API_KEY}multipart/form-dataimage and prompt, while mask narrows the editable regiongpt-image-1 and dall-e-2 differ materially on file-size limits, multi-image support, and input_fidelityurl values, mirror them quickly. If it contains b64_json, avoid decoding too many large images on the main threadBearer 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.
Successful image edit response
Unix timestamp in seconds.
transparent, opaque, auto png, jpeg, webp auto, high, medium, low, hd, standard