Mai Code 2 API Pricing
github_copilot/mai-code-2- Input / output
- $0.50 / $2.50 per 1M tokens
- Cache read
- $0.025 / 1M
- Context
- 128K tokens
- Max output
- 128K tokens
As of November 18, 2026, Mai Code 2 costs $0.50 per 1M input tokens and $2.50 per 1M output tokens on GitHub Copilot, with cache reads at $0.025 per 1M tokens. It has a 128,000-token context window and returns up to 128,000 tokens per response.
Mai Code 2 pricing by provider
1 listing across 1 provider. Token prices are in US dollars per 1M tokens. The highlighted row is the price quoted above.
| Provider | Model name in LiteLLM | Input | Output | Cache read | Context |
|---|---|---|---|---|---|
| GitHub Copilot | github_copilot/mai-code-2 | $0.50 | $2.50 | $0.025 | 128K |
What Mai Code 2 costs in practice
1,000 requests with 2,000 input and 500 output tokens each
| GitHub Copilot | $2.25 |
100 long-document requests with 100,000 input and 2,000 output tokens each
| GitHub Copilot | $5.50 |
Mai Code 2 cost calculator
At GitHub Copilot's price ($0.50 input, $2.50 output per 1M tokens), 10,000 requests a day with 1,000 input and 500 output tokens each cost $17.50 a day, about $525 a month. Change the numbers for your workload, or compare it with other models.
- Per request
- $0.00175
- Per day
- $17.50
- Per month (30 days)
- $525
Mai Code 2 features
Input: image.
- Function calling
- Parallel tool calls
- Structured output
- Image input
- Reasoning
Use Mai Code 2 with LiteLLM
Call Mai Code 2 through the LiteLLM Python SDK, or put it behind the LiteLLM proxy and send OpenAI-format requests to /v1/responses. LiteLLM tracks the cost of every request at these prices.
from litellm import completion
response = completion(
model="github_copilot/mai-code-2",
messages=[{"role": "user", "content": "Hello!"}],
)model_list:
- model_name: mai-code-2
litellm_params:
model: github_copilot/mai-code-2
# credentials: see the provider's LiteLLM docs pagecurl http://0.0.0.0:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "mai-code-2",
"messages": [{"role": "user", "content": "Hello!"}]
}'Mai Code 2 FAQ
How much does Mai Code 2 cost?
Mai Code 2 costs $0.50 per 1M input tokens and $2.50 per 1M output tokens on GitHub Copilot, with cache reads at $0.025 per 1M tokens.
What is the context window of Mai Code 2?
Mai Code 2 has a 128,000-token context window and returns up to 128,000 tokens per response.
Which providers offer Mai Code 2?
Mai Code 2 is available from GitHub Copilot through LiteLLM, using the model name github_copilot/mai-code-2.
How do I call Mai Code 2 with an OpenAI-compatible API?
Use the LiteLLM Python SDK with model="github_copilot/mai-code-2", or add the model to the LiteLLM proxy's config.yaml and send requests to /v1/responses from any OpenAI client. LiteLLM tracks the cost of every request at the prices on this page.
What features does Mai Code 2 support?
Mai Code 2 supports function calling, parallel tool calls, structured output, image input and reasoning.
When did LiteLLM add Mai Code 2?
Mai Code 2 was added to LiteLLM's model price file on November 17, 2026.
Sources
Prices come from LiteLLM's open-source model_prices_and_context_window.json, which LiteLLM uses to calculate the cost of every request. Maintainers update it from each provider's published pricing, and this page is usually rebuilt within 20 minutes of every change. Provider pricing pages:
LiteLLM docs: GitHub Copilot.
Provider pages: GitHub Copilot.