---
title: "Costs and Spend Attribution | Agent Barn"
canonical: "https://agentbarn.dev/guides/costs-and-spend-attribution"
pubDate: "2026-08-25T00:00:00.000Z"
updatedDate: "2026-08-29T16:41:32.000Z"
author: Agent Barn
description: "Read organization and Agent spend correctly, including attribution, access checks, status labels, and deleted history."
tags: [Product guide, Organization administrators and Agent viewers, Agent Barn]
categories: [Guides]
---

# Costs and Spend Attribution

The Costs domain queries LiteLLM at read time and joins reports to Agents by per-Agent key identity. It does not persist cost records or calculate spend from conversations and Tool Calls.

## Guide details

- Reference: GD-08
- Type: Product guide
- Audience: Organization administrators and Agent viewers

## How attribution works

Agent Barn decrypts each per-Agent LiteLLM key, derives its identity, and joins that identity to the LiteLLM spend report. Responses aggregate total, model, daily, and per-Agent spend. Agents without a LiteLLM key are omitted from summaries.

## Access rules

Organization summaries require the Organization `cost.read` Permission, normally held by Owner/Admin. Per-Agent detail requires `cost.read` through effective Agent authority; Viewer, Editor, and Owner can read costs for accessible active Agents. Agent Access never authorizes an Organization-wide summary.

## History and status

Organization summaries retain attribution for soft-deleted Agents. Owner/Admin may read deleted-Agent history. Cost-facing status is active, stopped, error, or deleted and is separate from the persisted Agent lifecycle enum. An Agent without a key returns zero-valued detail with stopped status.
