MAI Code 2
Mid-tierby Microsoft
As of November 19, 2026, MAI Code 2 by Microsoft costs $0.50 per 1M input tokens and $2.50 per 1M output tokens, with a 1.05M-token context window.
MAI Code 2 is Microsoft's first in-house coding model above the small Flash class, introduced at Ignite on November 17, 2026 alongside MAI Code 2 Flash. GitHub's pricing page carries both the current rate and the date it ends: $0.50 per million input tokens, $0.025 on a cached read, and $2.50 output as promotional pricing through May 17, 2027, then $1, $0.05, and $5 from that date, so anything budgeted on this model should be budgeted twice. The shared model card gives a 1,050,000 token context length split into 922,000 input and 128,000 output tokens, with text and image input and text output. Distribution is narrower than the price suggests. MAI Code 2 is generally available in GitHub Copilot for Pro, Pro+, Max, Business, and Enterprise, but it is not on Microsoft Foundry at launch, so there is no general API for it outside Copilot; only the Flash variant reaches Foundry, and only in a limited-access preview. Microsoft's own benchmark table does not claim a win. MAI Code 2 averages 63.2 percent across four coding evaluations against 64.1 for GPT-6.1 Sol and 65.3 for Claude Opus 5.5, with DeepSWE 1.1 at 73.2 percent against 74.6 and 69, Terminal-Bench 2.1 at 84.6 against 85 and 78.7, SWE-Atlas at 43.1 against 47.4 and 57.5, and FrontierCode v1.1 at 52 against 49.4 and 56. The argument is the bill: at promotional pricing Microsoft puts average cost per task at $0.309 against $0.761 for GPT-6.1 Sol and $6.306 for Opus 5.5, which is where the claim of 98 percent of Sol's quality at about 40 percent of its price comes from. Every figure is vendor-reported and measured inside Copilot, no independent board has scored it yet, and the older MAI-Code-1.1-Flash stays on the Copilot price list at $0.20 and $1.20.
Input Price
$0.50
per 1M tokens
Output Price
$2.50
per 1M tokens
Context Window
1.1M
tokens
Released
2026-11
API access
Capabilities
Key Strengths
- ✓Promotional $0.50/$2.50 per 1M tokens through May 17, 2027
- ✓Microsoft-reported $0.309 average cost per coding task against $0.761 for GPT-6.1 Sol
- ✓1,050,000 token context with 922,000 input and 128,000 output
- ✓Terminal-Bench 2.1 at 84.6 percent, within half a point of GPT-6.1 Sol
- ✓Text and image input, generally available across paid Copilot plans
Best For
- ▸Everyday Copilot coding, debugging, and cross-file refactoring
- ▸Cost-sensitive agentic coding loops inside GitHub, Visual Studio, and VS Code
- ▸Teams standardizing on a single Microsoft-operated coding model
- ▸Work that needs a cheap second opinion next to Opus 5.5 or GPT-6.1 Sol
Pricing Details
Input tokens
$0.50
per 1M tokens
Output tokens
$2.50
per 1M tokens
Estimated cost per 1K requests
$1.75
~1K input + ~500 output tokens avg
Prices are subject to change. Check the official documentation for current pricing. See the cost calculator for detailed estimates.
Quick answers
- How much does MAI Code 2 cost?
- As of November 19, 2026, MAI Code 2 costs $0.50 per 1M input tokens and $2.50 per 1M output tokens on the Microsoft API.
- What is the context window of MAI Code 2?
- MAI Code 2 has a 1.05M-token context window (1,050,000 tokens).
Related Models
MAI Code 2 Flash
BudgetMicrosoft
$0.05 in / $0.25 out
MAI-Code-1.1-Flash
BudgetMicrosoft
$0.20 in / $1.20 out
Claude Opus 4.7
Mid-tierAnthropic
$5.00 in / $25.00 out
Claude Sonnet 5.5
Mid-tierAnthropic
$2.00 in / $10.00 out
Claude Sonnet 5
Mid-tierAnthropic
$2.00 in / $10.00 out
Claude Sonnet 4.6
Mid-tierAnthropic
$3.00 in / $15.00 out