OAuth usage API (/api/oauth/usage) returns persistent 429 rate limit
Status Closed — not planned
Reported on v2.1.69
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 7 comments · opened Mar 5, 2026 · closed Mar 6, 2026
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
7 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
have the same issue too!
same issue!
Closing as duplicate of #30930 — same persistent 429 on
/api/oauth/usageendpoint. Upvoted the original issue.Community workaround available
I built a drop-in
statusLine.commandreplacement that bypasses the OAuth APIentirely by using Claude Desktop's web session cookies to call the claude.ai
web API — a separate rate limit bucket unaffected by Claude Code sessions.
Result:
🚀 Opus 4.6 [main]
✅ 126K (63%) | 36% (1h 34m left)
🟢 68.0% / $25.35 | (2d 5h 30m left)
How it works:
(AES-128-CBC, v10 format)
GET https://claude.ai/api/organizations/{orgId}/usagein-process(Cloudflare blocks child processes)
Install (macOS, requires Claude Desktop):
```bash
npm install -g claude-web-usage
bash "$(npm root -g)/claude-web-usage/install.sh"
Restart Claude Code and usage data appears in the statusline.
GitHub: https://github.com/skibidiskib/claude-web-usage
npm: https://www.npmjs.com/package/claude-web-usage
License: MIT
Workaround: OAuth Token Refresh
We found that rate limits are per-access-token, not per-account. Refreshing your OAuth token gives you a fresh rate limit window.
How to bypass:
Important: Refresh tokens are one-time use. You must save both the new
access_tokenANDrefresh_tokenfrom the response — otherwise your next refresh will fail.---
We also implemented this fix in onWatch, an open-source quota tracking tool for Claude Code, Codex, Copilot, and other AI tools. It now automatically handles 429s by refreshing tokens and updating your Keychain/keyring.
Implementation: onllm-dev/onWatch@0ab1009
If you find this useful, consider giving the repo a star!
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.