Guides / track llm cost openrouter
How to track LLM cost on OpenRouter
A routing layer can answer with a different model than the one you requested, so pricing the request rather than the response produces a number that matches nothing. Culpa, a local-first LLM cost, margin, and forecast ledger, reads the model the response says served the call and prices that one, which is the only version of the arithmetic your invoice agrees with.
Why this happens
On a direct provider the model you ask for is the model you get, so nobody separates the two ideas. A router breaks that quietly. Availability, fallbacks and routing rules can all put a different model behind your call, and the response says which one answered. A ledger keyed on the request would price a month of traffic against a model that never ran, and it would look internally consistent while doing it, because every row would agree with every other row and none of them with the bill.
What this usually looks like
- Your routed spend disagrees with the invoice by an amount that moves month to month.
- Nobody checks whether the model that answered matches the model requested.
- A fallback is configured and nobody has measured how often it fires.
- Your cost per call shifts without any change to prompts or volume.
Free, no card, no account
Run the free Cost Leak Scan
It shows your most expensive conversation before you install anything.
Mistakes that cost the most
| Mistake | Why it hurts | Do instead |
|---|---|---|
| Pricing routed traffic against the model you requested. | The response can name a different model, and the invoice follows the response rather than the request. | Read the served model from the response and price that. It's the only key the bill agrees with. |
| Leaving a fallback unmeasured. | A fallback that fires often is a pricing change nobody approved and nobody can see. | Count how many calls were served by something other than your first choice, monthly. |
| Assuming routed and direct calls of the same model reconcile identically. | Upstream providers on a router price the same model differently, so the spread lands in your ledger. | Compare your routed cost per call against the direct rate and treat the difference as a decision. |
Run this check tonight
- For last month, count calls where the served model differs from the requested one.
- Check that your cost records key on the model that answered rather than the one you asked for.
- Price the same month both ways. The difference is what keying on the request would have cost you.
- Look at whether your fallback fires on a schedule, which usually means capacity rather than failure.
- Compare your routed unit cost against the direct rate for the same model.
One month priced on the request, and on the response
Illustrative example
1 million routed calls a month, each sending 4,000 input tokens and returning 600. The request names Claude Opus 4.7 at $5.00 and $25.00 per million. A share of the traffic is served by Claude Sonnet 4.6 at $3.00 and $15.00 instead. Volumes and the fallback share are modelled.
A ledger can be perfectly self-consistent and $4,200 away from the bill. On a router the served model is the only key that closes the loop.
Every number, with its confidence and source
| Figure | What it means | Confidence | Source |
|---|---|---|---|
| $30,800 to $35,000 | modelled monthly routed spend priced on the served model against priced on the requested one | estimated | Both endpoints from the teardown arithmetic at real Claude Opus 4.7 and Sonnet 4.6 rates from the price book, effective 2026-07-02. A range because call volume and the fallback share are modelled. |
| $4,200 | modelled overstatement from keying a month of routed cost on the requested model | calculated | $35,000 minus $30,800, from the teardown arithmetic at real price-book rates. |
What a generic answer can’t know
The router knows which upstream served each call and bills you one total for all of them. Which of your features got the fallback, and what that did to their unit economics, needs the served model joined to your own labels. Culpa records both on your infrastructure, keeps your prompts and responses there, and counts the calls to run your plan.
Questions founders ask next
Can OpenRouter serve a different model than I asked for?
A routing layer decides which upstream answers, and the response names the model that did. That's why a ledger has to read the served model rather than trusting the request, and why the two can differ across a month without anyone changing code.
Why does my routed cost per call keep moving?
Two reasons compound. The model that answers can change, and the same model can be served by upstream providers charging different rates. Both move your unit cost without any change on your side unless you pin explicitly.
How do I make routed spend reconcile?
Key every cost row on the model that answered, then compare the monthly total against the invoice. If it still drifts, the remaining gap is usually the price spread between upstream providers serving the same model.
On your infrastructure
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.
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.
Free, no card, no account
Run the free Cost Leak Scan
It shows your most expensive conversation before you install anything.
Keep reading
Sources: OpenRouter models, Anthropic pricing. Last reviewed 2026-08-02. Plain text version.