# mai-image-2.7-flash — API, Pricing & Image Tokens | Vivgrid

> Source: https://vivgrid.com/docs/models/mai-image-2.7-flash

MAI Image 2.7 Flash on Vivgrid for low-latency generation and editing, with separate text input, image input, and image output pricing.

MAI Image 2.7 Flash is a Microsoft image generation and editing model for low-latency generation and editing. Use it for interactive revisions and high-volume image generation.

## Specifications

| Field | Value |
| --- | --- |
| Provider | Microsoft |
| Model ID | `mai-image-2.7-flash` |
| Best for | Image generation |
| Context window | 32,000 tokens |
| Max output | 4,096 tokens |
| Modalities | Text, Image |
| Tool / function calling | No |
| Knowledge cutoff | — |
| Acceleration | Global (centralized) |

## Pricing

Pricing in USD per 1M tokens.

| Token type | Input | Cached input | Output |
| --- | --- | --- | --- |
| Text | $1.75 | — | $0.00 |
| Image | $2.50 | — | $10.00 |


## API surfaces

Generate a PNG with `/v1/images/generations` or edit an image with `/v1/images/edits`. Both endpoints use the same Vivgrid API key.

## Quick start

Get an API key from the [Vivgrid Console](https://console.vivgrid.com). These examples require `curl`, `jq`, and `base64`. Each request saves the JSON response and decodes the PNG.

```bash
export VIVGRID_API_KEY='YOUR_VIVGRID_API_KEY'
```

### Generate an image

```bash
curl --silent --show-error --fail-with-body \
  --request POST https://api.vivgrid.com/v1/images/generations \
  --header "Authorization: Bearer ${VIVGRID_API_KEY}" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-binary '{
    "model": "mai-image-2.7-flash",
    "prompt": "A single centered blue circle on a white background, simple flat geometric illustration, no text.",
    "size": "768x768"
  }' \
  --output mai-image-2.7-flash-generation.json &&
jq -er '.data[0].b64_json' mai-image-2.7-flash-generation.json |
  base64 --decode > mai-image-2.7-flash-generated.png
```

### Edit the generated image

This example uploads the PNG from the previous step as multipart form data. You can send up to five JPEG or PNG reference images by repeating the `image` field.

```bash
curl --silent --show-error --fail-with-body \
  --request POST https://api.vivgrid.com/v1/images/edits \
  --header "Authorization: Bearer ${VIVGRID_API_KEY}" \
  --header 'Accept: application/json' \
  --form 'model=mai-image-2.7-flash' \
  --form 'prompt=Change the blue circle to orange. Keep the white background.' \
  --form 'image=@mai-image-2.7-flash-generated.png;type=image/png' \
  --output mai-image-2.7-flash-edit.json &&
jq -er '.data[0].b64_json' mai-image-2.7-flash-edit.json |
  base64 --decode > mai-image-2.7-flash-edited.png
```

The `usage` object in each saved JSON response contains the token counts.

Text input, reference images, and generated images are metered separately. The model supports images up to 2,048 × 2,048 pixels.

## Related models

- [MAI Image 2.7](/docs/models/mai-image-2.7)
- [gpt-image-2.5-flare](/docs/models/gpt-image-2.5-flare)
