Skip to content
Sign upPro
SettingsUsage breakdownMenu

Usage breakdown (Pro)

ProIncluded in $99

Who and what is driving usage and what changed: ranked by member, model or feature, compared with the period before, and drillable.

ProSix members over half a year. One member's agent runs doubled her spend; click her row to see which model.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/usage-breakdown

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { UsageBreakdown } from "@/components/ui/chatcn/pro/usage-breakdown"

<UsageBreakdown
  records={records}   // { day, model, member, feature, cost, tokens, requests }, one per day and group
  ranges={[7, 30, 90]}
  defaultMetric="cost"
  defaultDimension="member"
  currency="USD"
/>

Pick spend, tokens or requests and a range. Rows rank members, models or features by that metric with their share of the total, a small trend across the range and the change against the same number of days before; groups with nothing before are marked New. Click a row to look inside it: a member opens their models, a model opens its features, and each step stays as a filter chip that can be removed. It answers the follow up questions to cost-explorer, which charts spend by day. Records are summed in the browser, so pass daily rollups, not raw requests.

Examples

States

ProTokens by model over 90 days, a range with no usage, and a narrow frame.

Props

PropTypeNotes
recordsUsageRecord[]{ day, model, member, feature, cost, tokens, requests }
ranges, defaultRangenumber[], numberIn days; default 7, 30 and 90
defaultMetric"cost" | "tokens" | "requests"
defaultDimension"member" | "model" | "feature"
nowDateThe last day of every range
currency, localestringFormatting
labelsPartial<UsageBreakdownLabels>Every string, for translation

Accessibility

  • Metric, range and breakdown are native radio groups.
  • Each row is a button named with its value, share and what clicking it shows.
  • Changes read as up or down, not only as an arrow.

Motion

None.