Claude Code + MiMo API Setup

Anthropic's Claude Code is a powerful AI coding agent in the terminal. It can be configured to use any OpenAI-compatible API β€” including MiMo. This guide walks you through setting up Claude Code to run on MiMo's models, giving you access to MiMo's coding benchmarks at a fraction of the cost of Claude's API.

Why Use MiMo with Claude Code?

Prerequisites

Step 1: Set Environment Variable

Claude Code reads the ANTHROPIC_BASE_URL environment variable to determine the API endpoint:

export ANTHROPIC_BASE_URL="https://api.xiaomimimo.com/v1"
export ANTHROPIC_API_KEY="miMo-sk-your-key-here"

Add these to your .bashrc or .zshrc to make the change permanent:

echo 'export ANTHROPIC_BASE_URL="https://api.xiaomimimo.com/v1"' >> ~/.zshrc
echo 'export ANTHROPIC_API_KEY="miMo-sk-your-key-here"' >> ~/.zshrc
source ~/.zshrc

Step 2: Launch Claude Code

claude

Claude Code starts normally. All commands β€” /ask, /edit, /debug, /run β€” work the same way, but the underlying inference is powered by MiMo instead of Claude.

Step 3: Select the Right Model

By default, Claude Code requests claude-sonnet-4-20250514. The MiMo API maps this to MiMo-V2-Flash. You can override the model in your Claude Code config:

# In ~/.claude.json or project .claude.json
{
  "model": "mimo-v2.5-pro",
  "maxTokens": 8192
}

Recommended Model Configurations

Use CaseModelCost per 100 sessions
Quick edits, simple questionsMiMo-V2-Flash~$2-5
Complex refactoring, architectureMiMo-V2.5-Pro~$5-15
Full-modal (vision) tasksMiMo-V2.5-Omni~$5-20

Cost Comparison

SetupMonthly Cost (500 sessions)
Claude Code + Claude 3.5 Sonnet$100-200
Claude Code + MiMo-V2-Flash$10-25
Claude Code + MiMo-V2.5-Pro$25-75
MiMo Code (native)$5-20

Limitations

Troubleshooting

Next Steps