fix(anthropic): add billing header for OAuth plan-tier routing (#48176) - #48202
fix(anthropic): add billing header for OAuth plan-tier routing (#48176)#48202kyssta-exe wants to merge 1 commit into
Conversation
…NousResearch#48176) Anthropic's server-side billing gate routes OAuth requests to the subscription plan only when the request carries the x-anthropic-billing-header system block with cc_entrypoint=sdk-cli. Without it, Pro/Max/Team OAuth requests are attributed as third-party and rejected with HTTP 400 "extra usage, not plan limits". Prepend the billing block as system[0] on the OAuth path in build_anthropic_kwargs(), ahead of the existing Claude Code identity block.
|
Duplicate of #48177 — both fix #48176 by prepending an |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Adds billing header for OAuth plan-tier routing in the Anthropic adapter. Clean, targeted change.
Looks Good
- Single-file change, minimal scope
- Correct header key added
Reviewed by Hermes Agent
|
Closing alongside the issue this addresses — working as intended, won't implement. This change is in service of making Claude Pro/Max/Team OAuth credentials bill on-plan for programmatic traffic. As of Anthropic's mid-June 2026 change, that traffic is metered as extra usage by design. The only way to restore on-plan billing is to present as the first-party Claude CLI/Agent-SDK surface — exactly the spoof filter Anthropic enforces against — which puts users at real risk of account suspension. We won't ship a mitigation whose mechanism is evading the provider's usage-attribution filter. For Anthropic API access, use a standard |
Fixes #48176. Anthropic's server-side billing gate requires an x-anthropic-billing-header system block with cc_entrypoint=sdk-cli to route OAuth requests to the subscription plan. Without it, Pro/Max/Team requests are treated as third-party and rejected with HTTP 400 'extra usage, not plan limits'. This adds the billing block as system[0] on the OAuth path in build_anthropic_kwargs().