-
Notifications
You must be signed in to change notification settings - Fork 15.4k
OAuth usage API (/api/oauth/usage) returns persistent 429 rate limit #31021
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
api:anthropicarea:statuslinebugSomething isn't workingSomething isn't workinghas reproHas detailed reproduction stepsHas detailed reproduction steps
Description
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
- Have valid OAuth credentials (
~/.claude/.credentials.jsonwith non-expired accessToken) - 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();
"- 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api:anthropicarea:statuslinebugSomething isn't workingSomething isn't workinghas reproHas detailed reproduction stepsHas detailed reproduction steps