Skip to content

OpenCode Integration

1. Prerequisites

  • Registered and obtained a platform API Key.
  • 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:

  1. Select provider: pick bumo.ai (BUMO API); if you already have profiles, they are listed at the top — pick one to reuse.
  2. Profile name / API Key / Model / Small model: fill in as prompted. Get the key from the API Keys page.
  3. Apply to which client: choose OpenCode.

When it finishes, just run opencode.

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": {
    "api.bumo.ai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "api.bumo.ai",
      "options": {
        "baseURL": "https://api.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.