Setup wizard

Connect your AI tool.

Pick a tool, your operating system and a model. The steps and snippets below update to match.

1Tool
2Operating system
3Instructions

Connect OpenCode

OpenCode needs a provider block in opencode.json and your key in an environment variable.

  1. Install OpenCode with npm. You need Node.js first.
    PowerShell
    npm install -g @opencode/cli
  2. Save your key as an environment variable. Close PowerShell and open it again so the new variables load.
    PowerShell
    setx CHEAPTOKENS_API_KEY "YOUR_API_KEY"
  3. Create the file %USERPROFILE%\.config\opencode\opencode.json with this content. To use it for one project only, save it as opencode.json in that project's folder instead.
    opencode.json
    {
      "$schema": "https://opencode.ai/config.json",
      "model": "cheaptokens/claude-sonnet-5-5",
      "provider": {
        "cheaptokens": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "CheapTokens",
          "options": {
            "baseURL": "https://cheaptokens.pw/v1",
            "apiKey": "{env:CHEAPTOKENS_API_KEY}"
          },
          "models": {
            "claude-sonnet-5-5": { "name": "claude-sonnet-5-5", "limit": { "context": 200000, "output": 8192 } }
          }
        }
      }
    }
  4. Run opencode in your project folder. Type /models to confirm CheapTokens is selected, then send a message.
  • This config uses OpenCode's classic format, which both the current (V2) and older versions read.
  • List every model you want under models. Pick between them inside OpenCode with /models.
  • OpenCode needs a model that supports tool calling.

Open the full OpenCode guide →