Mai Code 2 Flash API Pricing
github_copilot/mai-code-2-flash- Input / output
- $0.05 / $0.25 per 1M tokens
- Cache read
- $0.005 / 1M
- Context
- 128K tokens
- Max output
- 128K tokens
As of November 18, 2026, Mai Code 2 Flash costs $0.05 per 1M input tokens and $0.25 per 1M output tokens on GitHub Copilot, with cache reads at $0.005 per 1M tokens. It has a 128,000-token context window and returns up to 128,000 tokens per response.
Mai Code 2 Flash 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-flash | $0.05 | $0.25 | $0.005 | 128K |
What Mai Code 2 Flash costs in practice
1,000 requests with 2,000 input and 500 output tokens each
| GitHub Copilot | $0.225 |
100 long-document requests with 100,000 input and 2,000 output tokens each
| GitHub Copilot | $0.55 |
Mai Code 2 Flash cost calculator
At GitHub Copilot's price ($0.05 input, $0.25 output per 1M tokens), 10,000 requests a day with 1,000 input and 500 output tokens each cost $1.75 a day, about $52.50 a month. Change the numbers for your workload, or compare it with other models.
- Per request
- $0.000175
- Per day
- $1.75
- Per month (30 days)
- $52.50
Mai Code 2 Flash features
Input: image.
- Function calling
- Parallel tool calls
- Structured output
- Image input
- Reasoning
Use Mai Code 2 Flash with LiteLLM
Call Mai Code 2 Flash 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-flash",
messages=[{"role": "user", "content": "Hello!"}],
)model_list:
- model_name: mai-code-2-flash
litellm_params:
model: github_copilot/mai-code-2-flash
# 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-flash",
"messages": [{"role": "user", "content": "Hello!"}]
}'Mai Code 2 Flash FAQ
How much does Mai Code 2 Flash cost?
Mai Code 2 Flash costs $0.05 per 1M input tokens and $0.25 per 1M output tokens on GitHub Copilot, with cache reads at $0.005 per 1M tokens.
What is the context window of Mai Code 2 Flash?
Mai Code 2 Flash has a 128,000-token context window and returns up to 128,000 tokens per response.
Which providers offer Mai Code 2 Flash?
Mai Code 2 Flash is available from GitHub Copilot through LiteLLM, using the model name github_copilot/mai-code-2-flash.
How do I call Mai Code 2 Flash with an OpenAI-compatible API?
Use the LiteLLM Python SDK with model="github_copilot/mai-code-2-flash", 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 Flash support?
Mai Code 2 Flash supports function calling, parallel tool calls, structured output, image input and reasoning.
When did LiteLLM add Mai Code 2 Flash?
Mai Code 2 Flash 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.