Skip to content

Claude Code Integration ​

1. Prerequisites ​

  • Registered and obtained a platform API Key. If you are signed in, open the Integrations page, pick Claude Code and copy the one-line command with your key and model already filled in — run it and skip the prompts in step 2.
  • Node.js environment installed.
  • Claude Code installed:
    bash
    npm install -g @anthropic-ai/claude-code

codesw is the official CLI for switching model providers. It writes directly to ~/.claude/settings.json — no proxy, no middleman — and lets you swap providers or clients later with a single command.

2.1 Install ​

bash
npm i -g @bumocc/codesw
# or
yarn global add @bumocc/codesw

2.2 Run the interactive mode ​

Just execute:

bash
codesw

Follow the prompts — use the arrow keys to select and Enter to confirm. Three steps:

  1. Which client to configure: choose Claude Code.
  2. Which provider: choose Bumo Router. The first time, paste the key from the API Keys page (shown as * while typing); it is saved and reused afterwards.
  3. Which model: recommended models are listed first, e.g. claude-sonnet-5-5; or choose "Enter a model ID…" to type your own.

codesw writes ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_DEFAULT_*_MODEL, etc. into the env block of ~/.claude/settings.json. Once it finishes, just run claude. Right after writing the config, codesw also tests the connection with that key and model and tells you whether the key is invalid, the model does not exist or the balance has run out; run codesw test any time to check again.

To switch models or providers later, just run codesw again — no need to re-enter the key. To go back to your official Claude Code account, choose "Restore official account" at the bottom of the provider list.

3. Launch Claude Code ​

bash
claude

Enter your question in the dialog to experience Claude Code's intelligent programming capabilities.


Appendix: Manual Configuration (Alternative) ​

If you'd rather not use the CLI, edit the settings file by hand.

Open or create settings.json:

  • MacOS / Linux: ~/.claude/settings.json
  • Windows: User Directory/.claude/settings.json

Merge the following env block:

json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://router.bumo.ai",
    "API_TIMEOUT_MS": "3000000",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1,
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm/glm-4.5-air",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm/glm-5.1",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm/glm-5.1"
  }
}

Replace YOUR_API_KEY with your platform API Key.