# How to track LLM cost in LiteLLM > LiteLLM's response is already openai-shaped, so Culpa's adapter passes it through nearly verbatim. It also doubles as an import format for history. URL: https://getculpa.com/track-llm-cost-litellm Last reviewed: 2026-08-02 ## Answer Culpa's LiteLLM adapter is a logger you register on litellm.callbacks, and it carries more of the truth than any other framework path. LiteLLM's own response object is already openai-shaped, so it passes through nearly verbatim rather than being summarised. Culpa, a local-first LLM cost, margin, and forecast ledger, prices that response the same way it prices a call captured on the request path. ## Why this happens Fidelity across capture paths comes down to how much translation happens before the numbers arrive. A framework that invents its own usage shape has to summarise, and summarising loses the fields that set the price. LiteLLM already speaks the shape Culpa normalizes, so there's nothing to collapse, which makes it the path to trust when two of your ledgers disagree. That property is worth knowing before you pick which measurement to reconcile everything else against. ## What this usually looks like - Two capture paths report different totals for the same traffic and nobody knows which to believe. - You've run LiteLLM for months with no cost history behind it. - Historic spend exists only as provider invoices with no feature or customer attached. - A trend line would decide a pricing question and there's no data old enough to draw one. ## Common mistakes - Picking a reference measurement by which number looks best. Why it hurts: The flattering number is usually the one that saw least, and you'll plan against a floor. Do instead: Pick the path that translates least, then reconcile the others against it and the invoice. - Starting your cost history on the day you install a ledger. Why it hurts: You wait months for a trend that already exists in logs you're keeping anyway. Do instead: Export your existing LiteLLM history and import it, so the trend line starts today. - Throwing away provider exports once the invoice is paid. Why it hurts: They're the only record of what you actually spent before you started measuring. Do instead: Keep them. An import can price them later against a dated price book. ## Self-check - List every capture path you're running and note how much each one translates. - Reconcile each against last month's invoice and rank them by how close they land. - Check how far back your LiteLLM logs go. That's how much history you can price today. - Import a single month first and confirm the total matches that month's invoice. - Once it does, import the rest and read the trend rather than the level. ## Six months of history, priced on the day you install (illustrative) A team that's run LiteLLM for six months on GPT-5.4 at real rates of $2.50 per million input and $15.00 output. Volumes below are modelled and grow 5% a month on the input side. Month 1: (180 x $2.50) + (30 x $15.00) = $450 + $450 = $900 Month 6 after 5% monthly input growth: 180 x 1.05^5 = 229.7M input, so (229.7 x $2.50) + (30 x $15.00) = $574.25 + $450 = $1,024.25 Six months of history totals $5,761 priced from logs already on disk The finding isn't the total, it's that input grew 27.6% while output held flat Waiting to accumulate that trend live would have taken six months and cost the same money An import turns six months of logs into a trend line on day one. The trend is the useful part, and it says input is growing and output isn't, which points the next investigation at prompt size. ## Cost figures Every figure carries its confidence and its source. No figure on this site is provider-reported. - $900 to $1,024.25 — modelled monthly spend at the start and end of six months of imported history [estimated] Source: Both endpoints from the teardown arithmetic at real GPT-5.4 rates from the price book, effective 2026-07-02. A range because the volumes and the growth rate are modelled. - 27.6% — modelled input growth across six months with output volume unchanged [calculated] Source: 1.05 to the power of 5 equals 1.2763, from the teardown arithmetic. ## FAQ Q: Why is the LiteLLM path more faithful than other framework adapters? A: Because LiteLLM's response object is already openai-shaped, so Culpa's adapter passes it through nearly verbatim instead of rebuilding it from summarised token counts. Less translation means fewer fields lost on the way. Q: Can I import LiteLLM history rather than only capturing live? A: Yes. A LiteLLM export is one of the accepted import formats, alongside provider usage exports, other observability exports and plain CSV. Culpa prices imported history with its own price book, so old calls get the rates that applied then. Q: Does registering the logger risk my completion calls? A: No. Both hooks swallow their own failures, so a problem inside Culpa can never break a completion. That fail-open contract is deliberate and it applies across every capture path. ## Sources - OpenAI API pricing: https://developers.openai.com/api/docs/pricing Run the free Cost Leak Scan: https://app.getculpa.com/scan?source=pseo&slug=track-llm-cost-litellm&cluster=integration Machine-readable index of every guide: https://getculpa.com/api/pages Human-readable index of every guide: https://getculpa.com/guides Site overview: https://app.getculpa.com/llms.txt Privacy: Culpa runs on your infrastructure. Your prompts and responses never leave it. Culpa counts calls to run your plan, and it fails open, so if it ever breaks your app keeps running.