# MAI-Image-2.7 · Flash Edit

Edit and enhance images with MAI-Image-2.7 · Flash Edit from fal through one Spiral API key. MAI-Image-2.7 Flash edits images from text instructions and up to five input images, using Microsoft’s lower-cost Flash variant with PNG, JPEG, or WebP output. It runs in the background and returns images. Pay as you go, with no subscription.

- Provider: fal
- Category: Image
- Runs: In the background
- Returns: image
- Tool id: `fal` / `microsoft/mai-image-2.7/flash/edit`
- Page: https://spiral.ai/tools/fal/microsoft/mai-image-2.7/flash/edit

## Pricing

Up to $0.02678 per run at the default inputs. `resolution`: 1K (default) $0.02678, 2K $0.06682.

## Limits

- Longest queue wait: 1 hour
- Run deadline: 30 minutes
- Longest run, end to end: 225 minutes
- Largest inline input: 1 MB
- Largest input file: 2 GB
- Largest output: 5 GB

## Input

| Field | Kind | Allowed | Default | Description |
| --- | --- | --- | --- | --- |
| `prompt` (required) | text |  | — | The instruction describing how to edit the input images. |
| `image_urls` (required) | URLs or files |  | — | The URLs of the images to edit or reference (up to 5). |
| `image_size` | JSON |  | — | The size of the edited image. If not set, the model picks a size close to the input. Each side must be at least 768 pixels and the total pixel count at most 4,194,304 (2048x2048). Custom sizes are rounded down to a multiple of 16. |
| `resolution` | one of | 1K, 2K | 1K | Resolution of preset image sizes: "1K" (about 1 megapixel) or "2K" (each side doubled). Ignored for custom sizes. |
| `background` | one of | opaque, transparent | opaque | Use "transparent" for a transparent background (requires png or webp output). |
| `output_format` | one of | jpeg, png, webp | png | The format of the edited image. |

## Example

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "fal",
    "model": "microsoft/mai-image-2.7/flash/edit",
    "input": {
      "prompt": "Make the teapot bright blue.",
      "image_urls": [
        "<image_urls>"
      ]
    }
  }'
```

Try it in the Playground: https://spiral.ai/start?provider=fal&model=microsoft%2Fmai-image-2.7%2Fflash%2Fedit

## Common questions

### MAI-Image-2.7 · Flash Edit

**How much does MAI-Image-2.7 · Flash Edit cost?**

Up to $0.02678 per run at the default inputs. `resolution`: 1K (default) $0.02678, 2K $0.06682. You pay as you go from one Spiral balance, with no subscription, and a failed run is not charged.

**How do I use MAI-Image-2.7 · Flash Edit through an API?**

Send `POST /v1/runs` with `"provider": "fal"`, `"model": "microsoft/mai-image-2.7/flash/edit"` and the input fields on this page, using one Spiral API key. It runs in the background: poll the run, or name a webhook to be told when it finishes.

**Do I need an account with fal to use MAI-Image-2.7 · Flash Edit?**

No. Spiral runs it on its own fal account and charges your Spiral balance.

**Can my AI agent use MAI-Image-2.7 · Flash Edit?**

Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.

