Skip to content

OAuth usage API (/api/oauth/usage) returns persistent 429 rate limit #31021

@moonchan-park

Description

@moonchan-park

Description

The OAuth usage API endpoint (api.anthropic.com/api/oauth/usage) is returning persistent HTTP 429 (rate_limit_error) responses, preventing the HUD statusline from displaying rate limit / token usage information.

Environment

  • Claude Code version: 2.1.69
  • OS: Ubuntu Linux 6.17.0-14-generic
  • oh-my-claudecode plugin: 4.1.8 (uses this API for HUD statusline)

Steps to Reproduce

  1. Have valid OAuth credentials (~/.claude/.credentials.json with non-expired accessToken)
  2. Call the usage API:
node -e "
const creds = JSON.parse(require('fs').readFileSync(require('os').homedir() + '/.claude/.credentials.json', 'utf-8'));
const c = creds.claudeAiOauth || creds;
const https = require('https');
const req = https.request({
  hostname: 'api.anthropic.com',
  path: '/api/oauth/usage',
  method: 'GET',
  headers: {
    'Authorization': 'Bearer ' + c.accessToken,
    'anthropic-beta': 'oauth-2025-04-20',
    'Content-Type': 'application/json',
  },
  timeout: 10000,
}, (res) => {
  let data = '';
  res.on('data', chunk => data += chunk);
  res.on('end', () => console.log('Status:', res.statusCode, 'Body:', data));
});
req.on('error', e => console.log('Error:', e.message));
req.end();
"
  1. Consistently returns: Status: 429 Body: {"error":{"message":"Rate limited. Please try again later.","type":"rate_limit_error"}}

Expected Behavior

The usage API should return rate limit utilization data (five_hour, seven_day percentages) when called with valid OAuth credentials at reasonable intervals.

Actual Behavior

Persistent 429 responses regardless of retry interval. The /usage command in Claude Code also fails to display usage information.

Impact

  • HUD statusline cannot display rate limit information
  • Users cannot monitor their token usage during sessions

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions