Documentation
API Reference
POST
Image Edits
/v1/images/edits
Edit an existing image based on a new text prompt using various models available through A4F.
Model Availability
Support for image editing varies by provider. Check the Models page to see which models have the type
images/edits
.Interactive Example
Request & Response Example
Headers
Authorization
stringRequired
Bearer token for authentication. Your A4F API key. Example:
Bearer ddc-a4f-xxxxxxxx
.Content-Type
stringRequired
Must be
multipart/form-data
. Your HTTP client will typically set this automatically when sending form data.Request Body (Multipart Form)
model
stringRequired
ID of the image editing model to use. Must include the provider prefix and be of type
images/edits
.image
fileRequired
The image file to edit. Must be a valid PNG, JPEG, GIF, or WEBP file, less than 4MB in size.
prompt
stringRequired
A text description of the desired edit to apply to the image.
response_format
stringThe format in which the edited image is returned. Must be one of
url
or b64_json
.Default: url
user
stringA unique identifier representing your end-user, which can help in monitoring and detecting abuse.
Response Body (200 OK)
The response structure is identical to the image generation endpoint.
created
integerThe Unix timestamp of when the edit was processed.
data
array of objectsAn array containing the edited image data.
b64_json
stringThe base64-encoded JSON of the edited image, if requested.
url
stringThe URL of the edited image. URLs are temporary and will expire.
Was this page helpful?