DocsBuild an agent
Estimating a loop
POST /v1/estimate: what an agent's loop costs turn by turn, what you state, how each billing rule is applied, and what nobody knows.
An agent sends its whole conversation again on every step. The prompt of a turn is the tool definitions, the system prompt, the first input and everything earlier turns added, so the bill grows faster than the steps do, and bends where a provider's rule starts to apply. POST /v1/estimate prices that loop turn by turn, on the model your providers would be given for it. Estimate an agent's loop is the same call as a form.
The loop you state
| Parameter | What it does |
|---|---|
steps | Model calls in one task. Required unless a reference loop is named.1 to 1,000 |
system_tokens, first_input_tokens | The system prompt and the task's first message, in tokens. Both required, unless a reference loop is named. |
tool_schema_tokens | The tool definitions, sent on every call. See the tools' weight, below. |
step_growth_tokens | What a step adds to the prompt besides the model's own words: tool results, the next message. The step's output is sent again too, and is added for you. Required, unless a reference loop is named. |
output_tokens_per_step | What the model writes in a step. Required, unless a reference loop is named. |
long_steps, max_steps | A long task, and the loop's cap: each adds a figure. |
cache | The prompt cache's life. Left out, both bounds are given at the 5-minute write rate, and the answer says so.off, 5m, 1h |
reasoning_tokens_per_step, reasoning_kept | Reasoning tokens a step, and whether a step's reasoning is sent again in later prompts. Left unsaid with reasoning stated, the figures are given both ways. |
retry_rate | The share of steps sent again, as a number: 0.1 is one step in ten. |
seconds_per_step | Seconds a step takes, tools included. Yours to state: no latency data is kept here. |
prefix_shared_across_tasks | True when tasks arrive often enough that the system prompt and tools are already cached on a task's first turn. |
compact_at_tokens | The prompt size your agent compacts at: the prompt stops growing there. |
tasks_per_month | A month's volume, or users with tasks_per_user_month. A month is never priced on a guessed volume: without one there is no monthly figure. |
The model comes from model, as a stack takes it: your providers, and any /v1/resolve parameter in model.constraints. It is chosen again here, ranked on a call from the middle of the loop, so send what that agent's own resolve or stack call sent. An estimate prices one model's loop: a team or an escalation is one estimate a model, blended with a share only you have.
Three figures a task
stated: the loop as stated.long: the same atlong_steps.ceiling:max_stepsturns at the price's highest rate, the dearer way of the loop as stated. That is nothing cached, unless the cached way comes to more: a cache that only writes (it expires between turns, or the prompt is compacted every turn), or a loop so short that writing the cache costs more than its reads save. The figure then carriescached: true. It is what one runaway task costs with no other brake: exposure, not an expectation.
Each carries its sum: the tokens by the rate they bill at, per 1M, so a figure can be checked by hand. breakdown says whose tokens the stated figure is the cost of (the tool definitions, the system prompt, earlier turns sent again, new tokens, output), and turns gives the first turn, the last and each a rule fired on, or every turn with all_turns. A turn carries the rates it bills at, per 1M tokens in the price's own currency and before the provider's fees and your terms: its read tokens, its new ones, its output and its reasoning each have their own.
Two more figures are the stated one multiplied, and only when you state the number: monthly with a volume, and evals with a suite's cases and runs. Where the task is given both ways (reasoning stated, kept or not left unsaid), so is each of these.
One figure is not the model's at all. With loop.review (the share of tasks a person reviews, the minutes one review takes and what an hour of the reviewer costs you) and a month's volume, the answer carries review: the month's hours and what they come to at your rate, with the sum: tasks × share × minutes / 60 × your rate, one product. All three numbers are yours and none is filled in. It is given apart, and no total of it with a figure of the model's is given.
Two bounds, not a hit rate
stated and long each come as two computed figures. cached is every turn reading what the turn before sent from the cache and writing only what is new. uncached is nothing cached. While every turn arrives inside the cache's life your bill lies between them, and where depends on how many do, which only your traffic knows. No cache hit rate is assumed. A turn that misses the cache is written again at the write rate, which can be above plain input, so a loop that often misses can cost more than the uncached figure. With the cache off there is one figure; on a model that sells no cached rate there is one figure too, and a warning says why.
The rules, as they are applied
The rates are the chosen offering's own, from the catalog of the day with their source. What is fixed here is how a turn is billed by them:
| Rule | How it is applied |
|---|---|
| The cache | On the cached bound a turn reads what the turn before sent at the offering's cache-read rate and writes the rest at its write rate for the life asked for; where it has a write rate only for the other life, at that one, with a warning; where it prices no write, at input. The first turn writes everything, unless you state that the system prompt and tools are already cached across tasks. A tool list that changes during a task voids the cached figure: the cache is a prefix in the order tools, system prompt, messages, so a changed tool definition is a new prefix. |
| A cache that expires | With seconds a step stated and longer than the cache's life, every turn is priced as a write (but for a first turn whose system prompt and tools you stated as already cached). A write can cost more than plain input, so the cached figure can then be the higher one, and a warning says so. |
| A long-prompt tier | Where a price has a tier above a prompt size, the whole request bills at the tier's rates from the turn the prompt crosses it, for every kind of token the tier prices, cache reads among them where it prices those. The warning names the turn and what the figure costs from there. |
| The context window | A prompt past the model's window is turned away. Stated steps that outgrow it are refused with the turn, the turns that fit and what they cost; a long task or a ceiling that does is priced to the turn it stops, with a warning. |
| Reasoning | Reasoning tokens bill at the reasoning rate, or as output where there is none. Whether a step's reasoning is sent again in later prompts differs by provider and not all say: it is a flag, and left out the figures are given both ways and the ceiling takes the higher. |
| Compaction | With a compaction point stated, the prompt stops growing there. What compaction itself costs is not priced, and a compacted turn keeps only the system prompt and tool definitions in the cache, since a rewritten message list is no longer a cached prefix. |
| Retries, fees and terms | A stated share of steps sent again multiplies every figure. A provider's fee, a discount or free tier you state, a price by the request and a price in another currency are in the figure and named in its sum. |
| Cheaper hours | Where a price has cheaper hours, stated and long use the week's average, as a user's month does, on the standard service tier and for turns below any long-prompt tier; the ceiling stays on the highest rate. |
The tools' weight
Tool definitions are sent on every call, so their weight is in every turn. estimate takes it as a number and opens no catalog of servers. Three ways to the number, best first:
- The
schema_tokensa stack answer carries for each server it chose whose tools were read, summed. A command-line tool loads no definitions. - Your provider's own token counter over the agent's real tool list.
- A guess, which the answer cannot tell from a measurement and repeats back as stated.
The catalog's weights are counted with one tokenizer, o200k_base, so they are exact for the models that use it and an approximation for others. As context, dated: among the 286 servers whose tools the directory had read on 2026-11-26, the median was 2,409 tokens and one in ten was over 28,000. A server that answers only with a sign-in is not read, so its weight is yours to state: on that day 5 of the 136 curated systems had a server of their own with a weight.
On the form
Under an answer, the form has three parts that each ask a call that already answers them, on a press of their own. None is in the page's link, so a reload empties them.
- What it connects to asks stack for the systems you name. A row reads a number where the system's own server had its tools read with no sign-in; "not read" where it has a server whose tools were not read, so its weight is yours to state; "none sent" where the choice is a command-line tool, which loads no definitions; and "not counted" where the system has no first-party option. A "not read" row has a field for your own count, said to be typed wherever it is used. The sum is of what was read and what you typed, and a button takes it as the loop's tool definitions and prices the loop again. The same sum is drawn against the model's window, a segment a system, as what is sent before a word of the task.
- Will a host let it finish? asks platform with the longest task in seconds, once seconds a step and a loop cap are stated. A host is ruled out by the limit its page prints, a host whose page prints that a request may run this long is listed with those words, and a host whose pages state no limit is neither ruled in nor out. Each list is by name. A task longer than a day is not asked about.
- Build worksheet counts what there is to build from the same answers. Its hours and rate are typed by you and none is filled in; the sum is those numbers multiplied, and it is written into the exported file with the rows.
Reference loops
Three loops to price when you have measured none, each a sentence and the numbers it means. They are examples, chosen to differ in shape; a loop you name by loop.reference comes back with from_reference listing the numbers that were its own.
support-exchange: 6 steps on a system prompt of 1,800 tokens and 2,400 tokens of tool definitions; a question of 300 tokens, then each step adds 900 tokens of tool results and writes 250. A long one takes 12 steps and the loop stops at 25.research-task: 18 steps on a system prompt of 2,500 tokens and 9,000 tokens of tool definitions; a request of 600 tokens, then each step adds 3,500 tokens of search and page results and writes 500. A long one takes 35 steps and the loop stops at 60.coding-task: 45 steps on a system prompt of 4,000 tokens and 14,000 tokens of tool definitions; a task of 1,200 tokens, then each step adds 4,200 tokens of files and command output and writes 700. A long one takes 90 steps and the loop stops at 150.
When it refuses
A 422, not counted. context_exceeded: the stated steps outgrow the model's window; the answer names the turn, the turns that fit and what they cost, which is a cost of the failure and not an estimate. Fewer steps, a compaction point or a larger window (min_context in model.constraints) would let it run, and the choice is yours. no_candidate is /v1/resolve's own. not_token_billed: the model chosen has no token price for input and output.
What it does not answer
- How many steps your agent will take, or how often it will retry.
- How fast a model answers. No latency data is kept here, so seconds a step is yours to state; with it and a cap, the answer gives the longest task in seconds for where an app's agent runs.
- What the agent costs to build. Hours and rates are yours, and none is filled in here.
- A percentile. That takes your own run data, which is not taken here.
- A fee for a tool the provider runs itself, such as its web search or its code execution. Those bill by the call or the session on top of tokens, the catalog holds no price for them, and every answer's
assumptionssays none is in a figure. - What the agent runs on. That is
/v1/stack'sinfrastructure, priced apart from the model.
Examples
#!/usr/bin/env bash
# What an agent's loop costs on one model, with curl: a research agent that
# takes 18 steps, each adding 3,500 tokens of search results, on 9,000 tokens
# of tool definitions. Prints the JSON answer: `stated` is one task as two
# bounds (every turn read from the cache, and nothing cached), `long` the
# same at 35 steps, and `ceiling` what one runaway task costs at the cap of
# 60. Each figure carries the `sum` it is the result of.
#
# RHUMB_KEY=nnm_test_... bash estimate.sh
#
# RHUMB_URL overrides the base URL (default https://rhumbdata.com).
# The steps are yours to state: nobody can say how many an agent takes from
# a description. With none measured, send "loop": {"reference": "research-task"}
# and treat the answer as an example.
set -euo pipefail
: "${RHUMB_KEY:?Set RHUMB_KEY to your API key}"
RHUMB_URL="${RHUMB_URL:-https://rhumbdata.com}"
curl --silent --show-error --fail-with-body --max-time 10 \
-X POST "$RHUMB_URL/v1/estimate" \
-H "Authorization: Bearer $RHUMB_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": { "providers": ["gemini", "openrouter"] },
"loop": {
"steps": 18,
"system_tokens": 2500,
"tool_schema_tokens": 9000,
"first_input_tokens": 600,
"step_growth_tokens": 3500,
"output_tokens_per_step": 500,
"long_steps": 35,
"max_steps": 60,
"cache": "5m",
"tasks_per_month": 2000
}
}'
echo