# Mai Code 2 API Pricing

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.

- Page: https://models.litellm.ai/models/mai-code-2
- LiteLLM model name: `github_copilot/mai-code-2`
- Context window: 128,000 tokens
- Max output: 128,000 tokens
- Added to LiteLLM: November 17, 2026
- Prices updated: November 17, 2026

## Pricing by provider

Token prices in USD per 1M tokens.

| Provider | Model name | Input | Output | Cache read | Per image | Per second | Context |
|---|---|---|---|---|---|---|---|
| GitHub Copilot | `github_copilot/mai-code-2` | $0.50 | $2.50 | $0.025 | – | – | 128K |

## Cost examples

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

## Features

Supported: Function calling, Parallel tool calls, Structured output, Image input, Reasoning.

## Use it with LiteLLM

```python
from litellm import completion

response = completion(
    model="github_copilot/mai-code-2",
    messages=[{"role": "user", "content": "Hello!"}],
)
```

## Cost calculator

10,000 requests a day with 1,000 input and 500 output tokens each, at GitHub Copilot's price: $0.00175 per request, $17.50 per day, $525 per month (30 days). Try other numbers at https://models.litellm.ai/calculator?model=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.

Source: LiteLLM model price file, https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json. Maintainers update it from each provider's published pricing, and this page is usually rebuilt within 20 minutes of every change.
