Stored model-call costs
Agent Barn stores model-call costs in its own cost records. A background synchronization job imports LiteLLM spend logs and attributes calls to Agents and Organizations using per-Agent key identity. When a successful OpenRouter call has tokens but no recorded spend, the job can recover its charge from OpenRouter.
- 01.1
Cost reports query these stored records. They do not calculate spend from Conversation Messages or Tool Calls. Reports reflect the latest completed synchronization, so recent calls can take time to appear and historical totals can increase as missing charges are recovered.
- 01.2
LiteLLM spend logs → synchronization and attribution →
cost_record→ authorized reports. OpenRouter generation charges → missing-cost recovery →cost_record.
Historical records
Cost records retain captured Agent and Organization identities and display names after the associated resources are deleted. Reading a stored record does not require decrypting a current Agent key. Missing records or an unresolved charge must not be interpreted as proof that a call was free.
Reporting access and boundaries
Organization-wide reporting requires the Organization-level cost.read Permission. Per-Agent reporting requires effective Agent cost access. Organization Owner/Admin can also read soft-deleted Agent cost history; Agent assignments do not retain access after Agent deletion. Platform-wide reporting has separate Platform Administrator routes and does not grant Organization membership.
- 03.1
Cost reports support operational attribution. They do not enforce budgets or spending caps, provide provider invoices, or allocate charges to individual Conversations or Tool Calls.
- 03.2
Continue with
/guides/observe-and-govern/costsfor the cost reporting walkthrough.