You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Add option to display OpenRouter remaining balance #127
OpenRouter accounts with prepaid credits have no way to see how much is left from the Dux Shell bar or the dashboard. The OpenRouter adapter already reads the read-only GET /api/v1/key endpoint, which returns total usage and the limit set on the key, but the remaining balance (limit - usage) is not offered as a display option, unlike balance providers such as Kimi, DeepSeek, or Vercel AI Gateway.
Users on prepaid OpenRouter credit have to open openrouter.ai/credits to check what's left, which defeats the point of a bar that tracks every provider on the machine.
Proposed solution
Add OpenRouter's remaining balance as an optional display value, following the existing balance-provider pattern:
• Compute remaining = limit - usage from the already-fetched /api/v1/key payload and show it as an amount (for example $12.34) in the pill and card header, in the same style as the other balance providers.
• Add a toggle in settings to choose between the current quota/limits view and the remaining balance, or show the balance line on the OpenRouter card under the existing quota data.
• Keep the existing behavior the default so nothing changes for current users.
• OpenRouter provider only, using the existing read-only /api/v1/key call. No new endpoints, no token consumption.
• Home keys with no limit set would show nothing rather than a fabricated balance, matching how other balance providers handle missing totals.
• Settings UI for the toggle, bar pill and card header rendering, and the five existing locales in parity.
• No write actions: this only reads and displays.
It's taking some effort to get OpenRouter working exactly the way I want. I'm implementing a few tracking options, and the OpenRouter documentation exposes a lot of variables to work through.
I'll ship the release today with:
OpenRouter remaining balance
A choice of sign-in method: API key or OAuth
Harness tracking for Ori (OpenRouter's proprietary harness)
This shipped in v2.5.0. Settings → Providers → OpenRouter main bar now offers three views:
Key limit (default, unchanged): the key's spending cap, or the daily :free allowance of an uncapped key.
Key balance: what is left of the key's cap, in dollars (limit - usage), as you suggested.
Account credits: the account balance shown on openrouter.ai/credits (total_credits - total_usage).
The bar pill and the card header show the amount like the other balance providers. A balance with no cap to compare against appears as a plain amount, with no usage bar or warning colour. Details are in the 2.5.0 notes.
I'll keep this issue closed, but I'm around for any question or feedback, so feel free to reply here.
Activity
bernardopg commentedon Nov 16, 2026
@Dukko Thanks for the suggestion!
It's taking some effort to get OpenRouter working exactly the way I want. I'm implementing a few tracking options, and the OpenRouter documentation exposes a lot of variables to work through.
I'll ship the release today with:
Feel free to share any feedback! <3
Dukko commentedon Nov 16, 2026
This is amazing! Looking forward to the update.
feat(openrouter): key balance and account credits views, Ori telemetry
bernardopg commentedon Nov 16, 2026
Thanks for your patience, @Dukko!
This shipped in v2.5.0. Settings → Providers → OpenRouter main bar now offers three views:
:freeallowance of an uncapped key.limit - usage), as you suggested.total_credits - total_usage).The bar pill and the card header show the amount like the other balance providers. A balance with no cap to compare against appears as a plain amount, with no usage bar or warning colour. Details are in the 2.5.0 notes.
I'll keep this issue closed, but I'm around for any question or feedback, so feel free to reply here.
Dukko commentedon Nov 16, 2026
Maybe I'm doing something wrong, but my usage is not showing my balance:
Any reason why?
I just updated to 2.5.0 btw.
bernardopg commentedon Nov 16, 2026
Try change in the settings to "account credits". it should solve!
Dukko commentedon Nov 16, 2026
Embarassing. Thanks, solved. :D
bernardopg commentedon Nov 16, 2026
Hahahaha no problem