Cost Dashboard
AI cost for the admin: spend over time with what the cache saved, spend by model, the top spenders (subject hashes, as the server gives them), and how much of the global day and month caps is used. Data is what signet-server's `observabilityAdminRoutes` returns (`series`, `models`, `top`) plus the global caps from signet-db's `usage("global")`; hand it in as `data`, or give a `fetcher(days)` and the screen loads and retries itself. Money is millionths of a USD. recharts is an optional peer, so this screen has its own export path, `@dapplelight/signet-ui/screens/cost-dashboard`, never the barrel.
Installation
npm i @dapplelight/signet-uiUsage
import { DEFAULT_COST_LABELS, CostDashboard } from "@dapplelight/signet-ui/screens/cost-dashboard"
// CostDashboard({ data: dataProp = null, fetcher, days: daysProp, onDaysChange, loading: loadingProp = false, error: errorProp = false, onRetry, labels: labelsProp, className, ...props }: CostDashboardProps)
<CostDashboard />API Reference
| Export | Props |
|---|---|
CostSeriesRow | — |
CostModelRow | — |
CostSubjectRow | — |
CostCapUsage | — |
CostDashboardData | — |
DEFAULT_COST_LABELS | — |
CostLabels | — |
CostDashboardProps | — |
CostDashboard | { data: dataProp = null, fetcher, days: daysProp, onDaysChange, loading: loadingProp = false, error: errorProp = false, onRetry, labels: labelsProp, className, ...props }: CostDashboardProps |