Usage
Usage displays real server state with a next action, not placeholder statistics.
Surface contract
Primary object: the metered usage ledger and the budget rows that cap it: included allowance, consumed and reserved micro-USD.
Actions
- Change capSends PUT /v1/budgets/{id} with the new cap in micro-USD (owner/admin only); a cap below consumption pauses further spend until it is raised.
- Download ledgerDownloads a CSV of this organization’s own /v1/billing/usage rows (occurred_at, meter, quantity, source, mode, ids); the file is generated from the control plane’s answer, and a refusal is relayed as a problem, never as an empty ledger.
- Enable overagesSends PUT /v1/budgets/{id} with overages_enabled: true so metered use past the allowance is billed instead of refused (402); the Budgets section shows the flag’s current server value.
Required states and how this surface reaches them
- loading
- the session probe and each list show Loading… until the control plane answers.
- ready
- the server’s own records render as returned; the primary object is named before its details.
- empty
- no usage row exists until an accepted, consented event or job writes one; rejected and sampled-out events are never billed.
- error
- the control plane’s status and detail are shown; no placeholder row replaces them.
- offline
- no control plane is reachable; nothing is rendered rather than invented.
- permission_denied
- a 401 returns to sign-in with this path; a 403 states that the role cannot read this surface.
- not_configured
- a ledger download with no reachable control plane answers 503 instead of an empty file.
- budget_paused
- a call refused with 402 quota_exceeded names the meter and the limit it hit; Enable overages records explicitly that further metered use is billed beyond the allowance.
- requires_approval
- mutations the server reserves for an explicit human owner/admin are refused with its own detail and never auto-approved here.
Scope: workspace membership (owner/admin for caps). Every meter row is written by the control plane’s own ingestion or jobs; the page shows the rate version and mode it recorded and never estimates a bill.
Usage events
checkingLoading…
Budgets
checkingLoading…
Subscription
checkingLoading…
Rows come from the authenticated control plane; this page never renders placeholder records. Actions report the server's own response, including refusals.