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

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:

pro  5h 10.0% █░░░░░░░░░ 50/500 ⟳1h25m   7d 20.0% ⟳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"

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

Need help? Email support@llmapi.pro · Home