EasyRouterEasyRouter
Quick StartAPI DocsConnect Agent Tools
AI Model APIImagesNative OpenAI Format

Edit Image

Creates an edited or extended image given an original image and a prompt.

Note: This endpoint uses multipart/form-data for 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."
POST/v1/images/edits

Authorization

BearerAuth

AuthorizationBearer <token>

Authenticate using a Bearer Token. Format: Authorization: Bearer sk-xxxxxx

In: header

Request Body

multipart/form-data

model*string

ID of the model to use for image editing.

image*file

The image file to edit (PNG, less than 4MB, square). Must have transparency if no mask is provided.

Formatbinary
prompt*string

A text description of the desired image. Maximum length is 1000 characters.

mask?file

An optional mask image file (PNG, less than 4MB, same dimensions as image). Fully transparent areas indicate where the image should be edited.

Formatbinary
n?string

The number of images to generate. Must be between 1 and 10.

size?string

For gpt-image-2: 1024x1024, 1536x1024, 1024x1536, or auto. For dall-e-2: 256x256, 512x512, or 1024x1024.

user?string

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."
{}