/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

  1. Configure Claude Code with a long-lived API token (ANTHROPIC_API_KEY)
  2. Remove the API token (unset env var, clear config)
  3. Switch back to OAuth authentication (claude login)
  4. Confirm OAuth token is active (CLAUDE_CODE_OAUTH_TOKEN is set, ANTHROPIC_API_KEY is not)
  5. 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_TOKEN set, no ANTHROPIC_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.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗