> ## Documentation Index
> Fetch the complete documentation index at: https://bianxieai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit images

> Edit an image with a prompt

Send `multipart/form-data`.

| Field                                 | Type         | Required | Description                                              |
| ------------------------------------- | ------------ | -------- | -------------------------------------------------------- |
| `image`                               | file/file\[] | Yes      | Input image(s), subject to model format and size limits. |
| `prompt`                              | string       | Yes      | Desired edit.                                            |
| `model`                               | string       | Yes      | Image editing model ID.                                  |
| `mask`                                | file         | No       | Mask identifying editable regions.                       |
| `n`, `size`, `quality`                | mixed        | No       | Count, dimensions, and quality.                          |
| `background`, `output_format`, `user` | string       | No       | Background, format, and user ID.                         |

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.bianxie.ai/v1/images/edits \
    -H "Authorization: Bearer API_KEY" \
    -F "model=your-model" \
    -F "prompt=Add a red hat" \
    -F "image=@input.png"
  ```

  ```python Python theme={null}
  client.images.edit(model="your-model", image=open("input.png", "rb"), prompt="Add a red hat")
  ```

  ```javascript Node.js theme={null}
  await client.images.edit({ model: "your-model", image: fs.createReadStream("input.png"), prompt: "Add a red hat" });
  ```
</CodeGroup>

The response matches image generation. Let the HTTP client create the multipart boundary. Streaming is not supported by default.
