Anthropic blocks third-party use of Claude Code subscriptions 6 months ago
The fix has been merged in https://github.com/anomalyco/opencode-anthropic-auth/pull/11, and PR https://github.com/anomalyco/opencode/pull/7432 is open to bump the version.
Until it's released, here's a workaround:
1. git clone https://github.com/anomalyco/opencode-anthropic-auth.git
2. Add to ~/.config/opencode/opencode.json: "plugin": ["file:///path/to/opencode-anthropic-auth/index.mjs"]
3. Run: OPENCODE_DISABLE_DEFAULT_PLUGINS=true opencode