fix(oauth): plain HTTP token exchange to avoid 429#51
Closed
soxfmr wants to merge 1 commit intomirrorange:mainfrom
Closed
fix(oauth): plain HTTP token exchange to avoid 429#51soxfmr wants to merge 1 commit intomirrorange:mainfrom
soxfmr wants to merge 1 commit intomirrorange:mainfrom
Conversation
- Add create_plain_session() preferring httpx (no browser fingerprinting) - Add _token_request() using plain session with only Content-Type header to avoid 429 on console.anthropic.com/v1/oauth/token Co-Authored-By: Claude Opus 4.6 <[email protected]>
Rivenlalala
pushed a commit
to Rivenlalala/clove
that referenced
this pull request
Mar 25, 2026
Anthropic now rejects requests to console.anthropic.com/v1/oauth/token that carry browser fingerprinting headers (User-Agent, Origin, TLS JA3). Switch token exchange and refresh to use a plain httpx session instead of the chrome-impersonating client. Ref: mirrorange#51 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The client reported
429from the the OAuth API:It seems this is related to the rate limit problem, but it is not. Anthropic has enforced a new policy for the requests rejecting some client fingerprinting headers (User-Agent, Origin, TLS JA3 etc.). You could check the reference URLs for more details.
Changes
We have taken the same approach of shahidshabbir-se/opencode-anthropic-oauth by creating a plain http session with the favored headers for the OAuth API.
References