Synced from Hive. This page is pulled from hivecommons/hive@v5 during the docs build. Edit the canonical source in the Hive repository.

Dashboard REST API reference — Cost, tokens, telemetry

Part of the Dashboard REST API reference; see that page for how auth levels and pkg/<file>:<line> source citations are read and checked. Edit this file for routes in this area and run src/scripts/check-api-reference-citations.sh --fix to resync citations.

MethodPathAuthPurposeSource
GET/api/trendsDashboard auth/sessionTrendspkg/dashboard/api.go:87
GET/api/token-accessDashboard auth/sessionToken Accesspkg/dashboard/api.go:161
GET/api/tokensDashboard auth/sessionTokenspkg/dashboard/api.go:162
GET/api/costDashboard auth/sessionCost; merged_prs / closed_issues come from the webhook-incremented ForgeState counters reconciled hourly against search, with count_stale, count_stale_since and count_source (forgestate / search) when last-good counts are being served (#13376), count_partial when only some configured repos have an attributed baseline yet, and count_error naming why the latest attributed refresh failed or was partial (the reconcile asks GitHub about a budgeted slice of repos per pass so a many-repo hive stays inside search’s rate limit); daily_rollup lists per-UTC-day estimated spend (day, cost_usd, input_tokens, output_tokens, samples) kept for ~2 years so the Cost chart can reach past the 30-day snapshot ring; recording reports agent_models, unrecorded_models, recent_models, last_priced_growth_at, last_agent_model_growth_at, stale_after_ms and stale so the card can flag stale live usage recording (#13485)pkg/dashboard/api.go:163
GET/api/repo-activityDashboard auth/sessionPer-repo audited activitypkg/dashboard/api.go
GET/api/repo-costDashboard auth/sessionPer-repo estimated token cost (interval join, cached)pkg/dashboard/api.go
GET/api/launch-costDashboard auth/sessionPer-issue / PR / head-SHA estimated token cost from kick launch attribution (cached; ?ref=owner/repo#N narrows)pkg/dashboard/api.go
GET/api/launch-cost/historyDashboard auth/sessionDaily per-ref rollup of launch attribution (daily_rollup[]: day, by_ref[] with ref, kind, launches, share_usd), kept ~2 years on the /data PVC so cost per PR can be measured past the /api/launch-cost windowpkg/dashboard/api.go
GET/api/cost/historyDashboard auth/sessionCost Historypkg/dashboard/api.go:169
GET/api/trend/historyDashboard auth/sessionTrend Historypkg/dashboard/api.go:172
GET/api/timeseriesDashboard auth/sessionTime Seriespkg/dashboard/api.go:174
GET/api/providers/headroomOwner onlyLast stored per-provider usage readings (providers[] with limits[], captured_at, stale, probe_error_cause, and plan_type when a provider reports one), from provider rotation or the default publish-only reading; serving it never triggers a new measurement. Feeds the Overview Claude usage gauge and the rotation settings tablepkg/dashboard/api.go:64
GET/api/budget/historyDashboard auth/sessionBudget Historypkg/dashboard/api.go:171