/usage broken after switching from API key back to OAuth
Resolved 💬 4 comments Opened Mar 13, 2026 by KingMob Closed Apr 29, 2026
Bug
/usage returns "only available for subscription plans" even though I'm on the 20x Max plan and authenticated via OAuth.
Steps to reproduce
- Configure Claude Code with a long-lived API token (
ANTHROPIC_API_KEY) - Remove the API token (unset env var, clear config)
- Switch back to OAuth authentication (
claude login) - Confirm OAuth token is active (
CLAUDE_CODE_OAUTH_TOKENis set,ANTHROPIC_API_KEYis not) - Run
/usage
Expected
Usage stats are displayed.
Actual
/usage is only available for subscription plans.
Environment
- Claude Code v2.1.74
- macOS (Darwin 25.3.0)
- Plan: Max 20x
- Auth: OAuth token (
CLAUDE_CODE_OAUTH_TOKENset, noANTHROPIC_API_KEY)
Notes
The issue appears to be caused by having previously used an API token. After switching back to OAuth, something still thinks the session is API-key-based. Re-authenticating with claude login does not fix it.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗