Home / Companies / Braintrust / Blog / Post Details
Content Deep Dive

How to track LLM costs (2026): A playbook for per-user, per-feature, and per-agent-run attribution

Blog post from Braintrust

Post Details
Company
Date Published
Author
-
Word Count
2,845
Language
English
Hacker News Points
-
Summary

LLM cost tracking becomes problematic when relying solely on provider invoices, as these do not explain the specifics of spending increases, such as which customer or feature caused it. To address this, request-level attribution is suggested, where every model call includes metadata linking costs to users, features, and workflows, facilitating better decision-making regarding product, pricing, reliability, and margins. The text outlines methods for connecting LLM spend to request metadata, creating cost rollups, normalizing spend across providers, and implementing alerts, caps, and kill switches to manage costs effectively. It emphasizes the importance of tagging requests at the call site to maintain context and prevent the need for post-hoc log parsing. Moreover, the Braintrust platform is highlighted for its ability to connect cost, traces, eval scores, and release gates, enabling cost reductions to be evaluated for their impact on quality and latency before production implementation. The document further discusses enforcing cost limits through alerts and caps, ensuring cost-saving changes do not degrade output quality, and making informed decisions on cheaper model deployments without compromising production thresholds.