Skip to main content
TokenCost logoTokenCost

MAI Code 2

Last verified November 21, 2026 · Microsoft pricing ↗

$0.500/1M input · $2.50/1M output · 1.1M context · Microsoft

MAI Code 2 costs $0.500 per 1M input tokens and $2.50 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.0018, or $17.50 per 10,000 requests. On that workload it is cheaper than 112 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 Costs Per Request

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

WorkloadInput / output tokensPer requestPer 10,000 requests
Chat reply1,500 / 400$0.0018$17.50
RAG answer over retrieved docs8,000 / 600$0.0055$55.00
Coding-agent step30,000 / 2,000$0.020$200.00

MAI Code 2 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 Microsoft$0.500$2.501.1M$0.0055
Grok Build 0.1 xAI$1.00$2.00256K$0.0092
Nemotron 3 Ultra 550B NVIDIA$0.500$2.501.0M$0.0055
Nex-N2-Pro Nex AGI$0.500$2.50262K$0.0055

Alternatives to MAI Code 2

Pricing Details

MicrosoftMicrosoft coding model, announced at Ignite November 17, 2026. Sold through GitHub Copilot on usage-based billing (Pro, Pro+, Max, Business, Enterprise; legacy annual-plan multiplier 1). Card on GitHub's Copilot pricing page (read 2026-11-21): PROMO $0.50 input / $0.025 cached / $2.50 output until May 17, 2027; from May 17, 2027 $1.00 / $0.05 / $5.00, which is GPT-6.1 Terra's card to the cent. No cache write fee, no long-context tier. No Foundry meter, not on OpenRouter (Microsoft says OpenRouter, Vercel, Kilo coming soon); weights not distributed. Model card: 1,050,000 context (922K input + 128K output), text and image in, effort low/medium/high/xhigh/max, pre-training cutoff August 2026, English-optimized; the launch post says 'not yet tuned for very long-horizon agentic work' while the card recommends Code 2 for long-horizon tasks; parameter counts conflict (80B active in the table, 77B active / ~2.8T total in text). Microsoft-reported at max effort via Copilot CLI: DeepSWE 1.1 73.2, Terminal-Bench 2.1 84.6, SWE-Atlas 43.1, FrontierCode 1.1 52 (a second 'advanced autonomy' table gives DeepSWE 60.2, unexplained). Claims 98% of GPT-6.1 Sol at 40% of the cost and 96% of Opus 5.5 at 5%, AT THE PROMO PRICE: chart per-task costs $0.309 vs Sol $0.761 vs Opus 5.5 $6.306 (averages 63.2 / 64.1 / 65.3, competitor rows via InfoWorld). At the May 2027 card that task is ~$0.618, 81% of Sol and 9.8% of Opus. Implied ~1.6x Sol's tokens per task. No Artificial Analysis listing as of 2026-11-21. Estimated tokens (different tokenizer).
Input / 1M tokens
$0.5
Output / 1M tokens
$2.5
Context Window
1.1M
Max Output
128K
Promotional pricing (50% off)

Scheduled price change

MAI Code 2 bills at $0.5 input / $2.50 output per 1M tokens through May 16, 2027. From May 17, 2027 the rate becomes $1.00 input / $5.00 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 pricing and usage

How much does MAI Code 2 cost?
MAI Code 2 costs $0.5 per 1 million input tokens and $2.5 per 1 million output tokens. This pricing is set by Microsoft.
What tokenizer does MAI Code 2 use?
MAI Code 2 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's context window?
MAI Code 2 supports a context window of 1.1M tokens (1,050,000 tokens). The maximum output length is 128K tokens.
How does MAI Code 2 compare to other models?
On an 8,000-token-in, 600-token-out RAG answer, MAI Code 2 costs $0.0055 per request. The nearest-priced alternatives cost: Grok Build 0.1 (xAI) $0.0092, Nemotron 3 Ultra 550B (NVIDIA) $0.0055, Nex-N2-Pro (Nex AGI) $0.0055. The table above lists their full rates and context windows.
How do I count tokens for MAI Code 2?
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 using the cl100k_base tokenizer.

Read More About MAI Code 2