Skip to content

Claude Code Integration

1. Prerequisites

  • Registered and obtained a platform API Key.
  • 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 — the whole flow is interactive, no arguments required:

  1. Select provider: pick bumo.ai (BUMO API).
  2. Profile name: press Enter to accept the default, or type one, e.g. bumo.
  3. API Key: paste the key from the API Keys page (shown as * while typing).
  4. Select model: pick a default from the list, e.g. claude-sonnet-4-6; or choose <Custom> to type your own.
  5. Small model ID: optional — press Enter to skip.
  6. Apply to which client: choose Claude Code.

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.

To switch models or providers later, run codesw again and pick the existing profile — no need to re-enter the key.

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://api.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.