Integrate with Claude Code

June 29, 2026 · View on GitHub

English | 简体中文 · ← Back

Integrate with Claude Code

Claude Code is a terminal-level AI coding assistant launched by Anthropic, which also supports VS Code extensions. MiMo integrates with Claude Code via the Anthropic-compatible protocol only.

Prerequisites

Both Pay-as-you-go API and Token Plan are supported with Claude Code. You need to obtain the corresponding credentials before configuration.

Usage ModeDescriptionHow to Get Credentials
Pay-as-you-goBilled by actual usage, suitable for light useGo to API Keys and create an API Key
Token PlanFixed subscription with quota-based accessAfter subscribing, go to Subscription Management to get your dedicated Base URL and API Key

1. Install Claude Code CLI

Native install automatically updates in the background to keep you on the latest version.

macOS / Linux / WSL:

curl -fsSL https://claude.ai/install.sh | bash

Windows PowerShell:

irm https://claude.ai/install.ps1 | iex

Windows CMD:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Git for Windows is recommended on native Windows so Claude Code can use the Bash tool.

Option 2: npm

npm install -g @anthropic-ai/claude-code

Verify the installation:

claude --version

For more installation methods (Homebrew, WinGet, etc.), see the official setup guide.

2. Configure Claude Code

Skip Login Prompt

Create or edit ~/.claude.json (Windows: C:\Users\<your username>\.claude.json) to skip the Anthropic login screen:

{
  "hasCompletedOnboarding": true
}

Configure API Credentials

Claude Code can be configured via a configuration file or environment variables. In most cases, prefer the configuration file approach, as settings in the configuration file can be read by both Claude Code CLI and VS Code Extension.

Configuration file location:

  • Linux / Mac: ~/.claude/settings.json
  • Windows: C:\Users\<your username>\.claude\settings.json
  • If the file does not exist, create it.

Supported Models

Claude Code only supports text generation models. See the Model List for all available models.

Pay-as-you-go

Go to API Keys and create an API Key (format: sk-xxxxx).

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.xiaomimimo.com/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "MIMO_API_KEY",
    "ANTHROPIC_MODEL": "mimo-v2.5-pro[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "mimo-v2.5-pro[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "mimo-v2.5-pro[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "mimo-v2.5-pro[1m]",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

Token Plan

After subscribing, go to Subscription Management to get your dedicated Base URL and API Key (format: tp-xxxxx).

Replace {region} with the cluster shown in your Subscription Management page (cn for China, sgp for Singapore, ams for Europe).

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://token-plan-{region}.xiaomimimo.com/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "MIMO_API_KEY",
    "ANTHROPIC_MODEL": "mimo-v2.5-pro[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "mimo-v2.5-pro[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "mimo-v2.5-pro[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "mimo-v2.5-pro[1m]",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

Notes

  • Replace the ANTHROPIC_AUTH_TOKEN value with your actual API key.
  • CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC prevents Claude Code from sending telemetry or update checks to Anthropic servers.
  • The [1m] suffix extends the context window to 1M tokens for supported MiMo models. After launching Claude Code, run the /context command to verify it is in effect.

3. VS Code Extension (Optional)

Install Claude Code VS Code Extension.

The VS Code extension automatically reuses the Claude Code CLI configuration (~/.claude/settings.json and ~/.claude.json), so no additional setup is needed if you have already configured the CLI.

4. Use Claude Code

Using Claude Code CLI

Enter the project directory and run claude:

cd /path/to/my-project
claude

Using Claude Code VS Code Extension

Open your project directory in VS Code, click the Claude Code icon in the sidebar, and click New session to get started.

Resources