Edit images
Changes one or more images following a prompt, optionally only where a mask is transparent.
Authentication
AuthorizationBearer
Your API key, sk-..., from Console → API keys.
Request
This endpoint expects a multipart form containing an optional file.
model
prompt
image
The image or images to edit.
mask
A PNG whose transparent areas mark what to change.
n
size
quality
background
Allowed values:
output_format
Allowed values:
user
Response
Links to the edited images.
created
data
usage
Token usage, for models billed by tokens.
Errors
400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
502
Bad Gateway Error