Skip to content

[Feature]: Add option to display OpenRouter remaining balance #127

Closed

Description

@Dukko

Problem

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.

Scope

Widget UI

Alternatives considered

No response

Activity

  1. added
    enhancement
    on Nov 14, 2026
  2. bernardopg commented on Nov 16, 2026

    @bernardopg
    Owner

    @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:

    • OpenRouter remaining balance
    • A choice of sign-in method: API key or OAuth
    • Harness tracking for Ori (OpenRouter's proprietary harness)

    Feel free to share any feedback! <3

  3. Dukko commented on Nov 16, 2026

    @Dukko
    Author

    This is amazing! Looking forward to the update.

  4. bernardopg commented on Nov 16, 2026

    @bernardopg
    Owner

    Thanks for your patience, @Dukko!

    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.

  5. Dukko commented on Nov 16, 2026

    @Dukko
    Author

    Maybe I'm doing something wrong, but my usage is not showing my balance:

    dms_capture_1794864992284 image

    Any reason why?

    I just updated to 2.5.0 btw.

  6. bernardopg commented on Nov 16, 2026

    @bernardopg
    Owner

    Try change in the settings to "account credits". it should solve!

    image
  7. Dukko commented on Nov 16, 2026

    @Dukko
    Author

    Embarassing. Thanks, solved. :D

  8. bernardopg commented on Nov 16, 2026

    @bernardopg
    Owner

    Hahahaha no problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions