header-status
Within budget
Resets Nov 1
Alert at 80%
Copy usage, cost and budget blocks into your app for Radix or Base UI, or take the headless React hooks and keep your own design. Every block reads exact figures from the Meter.
The React layer and registry run from the repository checkout, not npm.
These previews read an in-memory Meter in your browser. Send a request or simulate a timeout, and every number moves.
Within budget
Resets Nov 1
Alert at 80%
Requests
11
MeasuredProvider cost
$18.12
MeasuredUnknown operations
0
None awaiting evidenceMonthly spend
Resets Nov 1
Blocks at the limit. Alert at 80%.
Provider cost
Provider charges for tracked usage.
$18.12
Coverage
Total16 requests
Cost excludes untracked requests.
Usage detail
| Provider | Funding | Requests | Tokens | Cost | Certainty |
|---|---|---|---|---|---|
| Language model | Platform funded | 6 | 12,490 | $12.49 | Estimated |
| Search API | Own key | 5 | Unavailable | $5.63 | Measured |
As of on the sample clock.
Needs attention
| Operation | Provider | Principal | Exception | State | Age |
|---|---|---|---|---|---|
| No exceptions in this period. | |||||
Together they make a shadcn dashboard for usage and costs. See all 20 blocks in the component index.
Headless hooks return exact view models with explicit states. Equal reads share one cache, so a header badge and a dashboard never disagree.
import { useBudgetsView } from "@usagekit/react";
import type { Scope } from "@usagekit/core";
// Bar, Money and Notice are your own components.
type Props = { scope: Scope };
export function SpendBudget({ scope }: Props) {
// Equal reads share one cache entry.
const { data, state, refresh } = useBudgetsView({
scope,
surface: "app",
units: ["cents"],
});
if (state === "loading") return <Notice busy />;
if (state !== "ok" || !data) return (
<Notice state={state} onRetry={refresh} />
);
return data.rows.map((row) => (
<section key={row.id} data-level={row.level}>
<Money amount={row.remaining} /> left
<Bar geometry={row.bar} />
</section>
));
}
The live output of useBudgetsView on this page, read from the sample in-memory Meter.
// data.rows[0]
{
used: { text: "1812", unit: "cents", certainty: "measured" },
reserved: { text: "0", unit: "cents", certainty: "estimated" },
remaining: { text: "688", unit: "cents", certainty: "measured" },
limit: { text: "2500", unit: "cents", certainty: "measured" },
level: "ok",
bar: { used: "72.48", reserved: "0", limit: "100", hardLimit: null, alerts: ["80"] },
// plus id, window, resetsAt, boundary and more
}
Sample requests run against the in-memory Meter only.
useUsageViewuseUsageSummaryuseBudgetsViewuseDefinedBudgetsuseHeaderStatususeCoverageViewuseExceptionsViewProvider hooks read connections, balances, quotes and allocations through a port your application supplies. About provider hooks
Reserve before the call, settle from the receipt, and show every user exactly where they stand.
npm install @usagekit/core @usagekit/store @usagekit/meter @usagekit/providers