Agent development is early. Builders iterate on architectures, prompts, tools, memory, and execution loops, and experimentation gets expensive fast because context re-sends every step. Model the cost of your loops here, entirely in your browser.
Worked examples that populate all fields. Assumptions shown below.
Sample prices are illustrative. Edit to match current provider pricing.
| Model | Input $/1M tok | Output $/1M tok |
|---|
No models yet. Add a model row to see costs.
Negative values are clamped to zero automatically.
Cost per run, per day (runs × experiments), and per month (30 days).
| Model | Per run | Per day | Per month |
|---|
context(step s) = base + s × (output + growth) [full history] context(step s) = base + min(window, s × (output + growth)) [sliding window] input tokens per run = Σ context(s) for s = 0..steps-1 output tokens per run = steps × output cost per run = input×(in$/1M) + output×(out$/1M) per day = cost × runs × experiments; per month = per day × 30
Each step re-sends the entire conversation plus tool results as input tokens. A 10-step loop does not cost 10× one call — the growing prompt makes input cost roughly quadratic in steps under full history.
Every extra token added per step (tool outputs, retrieved memory) is paid again on every subsequent step. Sliding windows or summarization cap that accumulation and flatten the cost curve.
The saved calculator counts input tokens for every agent step. Each step contains the system prompt plus history from earlier output and tool growth. At the defaults, system tokens are two thousand, output four hundred and growth six hundred per step, across eight steps. Input sizes run from two thousand through nine thousand, summing to forty four thousand. Output totals eight times four hundred, or thirty two hundred. With the same settings and a history window of two thousand, input sizes become two thousand, three thousand, then four thousand for each of the remaining six steps, summing to twenty nine thousand. Bars compare two hundred sixty four and one hundred seventy four pixels at point zero zero six pixels per input token. The window caps added history only; it does not include the system prompt in its cap. The first step has no previous output or growth. Cost per run is input tokens times input price per million plus output tokens times output price per million. Use the saved illustrative large-model rates of three dollars for input and fifteen for output. Forty four thousand input tokens cost thirteen point two cents and thirty two hundred output tokens cost four point eight cents, totaling eighteen cents per run. With twenty runs per experiment, five experiments per day and thirty days, the month contains three thousand runs and costs five hundred forty dollars. Windowed input twenty nine thousand instead costs eight point seven cents, plus the same four point eight cents of output, totaling thirteen point five cents per run or four hundred five dollars per month. Bars use half a pixel per monthly dollar. These are arithmetic examples using editable sample prices, not verified current provider pricing or actual billed usage. Cached input discounts, retries, tool fees and other billing details are not separately modeled. Peak context is the largest per-step input size, so the full-history example peaks at nine thousand while the two thousand history window peaks at four thousand. Bars compare two hundred seventy and one hundred twenty pixels at point zero three pixels per context token. The limit field produces a warning only when peak is strictly greater than the entered limit. It does not truncate input, change the estimated spend or simulate an API rejection. Equality is displayed as within limit. Steps and runs are rounded and clamped to at least one, with steps capped at two hundred; negative growth and prices are treated as zero for computation. Monthly estimates always use thirty days. The summary copy includes input and output totals, peak, limit, history mode and monthly model totals. All calculation occurs in this browser source; no model request or real billing event is part of the local explainer run.