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:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | ID of the model to use for image editing. |
image | string | Yes | The image file to edit (PNG, less than 4MB, square). Must have transparency if no mask is provided. |
prompt | string | Yes | A text description of the desired image. Maximum length is 1000 characters. |
mask | string | No | An optional mask image file (PNG, less than 4MB, same dimensions as image). Fully transparent areas indicate where the image should be edited. |
n | string | No | The number of images to generate. Must be between 1 and 10. |
size | string | No | For gpt-image-2: 1024x1024, 1536x1024, 1024x1536, or auto. For dall-e-2: 256x256, 512x512, or 1024x1024. |
user | string | No | A 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
{}