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.
    Terminal
    curl -fsSL https://opencode.ai/v2/install | bash
  2. Save your key as an environment variable. The last line reloads your shell settings, so the variables work straight away.
    Terminal
    echo 'export CHEAPTOKENS_API_KEY="YOUR_API_KEY"' >> ~/.zshrc
    source ~/.zshrc
  3. Create the file ~/.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 →