Skip to content
The Distillery
Docs / Clients / OpenCode
SETUP · opencodeverified

~/distillery setup → opencode

OpenCode reads ANTHROPIC_BASE_URL from env — set it once and every Claude request routes through The Distillery.

vendorAnthropic
authAPI key
methodconfig file
portlocalhost:3080

Overview

OpenCode is a terminal-based AI coding assistant. It uses the Anthropic Messages API via the Vercel AI SDK and supports a per-provider `baseURL` override in `~/.opencode/opencode.json`. Setting this value routes OpenCode's Claude traffic through The Distillery.

Prerequisites

You have The Distillery installed and running locally on port 3080. OpenCode is installed with the `anthropic` provider configured and an API key set.

$ configure

step 01 / 02

Open `~/.opencode/opencode.json` and add the `provider.anthropic.options.baseURL` key. Create the file if it does not already exist.

{
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "http://localhost:3080"
      }
    }
  }
}
macOS · Linux
~/.opencode/opencode.json
Windows
%USERPROFILE%\.opencode\opencode.json

$ verify

step 02 / 02
01Start an OpenCode session and send any prompt. In a separate terminal, run:
thedistillery stats
$ comparing tools

Evaluating other Claude Code cost-reduction approaches alongside OpenCode? See how The Distillery compares to Claude Code Router (model-routing approach), Compresr (YC W26), or browse alternatives to Claude Code Router for the full landscape.

Pricing breakdown: thedistillery.com/pricing.