Description
opencode auth login -p anthropic -m "Claude Pro/Max" consistently fails during the OAuth code exchange step with 429 Too Many Requests from https://console.anthropic.com/v1/oauth/token.
This is not just a generic Failed to authorize UI problem; with local debug logging enabled in the Anthropic auth plugin, the underlying failure is:
[opencode-anthropic-auth] OAuth exchange failed: status=429 statusText=Too Many Requests headers={...} body={
"error": {
"type": "rate_limit_error",
"message": "Rate limited. Please try again later."
}
}
I can reproduce this across multiple Anthropic accounts, which makes it look more like a flow-level / client-level / IP-level throttle than an account-specific Max-plan problem.
Environment
- OpenCode version:
1.2.20
- OS: macOS
- Provider:
anthropic
- Login method:
Claude Pro/Max
Steps to reproduce
- Run:
opencode auth login -p anthropic -m "Claude Pro/Max" --print-logs --log-level DEBUG
- Open the provided
claude.ai/oauth/authorize URL in the browser.
- Complete login successfully in Claude.
- Paste the returned authorization code back into OpenCode.
- Observe
Failed to authorize.
What is happening underneath
The browser authorization step succeeds and returns a code.
The failure happens on the follow-up token exchange to:
POST https://console.anthropic.com/v1/oauth/token
The plugin currently collapses that HTTP failure into a generic Failed to authorize message.
Related behavior
Earlier in the same session, Anthropic OAuth refresh was also failing for prompt traffic with:
Error: Token refresh failed: 429
So both fresh login and refresh appear to be failing on the Anthropic OAuth/token path.
Notes
- Anthropic status page was nominal at the time.
- We also tested changing the outgoing
User-Agent for Anthropic requests locally, but the 429 still occurred.
- The response did not include a
Retry-After header or obvious Anthropic rate-limit reset metadata, only generic front-door headers.
Request
It would help a lot if OpenCode could:
- Surface the real OAuth exchange status/body instead of only
Failed to authorize.
- Clarify whether this Anthropic OAuth flow is still supported / expected to work for Claude Pro/Max.
- Potentially make the Anthropic auth/user-agent behavior configurable for debugging.
If helpful, I can provide the exact debug patch used to expose the hidden exchange error.
Description
opencode auth login -p anthropic -m "Claude Pro/Max"consistently fails during the OAuth code exchange step with429 Too Many Requestsfromhttps://console.anthropic.com/v1/oauth/token.This is not just a generic
Failed to authorizeUI problem; with local debug logging enabled in the Anthropic auth plugin, the underlying failure is:I can reproduce this across multiple Anthropic accounts, which makes it look more like a flow-level / client-level / IP-level throttle than an account-specific Max-plan problem.
Environment
1.2.20anthropicClaude Pro/MaxSteps to reproduce
opencode auth login -p anthropic -m "Claude Pro/Max" --print-logs --log-level DEBUGclaude.ai/oauth/authorizeURL in the browser.Failed to authorize.What is happening underneath
The browser authorization step succeeds and returns a code.
The failure happens on the follow-up token exchange to:
POST https://console.anthropic.com/v1/oauth/tokenThe plugin currently collapses that HTTP failure into a generic
Failed to authorizemessage.Related behavior
Earlier in the same session, Anthropic OAuth refresh was also failing for prompt traffic with:
So both fresh login and refresh appear to be failing on the Anthropic OAuth/token path.
Notes
User-Agentfor Anthropic requests locally, but the 429 still occurred.Retry-Afterheader or obvious Anthropic rate-limit reset metadata, only generic front-door headers.Request
It would help a lot if OpenCode could:
Failed to authorize.If helpful, I can provide the exact debug patch used to expose the hidden exchange error.