Docs / Usage in Claude Code
Show your plan usage in Claude Code (5h / weekly)
Show your actual llmapi 5-hour / weekly subscription usage in the Claude Code status bar. Usage is measured in weighted quota units, not the number of API calls.
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:
pro 5h 10.0% █░░░░░░░░░ 50/500 ⟳1h25m 7d 20.0% ⟳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"The values below illustrate a Pro plan. Use the API response for your actual limits and reset times; reset_at is null when there is no active window. See Rate Limits & Quota for the calculation.
{ "plan": "pro",
"five_hour": { "used": 50, "limit": 500, "remaining": 450, "reset_at": "2026-10-21T12:00:00.000Z" },
"week": { "used": 500, "limit": 2500, "remaining": 2000, "reset_at": "2026-10-22T18:35:00.000Z" } }Full README: /cc-usage/README.md
Ready to connect?
Check your base URL & generate settings · Choose your client guide · Create an account
Need help? Email support@llmapi.pro · Home