What /cost tells you #
On this page
/cost is the session's own bill, read back to you in plain numbers: what has been spent, request by request,
and which parts of the conversation are costing the most by being sent again and again. This page walks
through each part of its output and, for each thing it can flag, what to actually do about it. It makes no
promise about your bill: read See and reduce what a task costs for the broader picture,
and measure your own tasks.
In plain words #
- What it is.
/cost, typed in a session, is the session's own bill so far: tokens, AI units or an estimated dollar figure, request by request. - Why you want it. It points at what costs the most (often something re-sent on every turn) and says what to do about it.
- What to do. Type
/costwhenever you wonder. The whole proxy's spend, every tool included, is on the setup page's Usage and Costs & budgets tabs.
The totals line #
The first line is the session so far: input and output tokens, how many requests were billed, and — where the provider states one — AI units (Copilot) or an estimated dollar figure (see Anthropic and estimated cost below; for Grok, the price xAI's reply stated). Under it: the model in use, how many requests were billed against how many were asked again after a failure, and the overall share of input served from the cache.
What to do about it: a retried-request count that keeps climbing on the same kind of task is worth watching — each retry pays for the request twice. If the overall cache share looks low for a task that has run a while, the next section says where in the session that happened. It is the conversation's real lifetime total: resuming restores what it had already spent; forking or cloning starts the new session at zero.
Subagents #
If this session delegated any work with @agent or the delegate tool, /cost ends with a
"Subagents" line — how many ran, and what they cost on their own — and a "Session + subagents"
line, which is the true total: the main conversation's own spend plus every subagent's. This is
the number that matches what your account was actually billed, and it is why the very first line
of /cost (the main conversation alone) can look much smaller than that on a session that
delegated most of its real work — the main conversation's own figure was never wrong, it just was
not the whole bill. The status bar and /context already show the combined figure; /cost now
does too.
What to do about it: if the "Session + subagents" total is far above the main figure, that is
expected on a session that used subagents heavily — it is not a sign anything is broken. If you
need the true total from a script instead of reading /cost, --json-summary's ai_units (and
input_tokens/output_tokens) fields are the combined total too, with subagent_ai_units and
friends breaking out just the delegated share. They are that one run's figures, also when it continues a session
(--continue, --resume, --session); session_ai_units, session_requests and the other session_* fields are
the session's totals, and resumed says whether it had spent anything before.
/savings is a different question — what the harness's own techniques (loop_guard, log
shortening, model choice) saved and cost, not the account's true total. A subagent's spend is
deliberately never valued there: there is no defensible counterfactual for what its parent would
have done instead, so nothing is credited or charged either way. On a session that delegated most
of its real work, /savings says this plainly — how many subagents ran and what they cost — and
points back at /cost for the number that includes them.
A session where genuinely nothing happened (no subagents, no repeated-failure warning, no failing output to shorten, no model switch, no retry) does not just say "nothing to value yet": it names each technique checked and says there was nothing for it to do, so idle reads as "checked, nothing to do" rather than as though nothing was looked at. The moment any technique has something to show, even something priced at zero, that line explains itself instead and the checklist steps aside.
The last requests table #
A row per recent request: input, cached, written and output tokens, AI units, the cache hit rate for that one request, and the model. Two things get flagged automatically:
- "model changed" — a different model answered this request than the one before it. A new model starts with nothing cached, so the whole conversation is billed again at full price on its first turn.
- "low cache hit" — this request's own hit rate fell well below what the rest of the session is getting.
What to do about it: if you see "model changed" more than once in a task you meant to keep on one model,
check whether /model auto is switching under you, or whether you switched by hand — either way, staying on one
model for the rest of a long task avoids paying to rebuild the cache again. "low cache hit" with nothing else
unusual is often something upstream of that request changing the start of the conversation; it is worth a look at
what happened right before it.
Where the next request's input goes #
An estimated breakdown of what the next request would send, by kind: the system prompt, the tools on offer, your own messages, anything looked up on your behalf, the model's own replies and tool calls, and tool results. It is a token-count estimate (about four characters to a token), useful for proportions rather than an exact figure.
What to do about it: if tool results dominate this breakdown, the next section names which ones and why.
Most expensive tool results #
A tool's result is not paid for once. It stays in the conversation and is sent again on every request after it, until it is trimmed or the session ends — so a single large result from early in a long session can end up costing far more than its own size ever suggested. This section ranks the tool results still in the conversation by that real cost: the result's size multiplied by how many times it has been sent again since it first appeared, both for individual calls and totalled by tool name.
A result that has not been sent again yet shows no cost here, even if it is large — the cost is in the resending, not in the one call that produced it.
What to do about it, per line:
- A large
read_fileorgrepresult high on the list: ask for less next time it comes up — a narrower pattern, or a line range instead of the whole file — and, if the information in it is no longer needed, say so; it stays in the conversation until something removes it. - One tool name dominating the "by tool" total: that is usually a habit worth changing for the rest of the task — a search being repeated instead of reused, or a whole file being read where a smaller one would do.
- Nothing shown here at all: either the session is early (nothing has been resent yet) or your tool results are simply small relative to the rest of the conversation — nothing to act on.
Today the harness only shortens a failed command's output for you automatically (see /savings); a large result from a call that succeeded is kept exactly as it came back, because shortening it without being asked could remove something the model still needs.
Anthropic and estimated cost #
Copilot states a price for every call it serves. Claude through Anthropic's own API does not — its responses
carry token counts only, never a price. /cost reflects that honestly: an Anthropic request shows its tokens
like any other, and no price, unless the provider is set up to estimate one.
An operator can turn on estimate_cost for an Anthropic provider (see the Proxy settings),
which prices each such call from Anthropic's own published rates instead. This figure is always shown as an
estimate — in dollars, never mixed into Copilot's AI-units figure — because it is a list-price guess, not what the
account was actually billed: a committed-use rate, a promotion, or a later price change could make it wrong.
What to do about it: if you rely on a precise bill, check your provider's own account page rather than this
figure. If Anthropic's calls in /cost show tokens but never a dollar figure at all, estimate_cost is off. When
it is on and a call still has no figure, Maple says why instead of leaving it out: see below.
To limit what an Anthropic account spends a month, see Monthly dollar budgets: it counts in
estimated dollars whether or not estimate_cost is on.
When Maple can't tell which Claude model a name is #
The estimate needs to know which Claude model a call went to. Maple reads it from the model's name. A name such as
claude-sonnet-5-5 or claude-opus-4-6-20260101 is clear, and so is a deployment name that includes the model and
its version (my-sonnet-5-prod). Some names are not clear:
- a name that looks like a model Maple's price list does not have, such as a deployment called
claude-opus-4-9; - a name that mentions two models, such as
opus-5-5-with-sonnet-5-judge; - a name with no version (
my-sonnet-prod), or no Claude model at all.
Such a call gets no estimate, and Maple says so: the proxy's log says it once per model, /cost and the
--json-summary file say no estimate for <model>: <reason>; set price_as on this model in the proxy's
config.yaml, and the setup page's Costs & budgets tab lists it under Not estimated while that model is
configured without price_as.
One kind of unclear name keeps the estimate it had before 2.1.2: a Sonnet 5 name with a version the list does not
have, such as claude-sonnet-5-2 or my-sonnet-5-7-prod, is priced as Sonnet 5, the closest listed model. Maple
says so in the same places (<model>: estimated as claude-sonnet-5, the closest listed model; set price_as on this
model to change it; on the setup page, under Estimated as the closest model), and price_as changes it.
To price it, name the Claude model on that model's entry with price_as:
providers:
- id: azure
type: azure
estimate_cost: true
models:
- id: claude-opus-4-9
price_as: claude-opus-4-8
- id: opus-5-5-with-sonnet-5-judge
price_as: claude-opus-5-5
price_as must be a Claude model ID that is in Maple's price list; anything else stops the configuration from
loading, with a message that says so. A model ID it accepts stays accepted by later versions of Maple. On the setup
page, set it in the model's ⋯ row on the provider's form.
The figure is still an estimate at Anthropic's list prices.
Before a large message: the cost preview #
With cost_preview set to large or on (see Harness settings; it is off by
default), the harness says, before a message is sent, about what its first request is likely to cost. It looks
like this (an illustration of the format, not a measurement):
· next request: about 3.25 AI units (estimated: 84.0k tokens in (60.0k expected from the cache), about 1.2k out;
prices learned from requests on this proxy); up to 9.50 AI units if nothing is read from the cache.
A message that uses tools sends more requests than this one
The line goes to the plain output, and the status bar shows a short form (next: ≈3.25 AI units (est.)) while the
message is being sent. It is never sent to the model.
What it is based on, and so what it is not:
- The request's size is the harness's own estimate of the conversation and tools it is about to send, not a count from the provider.
- The price is what your proxy has seen requests on that model cost (AI units; on a shared proxy, everyone's
requests), or, for an Anthropic
provider with
estimate_coston, Anthropic's published list price (dollars). Nothing else: with neither, it says "no cost estimate" and why, and shows the size in tokens instead of guessing a price. A model on your own machine or network shows no AI units. - The cache is expected to serve the previous request's part of the conversation when your provider has reported cache reads in this session and the model has not changed; the "up to" figure is the same request with nothing read from the cache.
- The output is this session's average per request so far; before the first request it is left out, and so is any output with no known price (the line says "input only").
- One request, not the whole message. A message that leads to tool calls sends more requests;
/costshows what they actually cost afterwards.
When a model's own stated prices line up exactly, the preview starts estimating after a handful of requests on that model instead of waiting for more; saving figures are unaffected and still need the full amount of data.
It is an estimate of one request's price, never a saving and never your bill. With cost_preview_confirm_above set,
the harness asks before sending each message whose estimate is above it; answering no sends nothing. It is asked
every time (there is no "always" for it), and only at the terminal or on a device paired with it, never through a
shared link. A --prompt run with no one to answer sends nothing and exits with status 1. An estimate
that cannot be made (an older proxy, or no answer within a few seconds) never holds a message back. A harness
connected to a proxy on another machine asks it with the same access token it uses for everything else.
When the output limit goes on reasoning #
A reasoning model thinks before it answers, and its thinking counts against the same output limit as the answer. When
it uses the whole limit thinking, the reply stops with no answer at all. The proxy says so: Maple Harness shows a
warning ("the output limit was used up by reasoning before any answer; raise max_tokens"), and other tools find the
same note as output_note in the response's usage, or in the X-Maple-Output-Note header of an answer that is not
streamed. The tokens it thought with are still billed. To fix it, raise the model's output limit (max_output_tokens
on the model in the proxy's config.yaml, or the request's max_tokens), or lower the reasoning effort (/effort).
Related #
See and reduce what a task costs · Proxy settings · Commands and keys · Settings by goal