This is what it does

Key balance panel

Reads a balance ledger and says which billing window you are in, what the money was spent in, and what it would have cost in the other window. Paste a ledger below and press Recompute.

The widget’s own accounting, running in your browser — nothing pasted leaves the tab

  • What it does: classifies every instant as peak or off-peak from the published schedule, splits spend across the two, and refuses to guess at gaps longer than six hours.
  • What to try: press Recompute on the sample ledger, then paste your own rows as timestamp, balance and watch the split move.
  • What runs here: the widget’s own peak.js and ledger.js, copied byte for byte. The numbers are real arithmetic over the ledger on screen.
  • What this is not: the panel itself. The chip and the floating card are two seats that need the console host they install into; this page has neither, and it never asks for a key.
  • The honest limit: usage is inferred from balance movement between snapshots, so the split is only as fine-grained as the sampling interval.

What it is

Two seats in one package

A chip in the session header states the window you are in with a live countdown to the next switch. Clicking it opens a floating card with the 24-hour timeline in your local time, each key’s remaining balance, the spend split by window, and the rate you are paying this minute.

The host half reads the key file you point it at and calls the balance endpoint; the browser half renders the chip and the card. The package is installed into the console you already run — there is nothing to download here, and the missing piece is access to that console rather than code.

Plainly

Where the figures come from, and where they stop

  • The schedule is read, not invented. Which hours are cheap is quoted from the provider’s published pricing page: two peak windows on weekdays, everything else at half price, weekends off-peak in full. The host half classifies every instant in UTC so there is one implementation of the rule.
  • Holidays are not guessed. The holiday list defaults to empty and the panel says so on its own face — zero dates configured, weekday rule only. A calendar it does not have is never implied.
  • Usage is derived, and the derivation is stated. A balance rise is a top-up, never negative spend; each loss is attributed by the midpoint of its interval; an interval longer than six hours is counted separately as unattributed instead of being silently split. The demo above shows all three cases.
  • The saving figure is arithmetic. Off-peak is published as half of peak for every model and token class, so a dollar spent off-peak would have cost two in a peak window whatever the mix. The estimate equals off-peak spend; it is not a model.
  • Keys never reach the browser. The host half reads them from disk and returns masked identifiers only, and a render test asserts no usable key string can appear in the page.
  • Boundaries. The timeline is today rather than a projection; the rate card shows the current window and does not attribute past spend per model; and a snapshot is not a token count.

Under the hood

What it is built on

Stack
Two halves in one package: a host module that reads the key file, calls the balance endpoint and serves the state, and a browser half that renders the chip and the card as a classic script with no bundler and no JSX.
Runs where
Installed into the web console you already run, link-installed so this directory is the only copy of the code. Its state — the config and the balance sample series — lives in your home directory, outside the project tree.
Payments
None. Nothing is sold, and there is no account to create.
Tested by
A syntax check plus 21 tests: 15 over the window rule and the accounting, and 6 that materialize the real bundle and render both seats, including the assertion that no usable key string reaches the page.

Status

Installed and running

  • The accounting on this page is the product’s own code. peak.js and ledger.js are copied from the package byte for byte, so the split, the six-hour rule and the saving figure are the widget’s arithmetic and not a re-implementation. What is missing is the panel itself: the two seats need the console host.
  • 21 of 21 tests pass, a lint check passes, and the loader entry resolves from the live profile it is installed into.
  • There is nothing to download here. The package installs into the studio’s console, so the way in is asking for access.

Ask for access

Whether a panel like this fits how you work, how it picks up the peak and off-peak windows, or how it reads your key file — ask.

Ask for access