Models

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

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

ProviderMicrosoft
Model IDmai-image-2.7-flash
Best forImage generation
Context window32,000 tokens
Max output4,096 tokens
ModalitiesText, Image
Tool / function callingNo
Knowledge cutoff—
Acceleration🌐 Global (Centralized)

Pricing

Pricing in USD per 1M tokens.

Token typeInputCached inputOutput
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. 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-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.

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 '[email protected];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.

On this page