API DocsAI Model APIsImagesOpenAI

Edit Image

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

Edit Image

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

Base URL

  • https://autorouter.top — Production

Authentication

BearerAuth: http (bearer) Authenticate using a Bearer Token. Format: Authorization: Bearer sk-xxxxxx

Endpoints

POST /v1/images/edits

Edit Image

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

Request Body

Content-Type: multipart/form-data

Properties:

NameTypeRequiredDescription
modelstringYesID of the model to use for image editing.
imagestringYesThe image file to edit (PNG, less than 4MB, square). Must have transparency if no mask is provided.
promptstringYesA text description of the desired image. Maximum length is 1000 characters.
maskstringNoAn optional mask image file (PNG, less than 4MB, same dimensions as image). Fully transparent areas indicate where the image should be edited.
nstringNoThe number of images to generate. Must be between 1 and 10.
sizestringNoFor gpt-image-2: 1024x1024, 1536x1024, 1024x1536, or auto. For dall-e-2: 256x256, 512x512, or 1024x1024.
userstringNoA unique identifier representing your end-user.

Responses

200: Response

Content-Type: application/json

Request Example

curl -X POST "https://autorouter.top/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."

Response Examples

{}

On this page