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

Option A: custom status line (recommended, no plugin)

  1. Download llmapi-statusline.js to e.g. ~/.claude/llmapi-statusline.js.
  2. 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% ⟳1d8h

Option B: keep using claude-hud

  1. Download llmapi-usage-snapshot.js
  2. 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" } ] } ] } }
  1. 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