MAI Code 2
Microsoft's in-house coding model for GitHub Copilot, priced far below frontier models
Context window
1.05M
Input / 1M tokens
$0.50
Output / 1M tokens
$2.50
Provider
Microsoft
GitHub Copilot usage-based billing at a promotional rate until May 17, 2027: $0.50 per 1M input tokens, $0.025 cached input and $2.50 output. From May 17, 2027 the standard rate is $1.00/$0.05/$5.00. Usage draws on the AI credits included in Copilot plans before per-token billing applies. Max input 922K tokens and max output 128K; GitHub says the 1M-token context is available in Visual Studio Code and Copilot CLI only. · Data verified 2026-11-24
MAI Code 2 (November 17, 2026) is the larger of two in-house coding models Microsoft AI launched at Ignite, alongside MAI Code 2 Flash. Microsoft trained both from scratch as sparse Mixture-of-Experts models with an integrated vision encoder; they accept text and images, have a 1.05M-token context window with 128K max output, and offer reasoning effort from low to max. Microsoft says MAI Code 2 delivers about 98% of GPT-6.1 Sol's performance at about 40% of its cost, and about 96% of Claude Opus 5.5's at about 5%, averaged over four coding benchmarks and measured at a 50% promotional price. It is available only in GitHub Copilot, and Microsoft says it is not yet tuned for fundamental science research or very long-horizon agentic work.
How to access it
Available in GitHub Copilot on Pro, Pro+, Max, Business and Enterprise plans (GitHub says for eligible subscribers on annual plans) through the model picker in Visual Studio Code, Visual Studio, Copilot CLI, Copilot cloud agent, the GitHub Copilot app, github.com, GitHub Mobile, JetBrains, Xcode and Eclipse. There is no public API yet; Microsoft says it will release the MAI Code 2 models on OpenRouter, Vercel and other platforms soon.
Strengths
- ✓$0.50/$2.50 per 1M tokens in GitHub Copilot until May 17, 2027 ($1.00/$5.00 after)
- ✓73.2% on DeepSWE v1.1 and 84.6% on Terminal-Bench 2.1 at max effort (Microsoft-reported)
- ✓Image input for screenshots, UI mockups, charts and diagrams in coding tasks
- ✓1.05M-token context window and 128K max output
- ✓Developers preferred its frontend output over GPT-6 Sol 64% of the time in Microsoft's blind evaluation
Best for developers who...
When to choose it (and when not to)
Reach for MAI Code 2 when...
- →You use GitHub Copilot and want a capable coding model at a fraction of frontier per-token prices
- →Frontend work from screenshots or mockups
- →Large repositories that benefit from the 1M-token context in VS Code or Copilot CLI
Look elsewhere if...
- ✕You need an API outside GitHub Copilot (none yet)
- ✕Very long-horizon agentic work or science research, which Microsoft says it is not yet tuned for
- ✕Non-English work: Microsoft says it is optimized for English code production only at release
How to use it
- ›Raise reasoning effort for hard debugging; Microsoft notes higher effort adds latency and tokens and does not always improve results
- ›Treat output as a draft and review and test it before merging, as Microsoft's model card advises
Benchmarks
| Benchmark | Score | Notes |
|---|---|---|
| DeepSWE v1.1 | 73.2% (max effort) | Microsoft-reported, model card; MSBench with GitHub Copilot CLI 1.0.102, subagents off, mean of three runs; MAI Code 2 Flash 59.9% |
| Terminal-Bench 2.1 | 84.6% (max effort) | Microsoft-reported, model card; same harness; MAI Code 2 Flash 78.3% |
| SWE Atlas | 43.1% (max effort) | Microsoft-reported, model card; codebase Q&A, test writing and refactoring tasks; MAI Code 2 Flash 44.8% |
Source: MAI Code 2 and MAI Code 2 Flash model card (Microsoft AI)
Tools powered by MAI Code 2
Compare MAI Code 2
Compare MAI Code 2 with any other model
Build a comparison →All model comparisons →