Get Cost History

Return cost history for chart visualization.

Two response modes share one endpoint:

  • GET /costs/history?hours=24&granularity=hour (web GUI sparkline) - returns a flat [{ts, usd}] array bucketed from cost-tracker usages over the last hours window.
  • GET /costs/history or ?envelope=1 (legacy/CLI) - returns the original {history, trend, burn_rate_*, history_days} envelope built from .sdd/metrics/cost_history.jsonl daily snapshots, narrowed to the caller's tenant the same way /costs/alerts is.

The sparkline branch lets the GUI feed recharts directly without unwrapping a .history field.

get/api/v1/costs/history

Request

  • Base URL: http://127.0.0.1:8052
  • URL: http://127.0.0.1:8052/api/v1/costs/history
  • Auth: none declared

Query parameters

hoursinteger nullable
granularitystring
envelopeinteger

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.