# Microsoft MAI Image 2.7 Edit API

> MAI Image 2.7 Edit by Microsoft edits images from a text instruction, combining up to five reference images.

Source: https://www.sandbase.ai/models/microsoft/mai-image-2.7/edit
API reference: https://www.sandbase.ai/models/microsoft/mai-image-2.7/edit#api

## Facts

- Provider: Microsoft
- Type: Image model
- Model ID: `microsoft/mai-image-2.7/edit`
- Price: From $0.07 per run
- Capabilities: image to image
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "microsoft/mai-image-2.7/edit",
  "images": [
    [
      "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"
    ]
  ],
  "prompt": "Make the teapot bright blue.",
  "background": "opaque",
  "output_format": "png"
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## FAQ

### How do I call Microsoft MAI Image 2.7 Edit through SandBase?

Create a SandBase API key, then send requests with the model ID "microsoft/mai-image-2.7/edit" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### Do I need a separate Microsoft account?

No. One SandBase API key and balance gives you access to Microsoft MAI Image 2.7 Edit and the other models in the catalog; you do not need to sign up with Microsoft separately.

## README

### MAI Image 2.7 Edit
MAI Image 2.7 Edit changes one or more input images from a text instruction. Up to five images can be combined as references.
#### Fields
| Field | Type | Default | Notes |
|---|---|---|---|
| `images` | image files or URLs, required | — | 1 to 5 images. |
| `prompt` | string, required | — | The edit to make. |
| `aspect_ratio` | `21:9` / `16:9` / `3:2` / `4:3` / `5:4` / `1:1` / `4:5` / `3:4` / `2:3` / `9:16` | — | Unset keeps a size close to the input. |
| `background` | `opaque` / `transparent` | `opaque` | `transparent` needs png or webp. |
| `output_format` | `png` / `jpeg` / `webp` | `png` | File format. |
#### Billing
$0.07 per image with one input image, plus $0.01 for each additional input image.
| Input images | Price |
|---|---|
| 1 | $0.07 |
| 5 | $0.11 |
Failed runs are not charged.
#### Also on SandBase
Related: `microsoft/mai-image-2.7`, `microsoft/mai-image-2.5/edit`.
