Integrations

Claude Code

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

Setup

Step 1: Install Claude Code and the router

bash
npm install -g @anthropic-ai/claude-code
npm install -g @musistudio/claude-code-router

Step 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 TaskModelWhy
defaultgpt-oss-120bCost-efficient general reasoning. Only $0.15/M input tokens.
backgroundgpt-oss-120bLightweight background tasks benefit from the lowest-cost model.
thinkDeepSeek-V3.1Hybrid reasoning with explicit think/non-think modes. Strong on coding.
longContextMiniMax-M2.5160K context window, built for long-context agentic workflows.
webSearchMiniMax-M2.5Best 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 code
If you make configuration changes, restart the service:
bash
ccr restart

Step 4: UI Mode (optional)

For easier configuration management, use the built-in UI:
bash
ccr ui

Learn more