Skip to content

openrouter-balance shows the balance with a regular key too - #88

Merged
hamzafer merged 2 commits into
mainfrom
openrouter-balance-any-key
Oct 13, 2026
Merged

hamzafer merged 2 commits into
mainfrom
openrouter-balance-any-key

Conversation

@hamzafer

Copy link
Copy Markdown
Owner

What changed

  • OpenRouter's docs say /credits needs a management key, but a live test with a regular key got a 200 with the account totals. The line now shows the account balance for any key that OpenRouter answers.
  • If /credits refuses a regular key (401/403/404), the mod falls back to the key's own spend and limit and does not mark the key rejected.
  • /activity (spend by model) still goes out only with a management key. It returns 403 for regular keys.
  • /openrouter-balance with a regular key starts with the account balance, then the key's own spend.
  • The Budget line is hidden when it only repeats the key limit (scope: key_limit).
  • Any credit left shows at least one gauge block, so $0.13 of $5.00 no longer looks empty.
  • openrouter-balance 0.1.1. README, docs/mods.md and the site page are updated.

Checked

  • claude plugin test: 10 pass (UTC and Asia/Tokyo). Two tests updated and one added for the regular-key balance.
  • Run live with a throwaway regular key: the band shows $0.13 of $5.00 left, top up soon, and the command shows the balance and the key's spend.

🤖 Generated with Claude Code

OpenRouter answers /credits for regular keys as well, so the line shows the
account balance whenever it can. A refusal falls back to the key's own spend
and limit without calling the key rejected. The Budget line no longer repeats
the key limit, and any credit left shows at least one gauge block.
openrouter-balance 0.1.1.
- a /credits outage never hides a regular key's own numbers
- a key limit tighter than the account's credit is what the line shows
- /openrouter-balance shows the account's spend today, the same as the line
- the line says "credit" or "key limit", so $5.00 isn't mistaken for the key's limit
- "since HH:MM" is in local time; the day itself stays UTC
@hamzafer
hamzafer merged commit 2114aec into main Oct 13, 2026
1 check passed
@hamzafer
hamzafer deleted the openrouter-balance-any-key branch October 13, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant