MAI Image 2.7 Flash on Vercel AI Gateway

MAI · Microsoft AI

Serverless

Last refreshed 2026-11-18. Next refresh: weekly.

Why use MAI Image 2.7 Flash on Vercel AI Gateway?

Vercel AI Gateway offers MAI Image 2.7 Flash with pay-as-you-go pricing at $1.75/1M input tokens. Vercel AI Gateway is a unified AI proxy providing a single OpenAI-compatible API endpoint to 275+ models from 25+ providers including Anthropic, OpenAI, Google, Meta, Mistral, DeepSeek, xAI, Alibaba, Amazon, ByteDance, Cohere, MiniMax, MoonshotAI, KwaiPilot, Black Forest Labs, Recraft, Voyage AI, NVIDIA, and more.

Compare MAI Image 2.7 Flash across 4 providers to find the best fit for your use case
Input / 1M
$1.75
Output / 1M
$10.00
Cache
Not sourced
Batch
Not sourced

Setup recipe

Python + curl
Install
pip install openai
Auth
export AI_GATEWAY_API_KEY=...
Call
import os
from openai import OpenAI
client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
Model ID
microsoft/mai-image-2.7-flash

Request example

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
    base_url="https://ai-gateway.vercel.sh/v1"
)
response = client.chat.completions.create(
    model="microsoft/mai-image-2.7-flash",
    messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)

Gotchas

  • Use provider model ID "microsoft/mai-image-2.7-flash", not the LLMReference slug "mai-image-2-7-flash".
  • creator/model-name e.g. kwaipilot/kat-coder-pro-v2
  • The examples expect AI_GATEWAY_API_KEY; rename it only if your application config maps the new variable.

Compare MAI Image 2.7 Flash Across Providers

ProviderInput (per 1M)Output (per 1M)
OpenRouter$1.75$10.00
Vercel AI Gateway$1.75$10.00
Microsoft Foundry$1.75$10.00
fal API$1.75$10.00

Pricing

TypePrice (per 1M)
Input tokens$1.75
Output tokens$10.00

Capabilities

VisionMultimodal

About MAI Image 2.7 Flash

MAI Image 2.7 Flash is Microsoft AI’s image generation and editing model for rapid iteration. It supports text-to-image generation and reference-guided editing, including object replacement, text changes and image enhancement while preserving composition. It is available in public preview through Microsoft Foundry and through model gateways.

Get Started