You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"API Usage Billing" shown when ANTHROPIC_BASE_URL points to a gateway that authenticates with a claude setup-token token #105663
A local gateway sets the real auth on the way to api.anthropic.com: a long-lived OAuth token created with claude setup-token (Team plan). There is no API key anywhere in the setup.
The startup header says <model> · API Usage Billing, which reads as if the session were billed as metered API usage. As far as we can tell it isn't: the API's responses to these requests carry the subscription's unified rate-limit headers, matching what /usage shows for the account:
I assume the label comes from Claude Code seeing ANTHROPIC_AUTH_TOKEN rather than a subscription login.
What should happen?
When ANTHROPIC_BASE_URL points to a custom endpoint, Claude Code can't know how requests are billed, so the header shouldn't assert API billing. It could say something like "custom endpoint", or show no billing line. Since the responses already carry anthropic-ratelimit-unified-* headers, those could also tell Claude Code it's on a plan.
Steps to reproduce
Create a token with claude setup-token.
Run a small proxy that forwards to https://api.anthropic.com and replaces the Authorization header with Bearer <that token>.
Start Claude Code with ANTHROPIC_BASE_URL pointing at the proxy and ANTHROPIC_AUTH_TOKEN set to any placeholder.
The header shows "API Usage Billing"; requests succeed and the responses carry the plan's unified rate-limit headers.
Related
#57812 (same wrong label on Bedrock, fixed in 2.1.141), #93168 (label asserted while signed out).
Activity