Skip to content

OpenCode

If your machine does not have the opencode command yet, install OpenCode first. If OpenCode is already installed, go straight to manual setup.

Choose one installation method:

cmd
choco install opencode
cmd
scoop install opencode

For npm, install Node.js from nodejs.org first, then run:

cmd
npm install -g opencode-ai@latest
cmd
opencode --version

If you are not using CC Switch, write the user-level OpenCode config manually. Use the OpenAI-compatible Base URL with /v1, and use a token from the OpenCode group.

  1. Create and enter the configuration directory.

    cmd
    mkdir "%USERPROFILE%\.config\opencode"
    cd /d "%USERPROFILE%\.config\opencode"
  2. Create or update opencode.json.

    Replace <model-id> with an available model name from the model marketplace, and replace sk-your-token with your OpenCode-group token.

    json
    {
    "$schema": "https://opencode.ai/config.json",
    "model": "qiuqiu/<model-id>",
    "provider": {
    "qiuqiu": {
     "npm": "@ai-sdk/openai-compatible",
     "name": "Qiuqiu Token",
     "options": {
       "baseURL": "https://api.qiuqiutoken.net/v1",
       "apiKey": "sk-your-token"
     },
     "models": {
       "<model-id>": {
         "name": "<model-id>"
       }
     }
    }
    }
    }
  3. Close all OpenCode terminal windows, open a new terminal, then start OpenCode from your project.

    After it opens, type /models and select qiuqiu/<model-id>.

    cmd
    cd your-project-folder
    opencode