Skip to main content
Every LLM call in Forge produces a token event — a cost record capturing the model, agent, gateway, token counts (input/output/cached), and cost in cents. These events feed into multi-dimensional analytics.

Token Event Fields

FieldDescription
modelModel identifier used for the call
agentIdAgent that performed the work
gatewayIdGateway that routed the call
inputTokensTokens sent to the model
outputTokensTokens generated by the model
cachedTokensTokens served from prompt cache
costCentsComputed cost at capture time
succeededWhether the call completed successfully
timestampWhen the event was recorded

Cost Aggregation

Token events roll up into hourly, daily, weekly, and monthly buckets. Filter by gateway, agent, model, workflow, or time range. Scheduled crons compute aggregates — hourly rollups run every hour, daily rollups every 24 hours, and a weekly compaction job consolidates older buckets.

Model Economics

Per-model cost comparison showing input vs output pricing, average cost per request, and volume distribution across models. The model registry stores per-1M-token rates for each model/gateway combination. Cost is computed at capture time and the pricing snapshot is stored on the event for audit.

Token Attribution

Each event is attributed through two parallel hierarchies. The task chain traces cost through the execution hierarchy: token → task → workflow → project. The worker chain traces cost through the organizational hierarchy: token → worker → team → department. Both chains originate from the same token event record. See Budgets for the full hierarchy.

In Burgundy: Explore cost data in the analytics dashboard. →