OpenAI
Edits an image given a source image and an edit instruction prompt. An optional mask defines the region to edit.Supported Models#
Notes#
gpt-image-* accepts multiple image[] parts to provide several reference images. (for gpt-image-2-vip only)
mask must be a PNG with a transparent edit region and the same dimensions as the source image.
Request
Provide your bearer token in the Authorization
header when making requests to protected resources. Example:Authorization: Bearer ********************
or
Body Params multipart/form-dataRequired
Request Code Samples
curl --location '/v1/images/edits' \
--header 'Authorization: Bearer <token>' \
--form 'model=""' \
--form 'prompt=""' \
--form 'image=@""' \
--form 'mask=@""' \
--form 'n="1"' \
--form 'size=""' \
--form 'quality=""' \
--form 'response_format=""' \
--form 'background=""' \
--form 'output_format=""' \
--form 'output_compression=""' \
--form 'user=""'
Responses
{
"created": 0,
"data": [
{
"url": "string",
"b64_json": "string",
"revised_prompt": "string"
}
]
}
Modified at 2026-07-29 01:22:52