The guides
Every Culpa guide
171 guides on finding, attributing and forecasting LLM spend. Every cost figure on this site carries its confidence and its source.
Cost problems and diagnostics
Agent fan out cost, and why one request becomes thirty calls
An agent turns one user request into many model calls, and cost grows with steps rather than requests. How to price agent fan out before it ships.
Why the cap you set doesn't cap what an agent spends
Anthropic states max_tokens doesn't bound a turn's spend in a tool loop. A ten-step turn under a 4,096 cap costs $1.02 on Opus 5, not $0.10.
How to put AI spend in front of a board without it becoming a line item
A model bill isn't a board metric. Gross margin falling 76.0% to 66.4% on 40% cost growth is, and both describe one quarter cut two ways.
The AI cost questions an investor diligence process actually asks
Investors test whether unit economics hold at scale. In a modelled book the top 10% of customers cost 13.5 times the rest, and few founders know it.
Putting an AI line in next year's budget
Budgeting twelve months at today's run rate ignores dated rate changes. Claude Sonnet 5's rise on 2026-09-01 puts a modelled year 33.3% over.
Why an Anthropic bill spikes when nothing else changed
An Anthropic bill spike with flat traffic usually means cache writes. A write costs more than plain input, so a cache nobody reads is a surcharge.
Context creep cost, the increase nobody shipped on purpose
Context creep is the slow growth of prompt size across releases. It raises cost per call with no traffic change. How to measure and cap it.
What to do when a conversation outgrows its context window
When a conversation outgrows its window you truncate or summarise. A modelled summarise costs $0.20 once and saves $0.16 on every call after.
What an AI support conversation costs, and what decides whether it pays
Anthropic puts 10,000 support conversations at about $37.00 on Haiku 4.5. That's the floor. Escalation rate is the multiplier that decides whether it pays.
What exchange rates do to AI margin when you don't price in dollars
Providers bill in USD. If you price in another currency, a modelled move from 1.10 to 0.90 takes 6.06 points off gross margin with no usage change.
What a failed LLM call actually costs
A failed call bills for every token generated before your code gave up. Timeouts, cancelled streams and rejected output all cost. The math, shown.
What a fine-tune costs against the base model you gave up
OpenAI is winding down fine-tuning and lists no GPT-5 model as fine-tunable. Tuned gpt-4.1-2025-04-14 beats base gpt-5.4 only below a 6:1 ratio.
Free tier abuse, priced per signup
Free tier abuse is scripted signups consuming a full allowance at maximum cost per call. One can cost what a hundred genuine trials do.
What your free trial costs in model spend, per customer acquired
Trial compute buys customers, arrives on a provider invoice, and almost never reaches the CAC number. At 8% conversion it can be $52.50 per customer.
Why a Gemini bill spikes when the prompt gets a little longer
A Gemini bill spike with flat traffic often means prompts crossed 200,000 tokens, where input doubles and output rises by half. Worked math inside.
Granular LLM cost attribution, and where every tool stops
Every cost tool stops somewhere: agent, session, key, invoice. Below that floor the split was never recorded, so no query recovers it later.
What it costs to check every request, and why that share moves
A safety check costs the same whatever it protects. Beside Opus 5 that's 2.4% of the call, beside Haiku 4.5 the identical check is 12.2%.
The AI costs that accrue when you make no calls at all
A held Gemini cache costs $144 a month at zero calls. An always-on 64 GB container costs $4,147.20. Call-based tools can't see either.
What an image actually costs, and why it moved when you changed model
Claude charges no per-image fee. An image costs ceil(w/28) x ceil(h/28) visual tokens, and the same 4K image costs 3.07 times more on newer models.
Input token creep, the increase no single release explains
Input token creep is a small monthly rise across your whole workload. No single change looks big, and twelve of them compound to 60%. Math inside.
Whether your AI bill is normal, and why nobody can tell you
Anthropic publishes a $0.705 coding session and a $0.0037 support conversation. Both are real, both are theirs, and neither answers your question.
Costing the arms of an LLM A/B test
Experiment arms differ in unit cost by multiples, not percentages. Tools that show it call it estimated. Margin per variant needs the revenue side too.
Accruing LLM spend you have incurred but not been billed for
Finance closes on the 30th and the provider invoice lands later. Accruing from last month under-booked a modelled growing service by 28.6%.
LLM cost anomaly detection, and why the total hides the anomaly
A customer tripling can be 0.2% of your total. An alert watching the total will never fire on it, whatever model sits behind the alert.
Working out what a given number of users costs
A modelled user at 0.5M input and 0.1M output costs $1.00 a month on Haiku 4.5. A hundred of them costs $100.00, and the per-user figure is the one to watch.
Charging LLM spend back to the team that spent it
Charging AI spend back by headcount is a guess. In the modelled split it undercharged the heaviest team by $11,400 a month out of $24,000.
LLM cost forecast calculator
Project next month's LLM spend from your own three months, as a range. Exact decimal arithmetic, computed in your browser, with the method shown.
How to see LLM cost in Datadog
Datadog tracks LLM cost in two places that don't meet. One prices calls in real time, the other ingests your OpenAI invoice and forecasts it.
How to see LLM cost in Dynatrace
Dynatrace AI Observability assesses token cost and says it predicts cost increases. That's an alert with foresight, which is different from a projection.
How to see LLM cost in Grafana
Grafana Cloud does per-agent cost attribution in USD, which is more than most LLM-native tools. It also meters your use of its own AI assistant in tokens.
How to see LLM cost in New Relic
New Relic AI Monitoring tracks token usage, and its pricing bills ingest per GB. So richer LLM traces raise a second bill your provider never sends.
Attributing an LLM cost change to the deploy that caused it
A release can raise cost per call 15% while the monthly total rises 3.5%, because traffic moved too. Tag the release or you'll never separate them.
Why your LLM cost spikes after a launch
A launch spike is rarely just traffic. Free-tier users, curiosity sessions and unbounded retries drive it. How to forecast and cap the next one.
LLM eval job cost, the spend with no customer attached
Evaluation runs bill like production but serve no customer. Why eval spend hides, how to price a run, and how to cut it without losing coverage.
LLM fast mode pricing, and what it excludes
OpenAI renamed priority processing to Fast mode and bills it at double, except gpt-5.5 at 2.5x. Anthropic's is 2x on two models and blocks batching.
LLM model mix drift, and why the bill moved without a deploy
Model mix drift is traffic quietly shifting toward pricier models. Volume holds, the bill climbs. How to detect it and price the shift.
LLM observability consolidation, and what it does to your cost history
Six named LLM observability tools are no longer independent. Each verified on 2026-08-03 against the company's own statement or its acquirer's.
LLM pricing modifiers, and how they combine
Caching, batching, fast mode and data residency each move the rate. Some multiply together, one pair is mutually exclusive. The published rules, in one place.
What an LLM retry loop actually costs
A retry loop bills every attempt, including the ones that produced nothing you kept. How to price your retry waste and cap it, with worked math.
Capturing token usage from a streaming response
Anthropic's own streaming example reports 2,679 input tokens at the start and 10,682 at the end of one request. Read the first and you miss 74.9%.
When a tokenizer change raises your bill and the rate card doesn't move
Claude 4.7 and later tokenize the same text into about 30% more tokens. The rate card never moves, so the increase is invisible until the invoice.
What a million-token context window actually costs to use
Anthropic bills a 900k-token request at the same rate as a 9k one. Same rate, a hundred times the tokens, and $4.50 a call on Opus 5.
What a model upgrade does to an unchanged workload
A model upgrade cost increase is the same workload at a different rate, and it can happen without you changing anything. Worked math inside.
Pricing a multi-agent system run by its step count
A modelled agent step costs $0.0240 on Sonnet 5. Three steps is $0.0720 and twenty is $0.4800, and the step count is decided at runtime.
How to track cost across a multi-agent system
A supervisor delegating to three workers sends the same context four times. The fan-out is multiplicative and it only shows up per call.
What tenancy does to LLM cost, and to prompt caching in particular
One shared system prompt gets cached once per tenant. At 100 tenants a modelled cache bill goes from $36.00 a month to $3,600.00 for the same text.
Why an OpenRouter bill spikes when your code didn't change
An OpenRouter bill spike on flat traffic usually means a different upstream provider served your calls. Same model, about 10% more per token.
Output token creep, and why your input metrics miss it
Output token creep raises cost while input stays flat, so prompt-size monitoring shows nothing. Output bills 5x to 8x input. Worked math inside.
Forecasting LLM cost per customer, not just in total
An aggregate forecast can be right while every customer inside it moves the wrong way. Forecasting per customer turns a projection into a decision.
Working out how much usage a subscription tier can carry
A monthly price meets per-user usage, and only one has a ceiling. At 80% target margin a modelled $29 tier affords 527 calls, not unlimited.
Whether to pin a model version, and what each choice costs
Anthropic lists deprecated Opus 4.1 at $15/$75 against Opus 5 at $5/$25. Staying pinned to the old model costs exactly three times as much.
Why the pilot said it was cheap and production disagreed
A demo's cost per call is the figure everyone extrapolates and the one that changes most. A modelled forecast lands 78% under at production scale.
Power user AI cost, and the workflow hiding inside it
Power user AI cost is usually one workflow, not general enthusiasm. How to decompose your heaviest account and find the loop inside it.
What a prompt cache miss costs you
A prompt cache miss bills your repeated tokens at full rate, and on some providers a cache write costs more than input. The math, and the fix.
Tracing a cost increase back to the prompt version that caused it
A prompt version cost increase shows up as a step change on one date with flat volume. How to bisect it back to the edit, with worked math.
What it costs to move models, beyond the rate card
Anthropic's newer tokenizer produces about 30% more tokens for the same text. A cost model built on token counts doesn't survive the move.
RAG context cost, where retrieval settings become a bill
RAG context cost is top-k multiplied by chunk size on every call. Retrieval settings set your input bill more than your prompt does.
What a credit costs you when the customer decides what it buys
A credit is a fixed price against a variable cost. The same 10-cent credit modelled at 94.5% margin for a light user and 45.0% for a heavy one.
Finding the AI spend that never reached your AI budget
Forty staff on personal AI subscriptions is $9,600 a year that never appears in the AI budget, and it leaves through expenses instead.
What transcription costs, and why tokens don't help you estimate it
Transcription bills per minute of audio, so silence costs full price. Rates run $0.003 to $0.034 a minute, an 11.33x spread on the same hour.
What an interrupted response costs once you've resumed it
Resuming an interrupted response re-sends what you already generated as input. A modelled interruption at 80% costs 23.6% more than a clean run.
What extended thinking costs, and why the number you see is smaller
Reasoning bills as output even when hidden, and the visible count doesn't match the billed one. Changing effort mid-conversation costs 12.5x a cache read.
Tool definition token cost, billed whether the tool runs or not
Tool schemas are input tokens billed on every call, whether the model uses them or not. How to price your tool block and trim it safely.
Unattributed LLM spend, and why it keeps growing
Unattributed spend is every dollar your breakdown can't assign to a feature or customer. Why it grows, and how to drive it toward zero.
What local-first LLM observability means, and what it doesn't
Eleven of twelve LLM tools publish self-hosting. Local-first is a deployment decision set by your requirements, and it settles less than it sounds.
Reducing LLM spend in the order that actually works
On a modelled $22,500 month, moving model saves 80% and caching saves 30%. Almost everyone does the caching first because it feels safer.
Why did my OpenAI bill go up?
Your OpenAI bill went up for one of four reasons: more calls, longer calls, a pricier model, or retries. How to tell which one, with the math.
Pricing and margin
AI COGS, and what actually belongs in it
An AI COGS calculator totals model spend, retries and cache behaviour per customer. What belongs in cost of goods sold, and what doesn't.
An AI SaaS gross margin calculator, and the inputs it needs
An AI SaaS gross margin calculator needs four inputs, and most teams guess three. Margin computed blended, per tier and per customer, with math.
Setting an AI usage cap that binds the right accounts
An AI usage cap calculator sets the ceiling from your 90th-percentile account, not the average. How to pick a cap that binds the tail and nobody else.
How to price an AI SaaS product on real unit costs
How to price an AI SaaS product: start from your 90th-percentile customer cost, not the average, and cap what sits beyond it. Worked math inside.
Pricing a credit-based AI plan so a credit covers what it buys
A credit-based AI plan only works when one credit maps to bounded spend. Why flat credits break on uneven actions, with worked math.
Pricing a per-seat AI product against uneven seat usage
Per-seat pricing decouples revenue from usage until seats stop looking alike. Why dormant seats fund power seats, and what activation does.
Pricing a usage-based AI product on a markup you can defend
Usage-based pricing passes model cost through, so the markup is the whole decision. Why a markup on accepted spend under-recovers, with math.
Pricing an unlimited AI plan against a tail you haven't measured
Pricing an unlimited AI plan means pricing against a maximum nobody has measured. What unlimited really costs, and the safer alternatives.
Provider cost
Anthropic API cost and the cache-write charge
Anthropic API cost runs $1.00 to $10.00 per million input, with every model at exactly 5x output, and it charges to create a cache as well as read one.
Gemini API cost and why output length dominates
Gemini API cost runs $0.25 to $2.00 per million input, with output spreads up to 8.3x. Why answer length is the lever on this provider.
Groq API cost and the flattest output ratios anywhere
Groq API cost runs $0.05 to $1.00 per million input, with output ratios as flat as 1.34x. Why the usual cost advice stops working here.
OpenAI API cost across the whole model line
OpenAI API cost runs from $0.20 to $30.00 per million input tokens, a 150x spread. Why model choice matters more here than on any other provider.
OpenRouter API cost, where one model has several prices
OpenRouter routes one model to several upstream providers at different prices. The same Opus call bills $5.00 or $5.50 depending on who served it.
Optimisation playbooks
Batch processing cost optimization
OpenAI, Anthropic and Gemini all bill batch at half price. Caching stacks on top of it on a best-effort basis, which can invert the saving.
Context window cost optimization
One token past Gemini's 200k boundary doubles the input rate and lifts the output rate by half. The whole prompt reprices, not the excess.
Prompt cache cost optimization
A cache write costs 1.25x input and a read costs 0.1x, so caching pays from the second call inside the window. Volume isn't the variable.
Model pricing
Claude Fable 5 pricing and the cost of a cache write
Claude Fable 5 pricing is $10.00 per million input and $50.00 output, matched by Claude Mythos 5. The top Anthropic tier and what a cache write costs.
Claude Haiku 4.5 pricing at a million calls a month
Claude Haiku 4.5 pricing is $1.00 per million input and $5.00 output, with cached reads at $0.10. The million-call tier where small errors get large.
Claude Opus 4.8 pricing, and why the same rate isn't the same cost
Claude Opus 4.8 pricing is $5.00 per million input and $25.00 output, matching Opus 4.5 to Opus 5. The rate is identical. The token count isn't.
Claude Sonnet 5 pricing, and the rate change on 2026-09-01
Claude Sonnet 5 pricing is $2.00 per million input and $10.00 output on an introductory rate that ends 2026-08-31, rising 50% to $3.00 and $15.00.
DeepSeek V4 Flash pricing on OpenRouter
DeepSeek V4 Flash bills $0.14 per million input and $0.28 output through OpenRouter. A routed rate can change without an invoice line telling you.
Gemini 2.5 Flash pricing and the eight-to-one output spread
Gemini 2.5 Flash pricing is $0.30 per million input and $2.50 output, an 8.3x spread. Why answer format is the whole optimisation here.
Gemini 2.5 Pro pricing for long-context work
Gemini 2.5 Pro pricing is $1.25 per million input and $10.00 output, the widest output spread in this price book at 8x. Long-context math inside.
Gemini 3.1 Flash-Lite pricing, and the cost of calling it first
Gemini 3.1 Flash-Lite pricing is $0.25 per million input and $1.50 output. Put it in front of every request and it earns out above 2.2% diversion.
Gemini 3.1 Pro Preview pricing, and the date nobody wrote down
Gemini 3.1 Pro Preview pricing is $2.00 per million input and $12.00 output. Preview rates move, so a forecast pinned to one ages fastest.
Gemini 3.5 Flash pricing, and why the version bump costs
Gemini 3.5 Flash pricing is $1.50 per million input and $9.00 output, five times Gemini 2.5 Flash on input. A version bump here multiplies the bill.
GPT-5.4 mini pricing, and where the saving disappears
GPT-5.4 mini pricing is $0.75 per million input and $4.50 output, about a third of GPT-5.4. Where it saves money and where volume eats the saving.
GPT-5.4 nano pricing, and the ladder it sits at the bottom of
GPT-5.4 nano pricing is $0.20 per million input and $1.25 output, 150x below the Pro tier. The widest cost decision sits inside one vendor.
GPT-5.4 pricing, and what it really costs per month
GPT-5.4 pricing is $2.50 per million input and $15.00 output, verified 2026-07-02. Output bills 6x input, with worked monthly math.
GPT-5.4 Pro pricing, and the missing cached rate
GPT-5.4 Pro and GPT-5.5 Pro both bill $30 per million input and $180 output, with no cached rate. What that means for repeated prompts.
GPT-5.5 pricing, and when the premium earns itself
GPT-5.5 pricing is $5.00 per million input and $30.00 output, exactly double GPT-5.4. When the premium earns itself, with the break-even math.
GPT-5.6 Luna pricing at high call volume
GPT-5.6 Luna pricing is $0.20 per million input and $1.20 output, the cheapest OpenAI tier. Why volume, not rate, decides what it costs you.
GPT-5.6 Terra pricing against the model it replaces
GPT-5.6 Terra pricing is $2.00 per million input and $12.00 output, undercutting GPT-5.4 by 20% on both sides. The migration math, worked.
Llama 3.1 8B pricing, and the waste that hides behind it
Llama 3.1 8B pricing on Groq is $0.05 per million input and $0.08 output. At that rate a call rounds to nothing and volume becomes the whole bill.
Llama 3.3 70B pricing, and why the usual advice fails here
Llama 3.3 70B pricing on Groq is $0.59 per million input and $0.79 output, a 1.34x ratio. Why shortening answers barely moves this bill.
Kimi K2 pricing, and the discount most teams leave unclaimed
Kimi K2 pricing on Groq is $1.00 per million input and $3.00 output, with a cached read at half the input rate. On agent traffic that's a quarter off.
GPT-OSS-120B pricing, a clean two-to-one ladder
GPT-OSS-120B pricing on Groq is $0.15 per million input and $0.60 output, exactly double the 20B at every rate. So the only question is quality.
GPT-OSS-20B pricing, and a cache that pays half as well
GPT-OSS-20B pricing on Groq is $0.075 per million input and $0.30 output. Its cached rate is about half input, not the 90% discount you expect.
Qwen3.6 27B pricing, and a costly pairing
Qwen3.6 27B pricing on Groq is $0.60 per million input and $3.00 output. A reasoning-tuned model on a 5x spread with no cached rate to fall back on.
Tencent HY3 Preview pricing on OpenRouter
Tencent HY3 Preview bills $0.063 per million input and $0.21 output on OpenRouter. Pricing a preview model into unit economics carries a specific risk.
Culpa compared
Culpa vs AgentWatch
AgentWatch blocks a spiralling agent at its gateway and keeps forensics there. Culpa runs on your infrastructure and adds margin and a forecast.
Culpa vs Arize
Arize AX meters spans and ingestion volume with 15-day retention on its free tier. Culpa prices calls in exact decimal and forecasts the month.
Culpa vs Athina
Athina's own pricing link returned a 404 on 2026-08-03 and no price appears across its site. Culpa publishes its rate book and forecasts your spend.
Culpa vs Braintrust
Braintrust bills a platform fee plus model credits, processed data and scores. Culpa prices your model spend and forecasts it. Two different bills.
Culpa vs Helicone
Helicone was acquired by Mintlify and says its services now sit in maintenance mode. What that means for your cost decision, and the question Culpa answers.
Culpa vs Humanloop
Humanloop closed on 2025-09-08 and deleted account data that day. Its cost model is still documented, and worth reading before you pick a replacement.
Culpa vs Langfuse
Langfuse is MIT-licensed, self-hostable and has joined ClickHouse. Culpa is neither more open nor more private. The difference is margin and forecast.
Culpa vs LangSmith
LangSmith self-hosts on its Enterprise plan so traces never leave your infrastructure. What decides is margin against revenue and a forecast, not privacy.
Culpa vs Literal AI
Literal AI shut down on 2025-10-31. It shipped an effective-dated price book you configured yourself. Culpa ships the same shape, maintained for you.
Culpa vs Lunary
Lunary bills per user and per event, and its free tier keeps one month of history. Culpa prices calls from a rate book and forecasts the month.
Culpa vs OpenLIT
OpenLIT self-hosts free under Apache 2.0 and filters by user, session and cost. Culpa adds the revenue each customer pays and forecasts the month.
Culpa vs Polarity
Polarity moves routine work onto a custom model trained in your infrastructure. Culpa measures what that move was worth. They're complements.
Culpa vs Portkey
Portkey sets budget limits and stops requests. Culpa forecasts what next month costs from your own history. Different jobs, and worth running both.
Culpa vs PromptLayer
PromptLayer publishes data retention control on Enterprise only. Culpa keeps the ledger on your own infrastructure, so history is a disk decision.
Culpa vs Raindrop
Raindrop finds silent agent failures and helps fix them. Culpa prices every call and names the conversation behind the spend. Different questions.
Culpa vs Respan
Respan, formerly Keywords AI, sets budgets per customer and blocks overspend. Culpa sets that spend against what the customer pays and forecasts it.
Culpa vs Traceloop
Traceloop meters spans and answers whether output was good. Culpa prices the call and answers whether the customer was profitable. Both, not either.
Model cost comparisons
Gemini 2.5 Flash vs Llama 3.3 70B cost
Gemini 2.5 Flash wins on retrieval work and Llama 3.3 70B wins on chat. They cross at an output-to-input ratio of 0.17. Worked math inside.
Gemini 2.5 Pro vs Gemini 3.5 Flash cost
Gemini 2.5 Pro is cheaper than Gemini 3.5 Flash on input-heavy work. The two cross at an output-to-input ratio of 0.25. The arithmetic, shown.
Gemini 3.1 Flash-Lite vs Llama 3.3 70B cost
These two cross at an output-to-input ratio of 0.48, which sits inside the range real features occupy. Routing per feature beats picking one model.
GPT-5.4 mini vs Kimi K2 cost
GPT-5.4 mini's input rate sits a quarter below Kimi K2's and it still costs more on most workloads. The two cross at a ratio of 0.17.
GPT-5.4 nano vs Llama 3.3 70B cost
GPT-5.4 nano beats Llama 3.3 70B on cost until output nearly equals input. The crossover sits at 0.85, which almost no workload reaches.
GPT-5.6 luna vs Llama 3.3 70B cost
These two cross at 0.95 on short prompts and at 0.19 on long ones, so the cheaper model flips on prompt length rather than on token ratio.
How-to guides
Calculators
LLM API cost calculator
Price any model in the book against your own token volumes. Every figure computes in exact decimal, so a total matches an invoice to the cent.
Model switch cost calculator
Compare two models against your own token mix, with the crossover ratio where they tie. Exact decimal arithmetic, so the totals hold up.
Prompt cache cost calculator
Enter your prefix size and how many calls land inside one window. Below two calls on a five-minute cache, caching costs you money.
Teardowns
Model mix cost teardown, from a real month
A real month, measured. The small model processed more input and twelve times more output than the frontier model beside it, for 55% of the cost.
Prompt cache cost teardown, from a real month
A real month of Anthropic API usage, measured. The account read back only 0.2035 tokens for every one it wrote into a cache, which is below break-even.
A three-month LLM usage trend, measured
Three months of one account's Anthropic token usage, measured. Daily volume ran 100, 199 then 18 and caching came and went. One month explains nothing.
Integration guides
How to track LLM cost on Anthropic
Anthropic sends streamed usage across two events and charges to create a cache. What Culpa records, and where it deliberately takes a floor.
How to track LLM cost on Gemini
Gemini can be reached through its native API or an OpenAI-compatible endpoint. The two carry usage in different fields, so check which yours uses.
How to track LLM cost on Groq
Open-weight model lineups move fast, so a price book lags. What Culpa records for a model it has no rate for, and why a visible zero beats a guess.
How to track LLM cost in LangChain
Culpa's LangChain adapter is a callback handler that reports the framework's own token counts. An honest floor, and how to measure what it misses.
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.
How to track LLM cost for Ollama and local models
A local model sends no bill, so its cost is invisible rather than absent. How to price Ollama traffic against what the same tokens would have cost.
How to track LLM cost on OpenAI
A streamed OpenAI call carries no token usage unless you ask for it. What that leaves in your ledger, and the one flag that turns it back on.
How to track LLM cost on OpenRouter
A router can serve a different model than you requested. Culpa prices the model that actually answered, which is the only figure that matches the bill.
How to track LLM cost in Python
Culpa's Python SDK reports the raw provider response to a local server. Your API key never travels, only a fingerprint, and capture adds no tokens.
How to track LLM cost in TypeScript
Culpa binds to localhost, so a cloud-hosted TypeScript app has no route home. What that leaves unattributed, and how a relay closes it.
How to track LLM cost in the Vercel AI SDK
Culpa's Vercel AI SDK middleware wraps generate calls. Streaming is out of scope for now, so a chat product captures a fraction of its own spend.
attribution
How to track LLM cost by agent step
Providers bill per call and agents fail per run. Carrying a trace id through every hop is what turns one into the other. Worked example inside.
How to track LLM cost by API key
Key-level attribution needs no code change, which is why everyone starts there. It stops working the moment one key serves more than one customer.
How to track LLM cost by prompt version
Without a version on every call, a prompt edit and a price change look identical in the total. Tagging the version is what separates them.
How to track LLM cost by tool call
A tool that calls a model bills twice, and the second call usually lands on the tool rather than the request that triggered it. How to attribute both.
Metrics and definitions
What is a deep trace?
A deep trace opens one conversation down to the prompt. That's a scarce forensic unit, so aim it at the top of the cost distribution, not at alerts.
What is a tracked call?
A tracked call is one metered event, and a big call costs more than a small one. The meter counts work rather than requests. The arithmetic, shown.
What is a blended rate?
A blended rate is your average cost per token across every model you run. Useful for forecasting, dangerous for optimisation. Worked example inside.
What is LLM cost attribution?
LLM cost attribution links each dollar to the call, conversation, feature and customer behind it. Why it has to happen at request time, not in reporting.
What is a cost cross-check?
A cost cross-check compares your own calculated figure against the provider's reported one, with a tolerance small enough to catch a wrong rate.
What is a cost floor?
A cost floor is the lowest defensible figure for a call, recorded when part of the input is absent and flagged rather than estimated into completeness.
What is cost per agent?
Cost per agent is the total spend for one autonomous run, including sub-calls, tool steps and retries. Why one run is a tree, with worked math.
What is cost per agent step?
Cost per agent step rises as a run goes on, because each step resends the transcript before it. Why doubling steps more than doubles spend.
What is cost per conversation?
Cost per conversation is the total model spend for one full exchange, retries and tool calls included. Definition, the arithmetic, and how to measure it.
What is cost per customer?
Cost per customer is model spend attributed to a paying account, not to one person inside it. Why seat growth breaks the per-user view, with math.
What is cost per feature?
Cost per feature is model spend grouped by the product surface that triggered it. Why provider data can't produce it, and how to tag calls so it can.
What is cost per prompt version?
Cost per prompt version splits model spend by which revision served the call. Why a prompt edit is a pricing decision, with worked math.
What is cost per user?
Cost per user is model spend divided by active users, and the average lies. Why the 90th percentile sets your pricing floor, with worked math.
What is effective cost?
Effective cost is your real blended rate per token after caching, retries and failed calls. Why it always runs above the list price, with worked math.
What is forecast accuracy?
Forecast accuracy needs both a median error and whether reality landed inside the band. Either one alone can make a useless forecast look good.
What is gross margin per customer?
Gross margin per customer is revenue minus what that customer costs you in model spend. How to compute it per account and why averages hide losses.
What is an LLM burn forecast?
An LLM burn forecast projects model spend forward from your own usage curve. What makes one credible, and the three inputs teams usually get wrong.
What is prompt cache hit rate?
Prompt cache hit rate is the share of input tokens billed at the cached rate. Why a low rate wastes money and a high write rate can cost more.
What is token accounting?
Token accounting is tracking input, output and cached tokens per call and pricing them exactly. Why rounding and float math corrupt LLM cost data.
How Culpa works
Find the culprit. Not just the total.
Your dashboard shows what you spent. It stops short of who spent it. Culpa shows the conversation, the user and the feature behind it.
Your prompts stay local.
Culpa runs on your own infrastructure. What you send to a model reaches us at no point.
Every dollar has a name.
Follow any charge to the conversation, the user, the feature and the customer behind it.
See the bill before it lands.
Cost your next feature before you ship it. You get the likely bill and the worst case, at best, median, p90 and p99.
Three steps to your first answer.
Change one base URL.
Or drop in the Python or TypeScript library.
Find your most expensive conversation.
In the first session, not the first week.
Cost your next feature before you ship it.
Why the bill went up
Example dashboardCalls traced
418,209
across 3 projects
Spend this week
$378.41
+ $182 vs last week
Failed calls
312
74% retried, and you paid for all of them
+ $182 this week traced to one culprit
Spend over 14 days
Most expensive users
Next week forecast
Graded against reality. Accuracy shown as results land.