Skip to main content
TokenCost logoTokenCost

MAI Code 2 Flash

Last verified November 21, 2026 · Microsoft pricing ↗

$0.050/1M input · $0.250/1M output · 1.1M context · Microsoft

MAI Code 2 Flash costs $0.050 per 1M input tokens and $0.250 per 1M output tokens from Microsoft, with a 1.1M-token context window. A typical chat reply (1,500 tokens in, 400 out) costs $0.0002, or $1.75 per 10,000 requests. On that workload it is cheaper than 173 of the 182 other buyable models tracked here.

Count Tokens

—
Tokens
—
Input Cost
—
Output Cost

Estimate Monthly Cost

Monthly Cost Estimator

Quick:
<$0.0001/mo

Pick a preset above or enter custom usage

What MAI Code 2 Flash Costs Per Request

At $0.050 per 1M input and $0.250 per 1M output tokens, before caching or batch discounts.

WorkloadInput / output tokensPer requestPer 10,000 requests
Chat reply1,500 / 400$0.0002$1.75
RAG answer over retrieved docs8,000 / 600$0.0006$5.50
Coding-agent step30,000 / 2,000$0.0020$20.00

MAI Code 2 Flash vs Similarly Priced Models

Nearest buyable models by price, with the RAG answer above (8,000 in / 600 out) priced on each.

ModelInput /1MOutput /1MContextRAG answer
MAI Code 2 Flash Microsoft$0.050$0.2501.1M$0.0006
Ministral 3 8B Mistral$0.150$0.150262K$0.0013
Muse Spark 1.3 Contributor Meta$0.100$0.2001.0M$0.0009
Laguna S 2.1 Poolside$0.100$0.2001.0M$0.0009

Alternatives to MAI Code 2 Flash

Pricing Details

MicrosoftSmall Microsoft coding model, announced at Ignite November 17, 2026. GitHub Copilot on all plans including Free and Student (legacy annual-plan multiplier 0.33), plus a limited-access Microsoft Foundry preview at the same rates (Azure Retail Prices API: Global $0.05 / $0.005 / $0.25; US Gov 1.375x; SFT $10 per 1M training tokens). Card on GitHub's Copilot pricing page (read 2026-11-21): PROMO $0.05 input / $0.005 cached / $0.25 output until May 17, 2027; from May 17, 2027 $0.10 / $0.01 / $0.50, identical to GPT-6 Luna and Claude Haiku 5.5's short-prompt card. No cache write fee, no long-context tier. Model card: 1,050,000 context, 12B active / ~398B total, text and image in, pre-training cutoff August 2026. Microsoft-reported at max effort: DeepSWE 1.1 59.9, Terminal-Bench 2.1 78.3, SWE-Atlas 44.8 (beats Code 2's 43.1). Chart per-task cost $0.052 vs GPT-6 Luna $0.080 vs Haiku 5.5 $0.319 (averages 61.0 / 55.1 / 53.9); Microsoft's blog says '20% of Haiku', its own chart gives 16%. At the May 2027 card ~$0.104 per task, 30% MORE than Luna, since Flash uses ~1.3x Luna's tokens. No Artificial Analysis listing as of 2026-11-21. Estimated tokens (different tokenizer).
Input / 1M tokens
$0.05
Output / 1M tokens
$0.25
Context Window
1.1M
Max Output
128K
Promotional pricing (50% off)

Scheduled price change

MAI Code 2 Flash bills at $0.05 input / $0.25 output per 1M tokens through May 16, 2027. From May 17, 2027 the rate becomes $0.1 input / $0.5 output per 1M tokens, a 100% increase. Every figure on this page uses the rate in effect today.

Microsoft’s published pricing ↗

Price History

No price change recorded since 2026-11-21, when this site started tracking this model; it launched on 2026-11-17.

Frequently Asked Questions

Common questions about MAI Code 2 Flash pricing and usage

How much does MAI Code 2 Flash cost?
MAI Code 2 Flash costs $0.05 per 1 million input tokens and $0.25 per 1 million output tokens. This pricing is set by Microsoft.
What tokenizer does MAI Code 2 Flash use?
MAI Code 2 Flash uses the cl100k_base tokenizer. This tokenizer has a vocabulary of ~100,000 tokens and is widely used across many models.
What is MAI Code 2 Flash's context window?
MAI Code 2 Flash supports a context window of 1.1M tokens (1,050,000 tokens). The maximum output length is 128K tokens.
How does MAI Code 2 Flash compare to other models?
On an 8,000-token-in, 600-token-out RAG answer, MAI Code 2 Flash costs $0.0006 per request. The nearest-priced alternatives cost: Ministral 3 8B (Mistral) $0.0013, Muse Spark 1.3 Contributor (Meta) $0.0009, Laguna S 2.1 (Poolside) $0.0009. The table above lists their full rates and context windows.
How do I count tokens for MAI Code 2 Flash?
Use the token counter at the top of this page or visit the homepage calculator. Paste your text and it will show the exact token count and cost for MAI Code 2 Flash using the cl100k_base tokenizer.