Edit Image
Creates an edited or extended image given an original image and a prompt.
Note: This endpoint uses
multipart/form-datafor file uploads. Use curl or an SDK to call it — the in-page playground does not support file uploads.
curl -X POST "https://easyrouter.io/v1/images/edits" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F model="gpt-image-2" \
-F image="@/path/to/image.png" \
-F prompt="A cute baby sea otter wearing a beret."/v1/images/editsAuthorization
BearerAuth
Authenticate using a Bearer Token.
Format: Authorization: Bearer sk-xxxxxx
In: header
Request Body
multipart/form-data
ID of the model to use for image editing.
The image file to edit (PNG, less than 4MB, square). Must have transparency if no mask is provided.
binaryA text description of the desired image. Maximum length is 1000 characters.
An optional mask image file (PNG, less than 4MB, same dimensions as image). Fully transparent areas indicate where the image should be edited.
binaryThe number of images to generate. Must be between 1 and 10.
For gpt-image-2: 1024x1024, 1536x1024, 1024x1536, or auto. For dall-e-2: 256x256, 512x512, or 1024x1024.
A unique identifier representing your end-user.
Response Body
application/json
curl -X POST "https://easyrouter.io/v1/images/edits" \ -F model="gpt-image-2" \ -F image="string" \ -F prompt="A cute baby sea otter wearing a beret."{}