Dashboard (user JWT)
Workspace metrics
Spend dashboard metrics — totals, daily series, by project/type, budget.
GET
Requires Supabase JWT + workspace membership. Powers the Robinhood-style spend panel.
Workspace slug
day | week | month | quarter | year | all (default month)Filter to one project slug
Filter by message type (
usage, expense, subscription, …)Filter by environment label
Response fields
| Field | Type | Description |
|---|---|---|
period | string | Echo of query |
period_label | string | Human label |
total_usd | number | |
usage_usd | number | |
expense_usd | number | Non-usage, non-subscription |
subscription_usd | number | |
message_count | number | |
daily | array | { date, amount_usd } |
daily_by_type | array | Gap-filled usage / subscription / expense / total |
daily_by_project | object | { series, daily } — top 5 + other |
by_project | array | { slug, name, amount_usd, percent } sorted desc |
by_type | object | Map of message_type → amount |
budget | object | null | Global budget with status: ok | warning | danger |
top_project | object | null | Highest spend project |
