Skip to content
Docs
Request access

Costs and savings

Calls to Anthropic Claude models are recorded in the ledger with their token counts and cost. For other models, the connection and the connection test work, and a call to a model with no price is recorded with its cost shown as unknown until a price is set. The pages and routes below only read that record. None of them writes to the ledger, changes a budget or switches a model. Limits are in Budgets.

  • A running server and an account or API token with the read permission (Accounts and roles).
  • At least one finished run in the organization’s ledger. With no calls recorded the totals are empty.
  • For the savings command: the team folder on this machine.
  1. Read what was spent, by role, provider or model: Spend.
  2. Ask for a cost range before a run: A cost range before a run.
  3. Divide the spend by the accepted results: Cost per accepted result.
  4. Read what the prompt cache saved: Token savings.
  5. See whether a cheaper model would have passed the same gates: The downgrade report.
  • Amounts are decimal strings such as "<amount>", never floating-point numbers. The currency is stated in each answer.
  • Prices are versioned data. A call to a model with no known price is recorded with an unknown cost. It is shown as unknown and left out of the totals, and a total that leaves calls out says so. A price is never guessed. To allow such a model on purpose, see Price overrides; costs computed with one are marked provisional.
  • All of these routes need the read permission and are scoped to the server’s organization. They are in the API reference.
GET /v1/costs/spend?group_by=model
GET /v1/costs/calls?bucket=accepted
  • GET /v1/costs/spend needs group_by (role, provider or model). Add series=day or series=month for one answer per period. from and to are UTC instants with an offset (for example Z); as_of ignores anything recorded after that instant. A bad instant is 422 invalid_request, and a range with too many periods is 422 range_too_large.
  • GET /v1/costs/calls lists the calls behind the totals, a page at a time (limit, after). bucket is one of accepted, rejected, pending or unattributed: spend that ended in a result a gate accepted, spend on work that was rejected, spend on work not finished, and spend that belongs to no task.
POST /v1/costs/quote body: {"tasks": [{"role": "...", "provider": "...", "model": "..."}]}

The body lists one entry per task you intend to run. The answer is a range (low, median, high) taken from comparable past runs: same roles, same models, finished cleanly, all prices known, and the price version still current. With too little history, status is not_enough_history and the range is empty; the answer also reports the sample_size and how many runs were left out and why. A quote is advice only: it writes nothing and is never an input to a budget check.

GET /v1/costs/per-result?group_by=role

This divides the money spent on accepted work by the number of accepted results, optionally per role, provider or model. When some of that spend has an unknown price, the figure is reported as per_result_at_least, a lower bound, instead of per_result.

Terminal window
nuramesh savings tokens --team .
nuramesh savings tokens --team . --group-by model

nuramesh savings tokens shows tokens by kind (input, output, cached input, cache write), the cache hit rate, what the cache saved, the write premium and the net saving. GET /v1/savings/tokens gives the same answer. It takes --from, --to and --as-of (UTC instants) and --group-by (none, provider, model or role). A call with no usage record, or with an unknown saving, is counted and named rather than estimated. The command only reads; it makes no network call and has no apply step. Prompt caching itself is switched with nuramesh org prompt-cache.

GET /v1/reports/downgrade?min_sample=30

For each role, the report puts each model’s gate and verifier pass rates next to its cost per task. Where the evidence is strong enough, it names one cheaper model as a recommendation.

  • min_sample is the number of results needed before a recommendation (1 to 10000, default 30). The period defaults to the current month; from, to and as_of work as above.
  • A model with an unknown price is never recommended and never compared with.
  • The report never switches a model. A person changes the team configuration.
  • The app shows it as the downgrade report page.
Terminal window
nuramesh savings tokens --team .

It prints the tokens by kind and the net saving, and names any call it could not count. Over the API, GET /v1/costs/spend?group_by=model returns one total per model with its currency. Compare the total with the budget lines of nuramesh report for the same run: both are read from the same ledger.

You see Do this
422 invalid_request An instant is not a UTC time with an offset. Write it like 2026-11-01T00:00:00Z
422 range_too_large The range has too many periods for series. Shorten it, or use series=month
status is not_enough_history on a quote Too few comparable past runs. The range is empty on purpose; run more, or decide without a quote
per_result_at_least instead of per_result Some of the spend has an unknown price, so the figure is a lower bound. Set the price
A cost shows as unknown The model has no price in effect. Add one, or a price override

Was this page helpful?