MAI Code 2

Models

Model details

Model
mai-code-2
Provider
github-copilot
API
openai-responses
Base URL
https://api.individual.githubcopilot.com
Input
text, image
Reasoning
Yes
Context window
1,050,000
Max tokens
128,000
Show configuration
{
  "providers": {
    "github-copilot": {
      "apiKey": "YOUR_API_KEY",
      "models": [
        {
          "id": "mai-code-2",
          "name": "MAI Code 2",
          "reasoning": true,
          "input": [
            "text",
            "image"
          ],
          "thinkingLevelMap": {
            "off": null,
            "minimal": null,
            "low": "low",
            "medium": "medium",
            "high": "high",
            "xhigh": "xhigh",
            "max": "max"
          },
          "contextWindow": 1050000,
          "maxTokens": 128000,
          "cost": {
            "input": 0.5,
            "output": 2.5,
            "cacheRead": 0.025,
            "cacheWrite": 0
          }
        }
      ],
      "api": "openai-responses",
      "baseUrl": "https://api.individual.githubcopilot.com"
    }
  }
}

Pricing

USD per million tokens. A tier is selected from the total input tokens in each request and applies to that entire request.

Pricing rates for MAI Code 2
Request inputInputOutputCache readCache write
All requests$0.5$2.5$0.025$0

Session cost calculator

Estimate the requests made during an agent session. A user turn can make several model calls while using tools, so costs are calculated per model request.

Session shape
Rounded median shapes from recent Pi agent sessions.
Warm-request cache reuse
Effective token reuse combines partial hits and occasional complete misses.
Estimated session$0.00
Uncached input
—
Cache reads
—
Uncached prefixes
—
Cache writes
—
Output
—
Without caching
—

The first request starts cold unless marked otherwise. Output is billed separately from context growth because reasoning tokens are not always retained. This remains a directional estimate: providers differ in eligibility, rounding, and retention.

Compatibility flags

Effective values after applying Pi's API defaults and model overrides.

Effective compatibility flags for MAI Code 2
FeatureValue
supportsDeveloperRoleYes
sendSessionIdHeaderYes
supportsLongCacheRetentionYes