Skip to content

Metering

Metering is the aggregation of tokens, cost, and call counts across every governed call.

Per-session totals roll up to per-agent → per-project → per-org. Operators answer "what did this cost?" and "who's about to blow the budget?" from one place.

Metering is derived, not stored separately — it's a query (and pre-aggregated rollups) over the audit trail's call events.

Derived fromAudit trail events on every LLM and tool call
Tracksinput tokens, output tokens, cost (USD), call count, latency p50/p99
Rolled up bysession → agent → project → org · day / week / month
Drivescost dashboards, budget alerts, the cost.budget.* pipeline-step family
Statusnext

Every LLM and tool call writes a row carrying:

FieldSource
input_tokensLLM provider response usage block
output_tokensLLM provider response usage block (streamed)
cost_usdinput/output × per-vendor unit price (current pricing table)
latency_mswall clock from request entry to response complete
tool_call_counttool/MCP calls during the same session
cache_read_tokens / cache_write_tokensfor vendors that support prompt caching

Pre-aggregated counters in PostgreSQL keep dashboard queries fast:

Session totals (1 row / session, finalized at session end)
Daily agent totals (1 row / agent / day)
Daily project totals (1 row / project / day)
Daily org totals (1 row / org / day)

Live (in-flight session) counters live in the Session's context — finalized on session end.

Metering is the economic view of a session, distinct from:

Metering also drives enforcement: the cost.budget.session, cost.budget.agent, cost.budget.org pipeline steps read live counters and reject calls when limits are hit.

PersonaSurfaceWhat they see
OperatorCosts dashboardDaily/weekly burn per project, top-N agents, per-vendor split
OperatorPer-agent detailLive session burn vs budget, history
FinanceMonthly statementOrg rollup, broken down by team / project
Pipeline stepcost.budget.* reads countersReject calls when threshold exceeded
BYOK customerBYOK dashboardSame data scoped to their own credentials