# Edit image

`POST /v1/images/edits`

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

## Authorizations

Bearer authentication — send `Authorization: Bearer <token>`.

## Request Body (multipart/form-data)

```json
{
  "type": "object",
  "properties": {
    "image": {
      "description": "The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.",
      "type": "string",
      "format": "binary",
      "example": "cmMtdXBsb2FkLTE2ODc4MzMzNDc3NTEtMjA=/31225951_59371037e9_small.png"
    },
    "mask": {
      "description": "An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.",
      "type": "string",
      "format": "binary",
      "example": []
    },
    "prompt": {
      "description": "A text description of the desired image(s). The maximum length is 1000 characters.",
      "type": "string",
      "example": "A cute baby sea otter wearing a beret."
    },
    "n": {
      "description": "The number of images to generate. Must be between 1 and 10.",
      "type": "string",
      "example": "1"
    },
    "size": {
      "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.",
      "type": "string",
      "example": "1024x1024"
    },
    "response_format": {
      "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`.",
      "type": "string",
      "example": "url"
    },
    "user": {
      "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).",
      "type": "string",
      "example": ""
    },
    "model": {
      "type": "string",
      "example": "dall-e-2"
    }
  },
  "required": [
    "image",
    "prompt"
  ]
}
```

## Responses

### 200

```json
{
  "type": "object",
  "properties": {}
}
```
