# Microsoft MAI Image 2.7 Flash Text to Image API

> MAI Image 2.7 Flash by Microsoft turns a text prompt into a high-quality image, with optional transparent background.

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

## Facts

- Provider: Microsoft
- Type: Image model
- Model ID: `microsoft/mai-image-2.7-flash`
- Price: From $0.03 per run
- Capabilities: text 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-flash",
  "prompt": "A ceramic teapot beside a sunlit window, realistic photography.",
  "background": "opaque",
  "aspect_ratio": "1:1",
  "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 Flash Text to Image through SandBase?

Create a SandBase API key, then send requests with the model ID "microsoft/mai-image-2.7-flash" 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 Flash Text to Image and the other models in the catalog; you do not need to sign up with Microsoft separately.

## README

### MAI Image 2.7 Flash Text to Image
MAI Image 2.7 Flash is the faster, lower-cost tier of Microsoft's MAI-Image-2.7 model. It turns a text prompt into a photorealistic or illustrated image, with optional transparent background.
#### Fields
| Field | Type | Default | Notes |
|---|---|---|---|
| `prompt` | string, required | — | What to draw. |
| `aspect_ratio` | `21:9` / `16:9` / `3:2` / `4:3` / `5:4` / `1:1` / `4:5` / `3:4` / `2:3` / `9:16` | `1:1` | Output shape. |
| `background` | `opaque` / `transparent` | `opaque` | `transparent` needs png or webp. |
| `output_format` | `png` / `jpeg` / `webp` | `png` | File format. |
#### Billing
$0.025 per image. Failed runs are not charged.
#### Also on SandBase
Related: `microsoft/mai-image-2.7-flash/edit`, `microsoft/mai-image-2.5/edit`.
