Most organizations cannot explain their largest LLM cost spike until the invoice arrives. By then, the expensive feature is already in production, and engineering teams are reacting to overspend rather than preventing it.
The reason is often a lack of cost attribution. Without it, teams cannot trace spending to the feature, team, prompt change, model upgrade, or deployment responsible for the increase.
This guide gives you a 30-minute audit methodology, a tool comparison, and a framework for turning that one-time audit into ongoing monitoring.
KEY TAKEAWAYS
LLM pricing has moved from flat per-token rates to layered models: usage tiers, committed-spend discounts, and provider-specific token types billed differently. Anthropic discounts cache reads by 90% but applies a 25% premium on the initial cache write — a detail often left out of savings estimates.
Reasoning tokens (o-series, GPT-5.x, Gemini “thinking,” Claude extended thinking) bill at the same rate as standard output — there’s no separate higher price tier. What drives up the bill is volume: a model can generate several times more reasoning tokens than the visible answer requires.
Your total spend is a function of model mix, caching behavior, retry patterns, and token-type distribution — not simply tokens × price. The main cost drivers:
Bills are unpredictable because spend is unattributed and token usage stays opaque until the invoice arrives. Provider dashboards show totals, not attribution — without request-level tagging and trace-level ownership, you can’t trace a spend increase back to a customer, feature, prompt change, or agent run
The minimum useful contract on every request: trace_id, owner_team, workflow_id, feature, and a non-PII user or tenant handle. If a field will be needed for chargeback review, it has to exist before the first gateway hop — not be reconstructed afterward.
Forecast = Baseline spend × (1 + expected growth) × (1 − planned efficiency gains), where baseline is average daily or weekly spend by feature and model, growth is expected traffic or rollout impact, and efficiency covers planned optimizations like caching, model routing, or prompt compression. Update monthly against actuals.
| Tool | Token Compression | Real-Time Dashboards | Team-Level Attribution | Best For |
|---|---|---|---|---|
| Lineman | ✓ (vendor claims 40%+ reduction — unverified independently) | ✓ | ✓ | Coding-agent workflows needing compression plus visibility |
| OpenLLMetry | ✗ | ✓ (via backends) | ✓ | Teams already standardized on OpenTelemetry |
| LiteLLM | ✗ | ✓ | ✓ (via API keys) | Multi-provider proxy with per-key budgets |
| Langfuse | ✗ | ✓ | ✓ | Application-level tracing and prompt versioning; self-hostable |
| Helicone | ✗ (caching only) | ✓ | ✓ | Request logging with caching for repeat prompts |
| Braintrust | ✗ | ✓ | ✓ | Cost, eval, and trace integration for release gates |
| Pezzo | ✗ | ✓ | ✓ | Open-source, self-hosted — verify current maintenance activity before adopting |
| FinOps LLM | ✗ | ✓ | ✓ | Dedicated LLM FinOps platform with cross-provider anomaly detection |
| Step | Tool needed | Time | Output |
|---|---|---|---|
| 1. Gather billing data | Provider dashboards/APIs | 5 min | Raw CSV/JSON per provider |
| 2. Normalize tokens | Spreadsheet or script | 5 min | Cost-per-request table |
| 3. Split token types | Provider APIs with token breakdown | 5 min | Input/output/cache/reasoning split |
| 4. Attribute to teams | API key mapping or metadata | 5 min | Team-to-feature cost matrix |
| 5. Identify top drivers | Sort/spreadsheet | 3 min | Ranked list of cost patterns |
| 6. Cost-per-task | Task count from app logs | 5 min | Unit economics per workflow |
| 7. Set up alerts | Provider billing alerts + dashboard | 2 min | Anomaly detection active |
Running this audit gives you cost visibility, spend attributed to teams and features, and alerts that catch anomalies early — the prerequisites for optimization you can’t do without measurement first.
Once cost is integrated into system design from day one rather than discovered after launch, AI stops being a runaway corporate expense and starts behaving like any other mature component in the tech stack — exceptionally powerful where it fits, ruinously expensive where misapplied, and valuable when governed with discipline.
Marcin Marczyk
Delivery Director, Addepto
Optimizing LLM spend is often treated as a model-layer problem — pick a cheaper model, tune a prompt, enable caching. But the cost drivers in this audit sit at the boundary between the model call and the surrounding application: context compounding, retry storms, and tool-output bloat are architectural issues, not prompting issues.
Practitioners increasingly frame this as a three-function problem, and warn that assigning it to a single function is a primary reason cost-optimization efforts fail:
Whether “LLM-specific expertise” deserves recognition as a fourth, distinct skill is contested, not settled. Some practitioners treat prompt and context design — tool contracts, output schemas, eval design — as a specialized skill alongside software engineering; others argue it’s an extension of requirements engineering, fully absorbed into existing roles. What’s not contested: someone on the team needs deep familiarity with token pricing tiers, cache mechanics, and provider-specific behavior — without that, a technically correct architecture can still misdiagnose where the money is going.
LLM cost optimization fails when it’s treated as one person’s part-time responsibility. The actual levers — routing and retry logic, tagging and attribution infrastructure, and budget governance — sit in different functions with different access and incentives.
A first-pass audit takes about 30 minutes: gather billing data, normalize token counts, split by token type, attribute spend to teams and features, rank the top cost drivers, calculate cost-per-task, and set alerts.
Because spend is unattributed and token usage stays opaque until the invoice arrives. Provider dashboards show totals, not attribution — without request-level tagging and trace-level ownership, you can’t trace a spend increase back to a customer, feature, prompt change, or agent run.
At minimum: a trace ID, owner team, workflow ID, feature name, and a non-PII user or tenant handle. These fields need to exist before the first gateway hop, not be reconstructed afterward during a chargeback review.
Output tokens and reasoning tokens. Output tokens typically cost 4–8x more than input tokens, and reasoning-mode calls can generate several times more hidden tokens than the visible answer requires — at the same per-token rate as standard output.
Category:
Discover how AI turns CAD files, ERP data, and planning exports into structured knowledge graphs-ready for queries in engineering and digital twin operations.