# MAI Code

> Microsoft AI's coding models for GitHub Copilot. MAI Code 2 takes on debugging, multi-file changes and repo-wide work. MAI Code 2 Flash covers routine edits at a lower cost.

MAI Code is Microsoft AI's family of coding models for GitHub Copilot. The current generation is MAI Code 2, plus a smaller MAI Code 2 Flash for routine work. Both launched at Microsoft Ignite on November 17, 2026. The line started in June 2026 with MAI-Code-1-Flash.

## What It Is

MAI Code 2 is a general-purpose coding model for the everyday work Microsoft sees in Copilot. Microsoft says it's strongest at taking code to production, deep debugging, multi-file changes, repository-wide reasoning and UI work. It's also tuned for dashboards, data visualizations and other visual front-end code.

MAI Code 2 Flash is the lighter model. It handles high-volume jobs like code explanations, targeted edits, routine fixes and quick iterations. Both models are built for agentic coding, where the model plans a multi-step task and carries it out with shell, file and search tools.

## How It Works

Both are sparse mixture-of-experts models. Microsoft built them on new base models that are larger than the first generation's. They take text and images as input. You can give them screenshots, UI mockups, charts or diagrams along with your code.

The model card lists a context window of about 1 million tokens and up to 128,000 output tokens. Reasoning effort has five levels: low, medium, high, xhigh and max. Microsoft trained both with reinforcement learning inside the Copilot CLI and VS Code agent harnesses. Their pretraining data cutoff is August 2026.

## Where You Can Use It

Both models are in the Copilot model picker in VS Code, Visual Studio, JetBrains IDEs, Xcode, Eclipse, the Copilot CLI, the Copilot cloud agent, the GitHub Copilot app, github.com and GitHub Mobile. Organization admins control access through Copilot's model policy. New models are on by default unless an admin turned that default off.

MAI Code 2 Flash is also in limited-access preview in Microsoft Foundry through an OpenAI-compatible Responses API. Microsoft says OpenRouter, Vercel, Hermes, OpenCode and Kilo will get both models soon.

Companies can work with Microsoft on custom versions. Woven by Toyota fine-tuned MAI Code 2 Flash on its history of MISRA coding-standard fixes. It says the tuned model wrote ready-to-merge fixes for 44% of the cases where its production frontier models' fixes needed human rework.

## How Microsoft Positions It

Microsoft compares MAI Code 2 with GPT-6.1 Sol and Claude Opus 5.5 on four benchmarks: DeepSWE 1.1, Terminal-Bench 2.1, SWE Atlas and FrontierCode v1.1. MAI Code 2 averages a 63.2% pass rate. GPT-6.1 Sol averages 64.1% and Claude Opus 5.5 averages 65.3%. Microsoft says that's 98% of GPT-6.1 Sol's result at 40% of the cost per task. Against Claude Opus 5.5 it's 96% of the result at 5% of the cost.

MAI Code 2 Flash averages 61.0% on three of those benchmarks. That's above GPT-6 Luna at 55.1% and Claude Haiku 5.5 at 53.9%. Microsoft puts Flash's cost per task at 65% of GPT-6 Luna's and 20% of Claude Haiku 5.5's. In a blind test of front-end apps, developers preferred MAI Code 2's results over GPT-6 Sol's 64% of the time.

These are Microsoft's own results. Every model ran at max reasoning effort. Microsoft's cost figures use the 50% promotional price for its own models.

## Limits Microsoft Lists

Microsoft says both models aren't tuned yet for harder problems like fundamental science research or very long-horizon agentic work. At release they're optimized only for English. Microsoft hasn't tested them much on less common programming languages and frameworks.

In long agentic sessions they can repeat tool calls, drift from instructions or stop before checking their work. Quality drops as the context nears its limit. MAI Code 2 Flash is less capable than MAI Code 2 on complex, long-running tasks.

## History: MAI-Code-1-Flash

Microsoft AI introduced MAI-Code-1-Flash with several other MAI models on June 2, 2026. It was a small, fast model trained inside the Copilot harness and built for Copilot in VS Code. It had a 256K context window and took text only. Thinking effort had three levels: Low, Medium and High. Microsoft pitched it against Claude Haiku 4.5 and reported 51.2% on SWE-Bench Pro to Haiku's 35.2%. An updated MAI-Code-1.1-Flash followed later.

Next to the first generation, MAI Code 2 adds larger base models, a context window about four times bigger, image input and two higher reasoning levels. The family also gains a full-size model next to Flash.

## Features
- MAI Code 2 for deep debugging, multi-file changes and repository-wide reasoning
- MAI Code 2 Flash for explanations, targeted edits and routine fixes at lower cost
- Agentic coding with shell, file and search tools
- Text and image input for screenshots, UI mockups, charts and diagrams
- Context window of about 1 million tokens with up to 128K output tokens
- Five reasoning effort levels from low to max
- Tuned for dashboards, data visualizations and front-end UI code
- In the Copilot model picker across VS Code, Visual Studio, JetBrains, Xcode, Eclipse, CLI, github.com and mobile
- MAI Code 2 Flash API access in Microsoft Foundry (limited preview)
- Organization admin controls through Copilot model policy

## Integrations
GitHub Copilot, Visual Studio Code, Visual Studio, JetBrains, Xcode, Eclipse, GitHub Copilot CLI, Microsoft Foundry

## Platforms
VSC_EXTENSION, JETBRAINS_PLUGIN, CLI, WEB, IOS, ANDROID, API

## Pricing
Freemium — Free tier available with paid upgrades

## Version
2

## Links
- Website: https://microsoft.ai/models/mai-code-2/
- Documentation: https://microsoft.ai/pdf/MAI-Code-2-And-MAI-Code-2-Flash-Model-Card.pdf?v=3
- EveryDev.ai: https://www.everydev.ai/tools/mai-code
