Skip to content

OpenCode Integration ​

1. Prerequisites ​

  • Registered and obtained a platform API Key. If you are signed in, open the Integrations page, pick OpenCode 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.
  • OpenCode installed:
    bash
    curl -fsSL https://opencode.ai/install | bash

codesw writes directly to ~/.config/opencode/opencode.json, filling in the provider, baseURL, apiKey and model list automatically — no proxy, no middleman.

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 OpenCode.
  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.

When it finishes, just run opencode. 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.

3. Launch ​

bash
opencode

Appendix: Manual Configuration (Alternative) ​

Open ~/.config/opencode/opencode.json and add the following configuration:

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "router.bumo.ai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "router.bumo.ai",
      "options": {
        "baseURL": "https://router.bumo.ai/v1",
        "apiKey": "YOUR_API_KEY"
      },
      "models": {
        "claude-sonnet-4-6": {
          "name": "claude-sonnet-4-6"
        },
        "gpt-5.3-codex": {
          "name": "gpt-5.3-codex"
        }
      }
    }
  }
}

Replace YOUR_API_KEY with your platform API Key.