Observe and govern
Concept Available

Costs and Spend Attribution

Background synchronization stores model-call costs attributed to Agents and Organizations. Reports read retained records, including recovered OpenRouter charges, with separate Organization, Agent, and Platform access boundaries.

For
Organization administrators and Agent viewers
On this page
  1. Stored model-call costs
  2. Historical records
  3. Reporting access and boundaries
01

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.

  1. 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.

  2. 01.2

    LiteLLM spend logs → synchronization and attribution → cost_record → authorized reports. OpenRouter generation charges → missing-cost recovery → cost_record.

02

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.

03

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.

  1. 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.

  2. 03.2

    Continue with /guides/observe-and-govern/costs for the cost reporting walkthrough.

Documentation