Loading component…
Loading component…
This component has not been implemented locally yet.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import Agent/Usage from ./agent-usage.
import { AgentUsageScreen } from "@/components/ui/agent-usage";
export default function Page() {
const { days, projects, models, notes, latestRun } = useUsage("2026-11");
return (
<AgentUsageScreen
days={days} // what it cost each day so far – the last is today
daysInMonth={30}
budget={500}
currency="EUR"
projects={projects}
models={models}
notes={notes}
latest={latestRun} // a new id plays "+€0.42 · Ingest pipeline"
onOpenNote={(note) => router.push("/runs/" + note.id)}
onNavigate={(label) => router.push(routes[label])}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| days | number[] | 19 sample days | What it cost each day of the month so far – the last one is today. The curve adds them up; the pace of these days makes the dashed forecast |
| daysInMonth | number | 30 | How many days the month has |
| budget | number \| null | 500 | The month's budget – the curve draws it as a line and the sentence says on which day it would be passed; null for none |
| currency | string | "EUR" | ISO 4217 code – every amount is formatted with it |
| projects / models | { id; name; amount; last?; tone?; days?; tasks?: { title; runs; cost }[] }[] | Where it went – amount this month, last for the change on last month, tone a palette name or any color, days for the panel's bars, tasks for what cost the most | |
| notes | { id; kind: "spike" \| "jump" \| "budget"; text; detail?; badge? }[] | What's worth a look – Open calls onOpenNote (or onNavigate("Runs")) | |
| stats | { tasks?; runs?; tokens? } | The month's numbers under the curve – with tasks it also shows the cost per task | |
| latest | { id; task; cost } \| null | The run that just finished – a new id plays its moment: the sum ticks up and "+€0.42 · task" shows beside it | |
| defaultView | "projects" \| "models" | "projects" | What Where it went shows first |
| defaultSelected | string \| null | "northwind" | The project or model open on the right |
| onOpenNote | (note: UsageNote) => void | Called with Open on a note | |
| onSelect | (view, id) => void | Called when a project or a model is opened | |
| onNavigate | (label: string) => void | Called with the label of a sidebar item | |
| labels | { usage?; month?; monthShort?; spent?; onTrack?; over?; whereItWent?; worthALook?; … } | Labels, e.g. for a translation – onTrack and over take {amount}, {budget} and {date} | |
| empty | boolean | Nothing spent yet: the page shows Nothing spent yet with a sentence on when spend shows up and a Start a task button (calls onNavigate with "Tasks"); the breakdown and notes hide and the Details panel shows nothing open | |
| className | string | Extra class on the root |
Fills its container; the page keeps a readable 720px column and the curve takes its full width
Below 620px the numbers stack two by two, the bars make room for name, amount and change, and a note's badge and Open move under its text
Amounts keep their column at any size – €1.28M in a row with the whole amount in its tooltip and the panel; a change of thousands of percent reads as a factor (↑12×); every currency gets its own decimals (€270.40, ¥43,264)
Touch targets grow to 36px on touch screens
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"