Goal
Create a /costs page (or Costs section in Settings) that surfaces total AI spend from the existing token_usage DB table.
Background
Token usage is already recorded per task. It is not surfaced anywhere in the web UI. Users need to know what they are spending.
Scope
- New route
/costs linked from sidebar
- Summary cards: total spend in the selected period, total tasks run, average cost per task
- Time range selector: Last 7 days / 30 days / 90 days (default 30)
- Spend-over-time chart: daily bar chart using Recharts or similar already used in the codebase
- Backend: add
GET /api/v2/costs/summary?days=30 that aggregates token_usage rows into daily buckets with cost calculated from model pricing table (hardcode sensible defaults per model, allow override via env)
Out of scope
- Per-task or per-agent breakdown (separate issue)
- Budget alerts
Acceptance criteria
Goal
Create a
/costspage (or Costs section in Settings) that surfaces total AI spend from the existingtoken_usageDB table.Background
Token usage is already recorded per task. It is not surfaced anywhere in the web UI. Users need to know what they are spending.
Scope
/costslinked from sidebarGET /api/v2/costs/summary?days=30that aggregatestoken_usagerows into daily buckets with cost calculated from model pricing table (hardcode sensible defaults per model, allow override via env)Out of scope
Acceptance criteria
/costsrenders with summary cards and chartnpm testandnpm run buildpass