Skip to content

Task Cost Measurement: The Tool Report Is Not an Invoice

What a tool report really shows, what it hides, and how to turn token and time data into a cost per task you can defend in a quote.

For several weeks, I recorded the cost of tasks from the field that the tool displayed when the work was done. The numbers were consistent, so I trusted them. Then I compared one day with the router’s ledger and discovered that the report overstated the cost dozens of times over. Not because the tokens were wrong. They were real. The problem was the price, taken from a provider’s price list that none of those requests had reached.

Measuring task cost therefore starts with an uncomfortable question: how do I know this number is a bill rather than an estimate? In this post, I will show you:

  • where an overstatement of around fifty times comes from, and why the error can go in both directions
  • the delta method, which reads the meter before and after a task
  • the ledger method, which records every request on the router side
  • how to keep a project cost log without turning it into a two-hundred-row spreadsheet
  • how to compare tasks across models, and what to do about it in a small office

This is the fourth and final part of a series about working with multiple models. The router gives you one place, routing decides who does the work, and measurement tells you what it cost.

Why the numbers in reports lie

The cost field in a tool’s output is not a query to the provider. It is a multiplication the tool does itself: it takes the tokens from the response and applies its own price table. For Anthropic models, the table is correct. When you route the same tool through a router to a different provider, the table stays the same, but the requests go somewhere else.

This is what happened in my case: Claude Code through ccrx, that is, through OpenRouter, with DeepSeek as the final model. The tokens in the report were real because they came from the response. The price came from Anthropic’s table because the tool had no idea who would actually send the bill. I described the setup in the post “Claude for next to nothing: how to use Claude Code through OpenRouter with DeepSeek”.

Let’s calculate one task: two hundred thousand input tokens and thirty thousand output tokens. Anthropic’s price table, at three dollars and fifteen dollars per million, comes to one dollar and five cents for this task. The price list for the model that actually responded, at nine cents and eighteen cents per million, comes to two point three cents. The same run, two figures, a ratio of forty-five to one.

The result depends on the ratio of input to output, because the prices do not differ by the same amount. Input is thirty-three times cheaper, output eighty-three times cheaper. A task that reads a lot and writes little comes out forty-one times more expensive in the report. A task that writes a lot, such as generating code, reaches seventy-eight times. That is where “around fifty times” comes from. It is not a constant, it is a range.

The number you seeWhat it really is
cost in the tool’s outputtokens multiplied by the price table of the provider the tool knows about, not the one that sends the bill
weekly usage from an API keythe total for requests that passed through that key only, excluding traffic that took another route
tokens multiplied by a price list from the weban estimate with no information about cached or reasoning tokens
amount from the router’s ledgerthe amount charged for a request when it was handled

The error does not only go upwards, and that is the part that is easy to miss. A key’s meter shows only traffic through that key. Most of my requests went directly to the model provider, so the total from the API key was two orders of magnitude lower than the actual spend. It looked credible because it was precise. Precision is not the same as accuracy.

A third version of the same mistake is the most common one in spreadsheets: take the tokens from a log and multiply them by a price list from the web. It is the same error with a different author, because it ignores cached tokens and reasoning tokens, which are counted differently from ordinary output.

The report is not lying maliciously. It accurately answers the question of how much this task would cost with the provider whose price list it knows. That is not the question you are asking when you look at a bill.

The delta method: the meter before and after

The first method is as old as the water meter. Read the value before the task, read it afterwards, subtract. You need one meter that increases with spending. In OpenRouter, that is usage at key level, accumulated over the key’s lifetime.

  • Record the meter value before sending the task, together with the time and time zone.
  • Run the task and let it finish, even if it ends with an error.
  • Record the meter value after the last response, in the same time zone.
  • Subtract. The difference is the task cost, including attempts that did not succeed.
  • Add the difference to the log, along with the model that responded and the number of turns.

An example calculation, not my bill. The value before the task is four dollars and twenty cents, and after the task it is four dollars and thirty-eight cents, so the cost is eighteen cents. For a task lasting an hour and thirty turns, this figure also includes two failed attempts and a fallback.

The method has three conditions, and all of them must be met. Otherwise, the result is the sum of two tasks and nobody will notice.

  • The same key. The meter belongs to the key, not the task. If the task used two keys, you measure one and do not know about the other.
  • Nothing else is running. A cron job on the hour or a second agent session adds its usage to the difference.
  • The same time zone. API timestamps are in UTC, while your log is local. A two-hour difference is enough to include someone else’s traffic in the window.

There is also a resolution limit. A task costing a fraction of a cent will show a difference of zero or a jump of one rounding increment. Delta works for costs from a few cents upwards, for one long task and when you are certain nothing else is running in the background. Below that, you measure the task together with neighbouring ones or switch to the ledger.

The ledger method: an entry for every request

The second method does not measure a difference, it reads a record. After every request, the router records a row: which key, provider and model, how many input and output tokens, how many cached tokens, the unit price, the amount charged and when. In OmniRoute, this table is called the request cost ledger.

Its advantages come from not having to subtract. There is no rounding because there is no difference between two rounded numbers. Parallel work does not spoil the result because every request has its own row. You can see which model responded after a fallback. Delta tells you “how much”, while the ledger also tells you “what for”.

The query is short. Take the task boundaries from the work run and sum the amounts in that window, grouped by model.

SELECT model,
       COUNT(*)           AS zadania,
       SUM(amount_usd)    AS koszt,
       SUM(tokens_input)  AS wejscie,
       SUM(tokens_output) AS wyjscie
FROM request_cost_ledger
WHERE timestamp >= '2026-10-20T09:00:00'
  AND timestamp <= '2026-10-20T09:59:59'
GROUP BY model;

One thing matters more than the others here: the sum uses the amount column, not the product of tokens and unit price. It is tempting to recalculate it yourself because the price is in the same row, but that is a miniature repeat of the mistake from the first section. Cached tokens and reasoning tokens have different rates, and the amount column is already calculated after charging. The amount is a fact, the unit price is an assumption.

A task label is the second condition for a good query. Without one, the ledger tells you what the time window cost, not what the task cost. The simplest option is a separate key for one type of work, followed by a header with the task ID or a wrapper that adds a line with its name.

The third condition is often overlooked: failed requests cost money too. A request that returns an error after twenty seconds of generation has its own row and amount. A task that produces no result after three attempts still costs money and produces nothing. Filtering out errors gives you a prettier figure and a worse decision.

In practice, these methods complement each other. In my case, cloud traffic went through a key, while most requests went directly to the model provider, so the meter showed only a slice and the gateway ledger showed everything. That is why you should choose your source of truth once and record in the log where every amount came from.

Project cost log

The ledger tells you how much left the account. The log tells you whether it was worth it. A project cost log is not a financial report. It is a note that lets you answer one question after a month: which type of task is eating into the budget without giving that time back?

Seven columns, one row per task. An entry takes twenty seconds if the cost has already been calculated from the ledger.

  • start date and time
  • the task in three words, for example, “table from catalogue”
  • routing level: simple, medium or difficult
  • the model that actually responded, because after a fallback it is often not the one you requested
  • ledger cost, including failed attempts
  • minutes spent correcting and checking
  • whether the result passed first time

The last column is the most important and the one most often omitted. Cost without information about corrections leads to the conclusion that a cheap model always wins, and that is not true. Five minutes reading a result you know by heart costs more than the cent you saved on the model. Fifteen minutes searching for a displaced row in a table sent to a client costs more than a month of using a stronger model for that one type of task.

Project cost log table: work time windows, number of requests, input and output tokens, with the cost and unit price columns obscured
One working day from the router ledger. Amounts and unit prices are obscured because this is not about my bills, but about showing that every row has a source.

A review once a month, fifteen minutes. Three questions: which task type has the highest cost per accepted result, what share of rows needed corrections, and how often did a different model respond from the one requested?

I keep the log in a file, not a database. A spreadsheet with charts looks better in a meeting, but it requires data entry, and that requires a habit. A file with seven columns opens in a spreadsheet when needed. I take task boundaries from the work run, so I do not copy them by hand. If you track tasks in a system that records their start and end times, half the work is already done. I wrote about this in the post “Hermes Agent: is it worth it?”

How to compare tasks across models

The most common mistake in comparisons is the price per million tokens. It looks like the only common measure, but it measures something different from task cost. Two models at the same price per token can differ threefold in task cost, for two reasons: one writes more, and the other makes mistakes more often.

The first reason is mechanical. A verbose model can generate two and a half times as much text to say the same thing, and when the output rate is higher than the input rate, the difference in the price list is blurred in the bill. The second reason is more expensive and rarely enters comparisons: corrections. The right measure is the cost per accepted result, meaning the total cost of all attempts divided by the number of results that passed without corrections. The denominator is not requests or turns, it is results that nobody had to rescue.

An example using data extraction, with real rates and an assumed price for a minute of work. Cheap model: two attempts, four cents in total, fifteen minutes of corrections. Strong model: one attempt, forty cents, five minutes of checking. An engineer’s minute costs about one and a half zlotys, or ninety zlotys an hour.

Cheap: sixteen groszy for the calls plus twenty-two zlotys and fifty groszy for corrections, a total of twenty-two zlotys and sixty-six groszy. Strong: one zloty and sixty groszy plus seven zlotys and fifty groszy, a total of nine zlotys and ten groszy. The strong model wins by thirteen zlotys on one task, even though its price list is ten times higher.

The same task in a version where corrections are cheap: summarising an email thread that you read for two minutes and can check for missing details. Cheap: sixteen groszy plus three zlotys, a total of three zlotys and sixteen groszy. Strong: one zloty and sixty groszy plus three zlotys, a total of four zlotys and sixty groszy. The cheap model wins. So the divide is not between models, but between types of tasks, and that is the only divide worth encoding in routing rules.

Three rules prevent comparisons from becoming self-deception. Compare the same type of task, not two tasks of similar length. Use the median, not the average, because one task stuck in a loop will distort the whole week. Record the model version and date. One more thing: if the same model fails at the same type of task for the third time, the problem is usually not the model, but the prompt or input data. Switching to a stronger model masks the problem and raises the cost. You can find more such repeatable tasks in the post “AI for engineers: over 40 practical applications”.

Lessons for a small office

In an office with five people, nobody is going to run an AI cost analysis. The bill for models is small compared with the working time spent analysing it. This system only makes sense if it comes down to four decisions made once.

  • Source of truth. We take amounts from the router ledger, never from a report field. If two figures differ, the one with a row for each request wins.
  • One person, fifteen minutes. Once a month, someone reads the log and answers three questions. No committee, no dashboard.
  • Decision unit. We talk about the cost per accepted result, not the price per token. Price per token is a point to raise with a provider, not a measure of our own work.
  • Response to an increase. When the cost rises, we change the routing rule or the type of task, not look for someone to blame.

There is one number worth showing the office owner: the cost per accepted result for the three types of tasks you do every week, set against the minutes spent on corrections. This turns model spending into an hourly rate that you can compare with a subcontractor or your own time.

The measure has its own cost, though: attention. That is why I start with one type of task, not all of them. If the log has twelve rows after a month, it is working. If it has two hundred, it is too detailed. A log that nobody fills in is worse than no log, because it creates an illusion of control.

If you want to check this for yourself in thirty minutes, take one task from last week, find its window in the router ledger and calculate the sum of the amounts. Then compare it with what the tool showed. The difference you see is the best argument for not treating a report like an invoice.

Check also:

This article was created with the help of artificial intelligence.

Paweł Kińczyk
Paweł Kińczyk
Articles: 189

Newsletter

Chcesz być na bieżąco? Zapisz się do newslettera!

Leave a Reply

Your email address will not be published. Required fields are marked *