← Home

OpenCode integration

Connect Claude models to OpenCode through Claude API Tech. Installation and configuration usually take only a few minutes.

Why OpenCode

OpenCode is an open-source coding agent available in the terminal, IDE, and desktop app.

  • Automatically loads the appropriate LSP servers
  • Supports multiple agent sessions in parallel
  • Works with different models and providers
  • Available in the terminal, IDE, and desktop app

Official OpenCode documentation

1. Install OpenCode

Run the official installer in your terminal:

Terminal
curl -fsSL https://opencode.ai/install | bash

2. Open the configuration

The global OpenCode config lives in your home directory. Create it if it does not exist:

Global config
mkdir -p ~/.config/opencode && $EDITOR ~/.config/opencode/opencode.jsonc

For project-only settings, create opencode.json or opencode.jsonc in the repository root instead.

Configuration documentation

3. Add the Anthropic provider

Paste the configuration below and replace sk-cs2-YOUR_API_KEY with a key generated in your Claude API Tech dashboard. If the file already contains settings, merge in the provider section.

~/.config/opencode/opencode.jsonc
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "https://api.llm-gate.tech/v1",
        "apiKey": "sk-cs2-YOUR_API_KEY"
      }
    }
  }
}

API key

Do not publish a config containing your API key or commit it to Git. For team use, prefer an environment variable or a separate local config file.
Get an API key

4. Start OpenCode

Open your project directory and start OpenCode. Then select the Claude model you want to use.

Terminal
opencode

Get started

Create an account, generate an API key, and start using Claude models in OpenCode.

Get started