This repository moved to https://github.com/sainzs/agent-workbench/tree/main/integrations/opencode-anthropic-auth-plus. History was preserved via subtree, and this repository is frozen at its last version. What lives in the monorepo is the hardened feat/modular-auth-hardening line of this plugin, not the older fork README on this branch.
An OpenCode plugin that provides Anthropic OAuth authentication, enabling Claude Pro/Max users to use their subscription directly with OpenCode.
Add the plugin to your OpenCode configuration:
{
"plugins": ["@ex-machina/opencode-anthropic-auth"]
}The plugin provides three authentication options:
- Claude Pro/Max - OAuth flow via
claude.aifor Pro/Max subscribers. Uses your existing subscription at no additional API cost. - Create an API Key - OAuth flow via
console.anthropic.comthat creates an API key on your behalf. - Manually enter API Key - Standard API key entry for users who already have one.
For Claude Pro/Max authentication, the plugin:
- Initiates a PKCE OAuth flow against Anthropic's authorization endpoint
- Exchanges the authorization code for access and refresh tokens
- Automatically refreshes expired tokens
- Injects the required OAuth headers and beta flags into API requests
- Zeros out model costs (since usage is covered by the subscription)
Bump the version and push to main -- CI will publish to npm automatically:
bun bump # patch bump (0.0.13 -> 0.0.14)
bun bump minor # minor bump (0.0.13 -> 0.1.0)
bun bump major # major bump (0.0.13 -> 1.0.0)
bun bump -- --dry-run # preview without changesMIT

