Repository navigation
openrouter-balance shows the balance with a regular key too - #88
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
/creditsneeds 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./creditsrefuses 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-balancewith a regular key starts with the account balance, then the key's own spend.scope: key_limit).Checked
claude plugin test: 10 pass (UTC and Asia/Tokyo). Two tests updated and one added for the regular-key balance.$0.13 of $5.00 left, top up soon, and the command shows the balance and the key's spend.🤖 Generated with Claude Code