mai-image-2.7 — API, Pricing & Image Tokens | Vivgrid
MAI Image 2.7 on Vivgrid for precise edits and visual consistency across iterations, with separate text input, image input, and image output pricing.
MAI Image 2.7 is a Microsoft image generation and editing model for precise edits and visual consistency across iterations. Use it for controlled changes to objects, layouts, and text.
Specifications
| Provider | Microsoft |
| Model ID | mai-image-2.7 |
| 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 | $5.00 | — | $0.00 |
| Image | $8.00 | — | $34.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. These examples require curl, jq, and base64. Each request saves the JSON response and decodes the PNG.
export VIVGRID_API_KEY='YOUR_VIVGRID_API_KEY'Generate an image
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",
"prompt": "A single centered blue circle on a white background, simple flat geometric illustration, no text.",
"size": "768x768"
}' \
--output mai-image-2.7-generation.json &&
jq -er '.data[0].b64_json' mai-image-2.7-generation.json |
base64 --decode > mai-image-2.7-generated.pngEdit 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.
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' \
--form 'prompt=Change the blue circle to orange. Keep the white background.' \
--form '[email protected];type=image/png' \
--output mai-image-2.7-edit.json &&
jq -er '.data[0].b64_json' mai-image-2.7-edit.json |
base64 --decode > mai-image-2.7-edited.pngThe 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
gpt-5.3-codex
gpt-5.3-codex on Vivgrid: OpenAI's Codex-tuned coding model on the Responses API, with a 400K context window and geo-distributed acceleration.
mai-image-2.7-flashNew
MAI Image 2.7 Flash on Vivgrid for low-latency generation and editing, with separate text input, image input, and image output pricing.