Docs / Usage in Claude Code
Show your plan usage in Claude Code (5h / weekly)
Show your real llmapi 5h / weekly request usage in the Claude Code status bar.
Claude Code's built-in
/usage only works for Anthropic OAuth subscriptions, not API-key endpoints — a Claude Code limitation, not a config issue. The script below queries /v1/usage with your key and renders it.Requirements
- Claude Code already pointed at llmapi (env has
ANTHROPIC_BASE_URL=https://llmapi.proand yourANTHROPIC_AUTH_TOKEN). nodeis installed (Claude Code depends on it).
Option A: custom status line (recommended, no plugin)
- Download llmapi-statusline.js to e.g.
~/.claude/llmapi-statusline.js. - Add to
~/.claude/settings.json:
{ "statusLine": { "type": "command", "command": "node ~/.claude/llmapi-statusline.js" } }Reopen Claude Code; the bottom bar shows something like:
max5x 5h 9.8% █░░░░░░░░░ 589/6000 ⟳1h25m 7d 0.2% ⟳1d8hOption B: keep using claude-hud
- Download llmapi-usage-snapshot.js。
- Refresh the snapshot via a Claude Code Stop hook (or a scheduled task):
{ "hooks": { "Stop": [ { "hooks": [ { "type": "command", "command": "node ~/.claude/llmapi-usage-snapshot.js" } ] } ] } }- Point claude-hud at the same file:
{ "display": { "externalUsagePath": "~/.claude/llmapi-usage-snapshot.json" } }
Query the usage API directly
curl https://llmapi.pro/v1/usage -H "x-api-key: sk-YOUR_KEY"{ "plan": "max5x",
"five_hour": { "used": 120, "limit": 1200, "remaining": 1080, "reset_at": "...Z" },
"week": { "used": 900, "limit": 6000, "remaining": 5100, "reset_at": "...Z" } }Full README: /cc-usage/README.md
Need help? Email [email protected] · Home