Skip to main content

Token Costs: what your thunk spends on AI

See what a thunk spends on AI — day by day, for the whole workflow or for a single step — and what it typically costs to put one work item through it.

Token Costs shows what a thunk spends on AI: what a single work item typically costs to put through the workflow, a chart of every work item's cost over time, a day-by-day chart of the spend, and the most expensive work items underneath. Use it to see whether a thunk's cost is steady or climbing, to find which step accounts for most of it, and to tell a predictable bill apart from one driven by a few expensive work items.

Figures are in US dollars. They cover the AI work itself — the model usage, and so the tokens, behind every agent run the thunk made.

Where to find it

Open your thunk, go to Monitor, and select the Token Costs tab. Monitor is available to thunk admins.

The Token Costs tab: a scope and window picker, the per-work-item cost figures, a chart of each work item's cost with daily percentile lines, a bar chart of daily spend, and the most expensive work items.

Choosing what you are looking at

Two controls sit at the top, and everything below them follows your choice.

Scope decides whose spend you are seeing. The list follows your workflow, and each option shows what it cost over the window:

  • Whole workflow — what your workflow steps spent, added up. This is the default.

  • A single step — one step of your workflow. Steps are listed in the order the workflow runs them and numbered to match — Step 1, Step 2 and so on — so you can find one by where it sits rather than by reading every name. Which step is the expensive one is on the figure beside each option, and on the chart once you pick it.

  • Setup & automation — work that is not part of your workflow, such as planning it, building a tool, or routing an incoming message. It is real spend, so it is shown rather than left out — but it is not counted in the whole-workflow figures, so those tell you what running your workflow costs and nothing else.

Only the steps of your workflow are numbered. Setup work is grouped into that single Setup & automation entry rather than listed step by step, and the handful of steps behind planning, automation and tool building are listed after the numbered ones, without a number.

Window sets how far back to look: the last 7, 30 or 90 days.

The daily chart

Each column is one calendar day's spend for the scope you picked, in your own time zone — so a column here means the same day as one in the Errors tab. Hover a column to see that day's figure.

The line above the chart gives the window's total and how many agent runs are behind it. Reading the two together is what separates more work from pricier work: a day that costs twice as much on twice as many runs is simply a busier day, while the same rise on a flat run count means each run got more expensive.

What one work item costs

Above the chart is the part most worth acting on: what a single work item costs in this scope. A work item's cost is everything spent on it — across every step it passed through, and across every attempt, including retries and steps that paused and resumed.

  • Median — half of your work items cost less than this. The typical item.

  • Mean — the average.

  • 90th pct — 9 in 10 work items cost less than this.

  • 99th pct — 99 in 100 work items cost less than this. The items past it are listed below the chart.

  • Max — the single most expensive work item in the window.

  • Work items — how many work items these figures are based on.

The median and the mean sit side by side because comparing them is the most useful thing you can do here.

Pick a single step in Scope and the same figures describe what that step costs per work item, so you can see which part of the workflow the money goes to.

Reading them together

The gap between the median and the mean is the most useful thing here. If they are close, your costs are predictable and the median is a fair basis for estimating. If the mean sits well above the median, a small number of expensive work items is driving the bill — and the 99th percentile and Max tell you how expensive those outliers get. That is the case where the average alone would badly mislead you: most items cost far less than it, and a few cost far more.

A high 90th or 99th percentile on one step is a good place to start looking. It usually means that step sometimes does much more work than it typically needs to — often worth checking against the step's instructions and the tools available to it. Open one of those work items from the list below the chart, and see Analysis of AI behavior for how to read what its runs actually did.

Is the cost per item changing?

Below the figures, a chart plots every work item in the scope you picked as a dot: across, when the item started; up, what it cost. Three lines run through the dots — each day's median, 90th and 99th percentile — and the items past the 99th percentile are drawn larger, matching the p99 marks in the list at the bottom. Hover a dot to see that item's cost and when it started.

Read it for drift, which the figures above cannot show. A cloud that climbs across the window means the same work is costing more than it used to; a single column of high dots means something happened at one moment rather than with one kind of work; a flat band means your cost per item is steady.

Colour dots by adds a second reading to every dot:

  • Cache hit rate (the default) — how much of the item's prompt the AI model served from its cache. Cached prompt tokens are billed at a lower rate, so dark dots, which paid full price for their whole prompt, are often the expensive ones. If the high dots are the dark ones, your prompt is falling out of the cache between runs, which is something you can change.

  • LLM model — which model the item ran on, so you can see whether the expensive items are the ones on a particular model. An item that used more than one model — because an AI tool it called used another — is named by both.

Items recorded before Thunk tracked these are shown grey rather than guessed at.

On a very busy thunk, the chart shows an evenly spread sample of the work items rather than every one, and says so beneath it. The shape and the lines still describe the whole window; the list at the bottom still names the most expensive items.

Which work items were the expensive ones

Under the chart is Most expensive work items — the dearest items in whatever scope you picked, most expensive first, with what each cost, how many agent runs it took and when it started. The ones past the 99th percentile are marked p99; the rest are there so you can see what normal looks like beside them.

This is the answer to the question the 99th percentile raises. "The 99th percentile is $2.40" tells you a tail exists; this tells you which items are in it. Each name opens the item — or, when you have picked a single step, that step on that item — so you can read what actually happened.

When nothing is marked, the list says so. That is a real finding: it means your costs are even, and the most expensive item is simply the top of a normal spread rather than a runaway.

Things worth knowing about the figures

A run still in progress counts as nothing until it finishes. Its cost is recorded when it completes, so today's column can understate slightly and will settle as work finishes.

Setup & automation has no per-item figures. That work is not done on behalf of any one work item, so there is nothing to divide it by. Select it and you still get its daily spend and its total — but that spend is not included in any whole-workflow figure, because it is not what your workflow costs to run.

The window cuts at its edges. A work item that was still being worked on when the window began contributes only what it spent inside the window, so a long-running item can look cheaper than it was.

A thin sample makes the tail percentiles unreliable. With only a handful of work items, the 90th and 99th percentiles are really just "the most expensive one or two", and the tab says so when that is the case. The median is still meaningful; give it more work items before reading much into the tail.

Comparing with a single work item's cost

The work items table has an AI Cost ($) column showing what one work item has cost over its whole life — add it from Manage columns if it is not already showing. Token Costs is the windowed view: it covers only the period you selected. The two will differ for a work item that has been running longer than the window, and both are correct — they are answering different questions.

Did this answer your question?