Claude Code is a command-line tool by Anthropic that lets you delegate coding tasks directly to Claude from your terminal. It understands your project's codebase and can help you analyze, plan, write, and edit code. Using the Claude Code Router, you can configure it to use MARA Cloud models for inference.
Prerequisites
- A MARA Cloud account with an API key. See API Keys and URLs to generate one.
- Node.js version 18.15.0 or higher installed.
- The Claude Code Router package.
Setup
Step 1: Install Claude Code and the router
bash
npm install -g @anthropic-ai/claude-code
npm install -g @musistudio/claude-code-routerStep 2: Configure the router
Create and configure
~/.claude-code-router/config.json:json
{
"LOG": true,
"LOG_LEVEL": "trace",
"CLAUDE_PATH": "",
"HOST": "127.0.0.1",
"PORT": 3456,
"APIKEY": "",
"API_TIMEOUT_MS": "600000",
"PROXY_URL": "",
"transformers": [],
"Providers": [
{
"name": "MARA",
"api_base_url": "https://api.cloud.mara.com/v1/chat/completions",
"api_key": "your-mara-api-key",
"models": [
"gpt-oss-120b",
"DeepSeek-V3.1",
"MiniMax-M2.5"
]
}
],
"StatusLine": {
"enabled": false,
"currentStyle": "default",
"default": { "modules": [] },
"powerline": { "modules": [] }
},
"Router": {
"default": "MARA,gpt-oss-120b",
"background": "MARA,gpt-oss-120b",
"think": "MARA,DeepSeek-V3.1",
"longContext": "MARA,MiniMax-M2.5",
"longContextThreshold": 60000,
"webSearch": "MARA,MiniMax-M2.5"
}
}The config above routes tasks to the best-fit model on MARA Cloud:
| Router Task | Model | Why |
|---|---|---|
default | gpt-oss-120b | Cost-efficient general reasoning. Only $0.15/M input tokens. |
background | gpt-oss-120b | Lightweight background tasks benefit from the lowest-cost model. |
think | DeepSeek-V3.1 | Hybrid reasoning with explicit think/non-think modes. Strong on coding. |
longContext | MiniMax-M2.5 | 160K context window, built for long-context agentic workflows. |
webSearch | MiniMax-M2.5 | Best web navigation and search performance. |
See the Model Catalog for all available models and pricing.
Step 3: Start Claude Code with the router
bash
ccr codeIf you make configuration changes, restart the service:
bash
ccr restartStep 4: UI Mode (optional)
For easier configuration management, use the built-in UI:
bash
ccr uiLearn more
- Model Catalog - Browse all available models.
- Claude Code Documentation - Official Claude Code docs.
- Claude Code Router - Router repository and documentation.