docs: billing & usage UX — visibility + one-off top-up + auto-top-up (monthly cap) - #475
Open
ZIJ wants to merge 3 commits into
Open
docs: billing & usage UX — visibility + one-off top-up + auto-top-up (monthly cap)#475ZIJ wants to merge 3 commits into
ZIJ wants to merge 3 commits into
Conversation
…op-up w/ monthly cap Working doc from the 2026-07-02 "running out of tokens" investigation. Captures the mechanism (managed model spend → Autumn credits → 402 halt; not limits.tokens), the evidence (low/internal incidence; ~88% of sessions on the opus default which burns the grant fast), and — key reframe — that top-up/auto-top-up/compute-usage/invoices ALREADY exist in Billing.tsx, so this is consolidate + gap-fill (surface model/token usage + remaining, unified breakdown by compute vs model / by model / by agent, monthly auto-top-up cap, discoverability) rather than greenfield. Includes cheap quick wins (flip default off opus, sane grant, actionable exhaustion message), data sources, open decisions, and S0–S4 slices. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ady built Two corrections after re-checking the code: - Billing is wired end-to-end: edge model_meter debits OpenRouter spend (with markup) to the org's Autumn credits pool and halts at ≤0. NOT a leak. Called this out explicitly and distinguished it from "usage-not-wired" (a per-session attribution/visibility gap in sessions-api — session.usage/limits.tokens — not a billing hole; it's the prerequisite for the per-agent "for what" breakdown). - The top-up UI is already built: one-off autumnTopup + a full AutoTopupCard (enable + threshold + recharge amount). Narrowed the auto-top-up gap to the monthly cap only, and flagged that linking the runtime "out of credits" message → the existing top-up flow is the highest-value, no-new-UI fix.
…its run out
First build slice, spec'd end-to-end across repos: 1a actionable exhaustion CTA (client keys off
the existing error.runtime{code:insufficient_credits}, deep-links to the built top-up), 1b
low-balance banner (autumn orgs, Autumn credits.remaining < threshold), 1c fast un-halt on top-up
(re-project OR caps on the Autumn top-up webhook, not next meter-cron — the real UX risk). Touch
points, acceptance criteria (incl. exhaust→top-up→re-message within seconds), and explicit
out-of-scope (attribution/monthly-cap/breakdown = S2–S4) included.
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.
Working design doc (
.agents/work/billing-usage-and-topup.md) from today's "users running out of tokens" investigation. Docs only — for review/discussion, not a build.What it found
credits; the edgemodel_meterhalts at ≤0 → OpenRouter 402 → the runtime posts "run out of model credits, top up" and stops. (Notlimits.tokens— that cap is a no-op.)Key reframe
Most of the target already exists in
web/src/pages/Billing.tsx(one-offautumnTopup,setAutumnAutoTopup, compute usage, invoices) + edgemodel_meter. So this is consolidate + gap-fill, not greenfield. Gaps: surface the (hidden) model/token pool + remaining, a unified breakdown (compute vs model, by model, by agent), an auto-top-up monthly cap, and discoverability for sessions users.Proposes
Decisions to weigh in on
🤖 Generated with Claude Code