OpenCode manages each provider directly, so override the connection per
provider in ~/.config/opencode/opencode.json. Deep-merge the
block below under provider and compaction. This
example configures Anthropic. Repeat the provider block for each provider you
use.
This sends the Anthropic provider through the local Sleev gateway. Setting compaction.prune to false leaves context management
to Sleev.
OpenCode 2 (currently in beta) uses a new provider config shape. Use providers instead of provider, put baseURL under settings, and put headers
directly on the provider. OpenCode 2 does not use compaction.prune.