---
title: "AI agent run cost estimator: tokens per step and total"
description: "Estimate what a coding or agent loop costs: context growth per step, cache hits and output on BroadNet or any priced model, against a flat DeepSeek session."
url: https://broadrouter.com/tools/agent-run-cost-estimator/
lang: en
updated: 2026-11-16
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Agent run cost estimator

Updated 2026-11-16

**In short:** An agent resends its whole history on every step, so input grows each step: total input = steps × starting context + growth × steps × (steps − 1) ÷ 2. A 50-step run that starts at 10,000 tokens and adds 2,000 a step sends 2,950,000 input tokens. Enter your loop for the cost per step and in total.

Free, no sign-up, runs in your browser: nothing you type is sent anywhere.

Agent loopSteps per runRuns to priceStarting context, tokensSystem prompt + tool definitions + task, sent on every stepTool output added per stepModel output per stepReasoning per stepBilled as output, not resentCached input, %Share of input billed at the cached price The model's output is appended to the history

ModelDeepSeek V4.1 FlashGLM 5.3Qwen3.8 27BBroadNet Gemma 4 VL 26BAnother provider's model (428 in our price database)…Custom prices

Search a model by name

Prices are each model's cheapest listed standard price, read from providers' own pricing pages (newest check 2026-11-15).

Input, per 1MCached input, per 1MOutput, per 1MContext window, tokens (optional)

Cost per run

—

Input per run

—

Output per run

—

Last step input

—

## Input per step and cumulative cost

Input tokens sent on each step, cost of that step and cumulative cost of one run
| Step | Input tokens |  | Step cost | Cumulative |
| --- | --- | --- | --- | --- |

## Same work on a DeepSeek session

[See the plans](https://inference.broadnet.ai/plans?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-agent-run-cost-estimator&utm_content=tool) · [Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-agent-run-cost-estimator&utm_content=tool-account) ·

Estimates before tax. BroadNet prices synced 2026-11-14; other models use the cheapest standard price listed on a provider's own page in our database. Retries, failed calls, compaction and parallel sub-agents are not included. Session time counts generation only, at BroadNet's typical figure of about 100 tokens a second, not a guarantee.

[Report a wrong price or number](mailto:info@broadnet.ai?subject=Wrong%20price%20or%20number%20on%20Agent%20run%20cost%20estimator&body=Page%3A%20https%3A%2F%2Fbroadrouter.com%2Ftools%2Fagent-run-cost-estimator%2F%0A%0AWhat%20looks%20wrong%20(model%2C%20figure%20shown%2C%20correct%20figure%20and%20a%20source%20link%20if%20you%20have%20one)%3A%0A) (email to info@broadnet.ai, with this page's link and your inputs filled in).

## How it works

1.  Enter the number of steps (model calls) in one run, the starting context (system prompt, tool definitions and task) and the tokens appended per step: tool output and the model's visible reply.
2.  Add reasoning tokens per step if the model reasons (billed as output, not resent) and the share of input you measured as cached. Caching starts at 0%.
3.  Pick a BroadNet model, any model from our price database, or type custom prices. Set how many runs to price.
4.  Read the total, the step-by-step table of input growth and cumulative cost, the context-window check and the DeepSeek session estimate.

## The formula

```
growth per step = tool output + model output (if kept in history)
input on step i = start + (i − 1) × growth
total input     = steps × start + growth × steps × (steps − 1) / 2
total output    = steps × (model output + reasoning)
cost            = input × (1 − cache) × input_price
                + input × cache × cached_price
                + output × output_price          (prices per 1M tokens)
```

The quadratic term is why long runs get expensive: doubling the steps roughly quadruples the input once growth dominates the starting context. When a model publishes no cached price, the cache share is ignored and all input is billed at the input price.

## Worked example

A 50-step coding run starts with a 10,000-token context, and each step appends 1,500 tokens of tool output and a 500-token reply, with 300 reasoning tokens. It sends 2,950,000 input tokens and 40,000 output tokens. On DeepSeek V4.1 Flash at pay-as-you-go prices that is $0.5371 with no cache hits and $0.137 if 80% of input is cached. Generating 40,000 output tokens at about 100 tokens a second takes roughly 7 minutes, so one Meteor session hour ($1) covers the generation time, if tool calls and prompt processing also fit in the hour.

## Pay per token or buy a session?

-   Per token wins for short or occasional runs, and when cache hits are high.
-   A session wins when one agent works for hours: the price is per period, with no token meter, and it covers one request at a time.
-   Parallel agents need one session each. Sessions do not guarantee throughput or uptime.

For a monthly view across many runs, use the [flat-rate vs per-token calculator](https://broadrouter.com/tools/flat-rate-vs-per-token-calculator/) or the [session planner](https://broadrouter.com/plans/).

## Questions

### Why does an AI agent cost more per step as it runs?

Chat APIs are stateless, so an agent sends the whole conversation on every call: the system prompt, tool definitions, the task and every tool result and reply so far. Input therefore grows by the tokens appended each step, and total input grows with the square of the number of steps.

### How do I estimate tokens added per step?

Log one real run. For each call, read `usage.prompt_tokens`; the difference between consecutive calls is the growth per step (tool output plus the previous reply). Reasoning tokens are billed as output but are usually not sent back, so enter them separately.

### How much does prompt caching help an agent?

A lot, because each step resends the previous steps unchanged. Cached input on DeepSeek V4.1 Flash costs $0.0055 per 1M tokens against $0.175. The share that is actually cached varies by provider and by how stable your prompt is, so measure `prompt_tokens_details.cached_tokens`. The tool starts at 0% cache so you do not count savings you have not measured.

### Is a flat DeepSeek session cheaper for agents?

Sometimes. A Full Moon, Orbit or Meteor session has no token meter, but it runs one request at a time, so one agent loop per session. The tool estimates how long the run takes at BroadNet's typical 100 tokens a second and prices it as session hours. A lower estimated charge does not prove the work finishes in the period.

### What happens when the context window fills up?

The request fails or the provider truncates, depending on the API. Long-running agents summarise or drop old tool output (compaction). The tool shows the step where your history passes the model's context window; it does not model compaction, so costs after that step are an upper bound. [Context management for long agents](https://broadrouter.com/blog/long-running-agent-context-management/).

### Does this tool say whether my agent will finish the task?

No. It prices the tokens you describe. Whether an agent completes a task depends on the model, the prompt and the tools, and no cost estimate can promise that.

## Go deeper

-   [Agent token budgets](https://broadrouter.com/blog/agent-token-budget/)
-   [How to cut coding agent LLM costs](https://broadrouter.com/blog/cut-coding-agent-llm-costs/)
-   [Context management for long-running agents](https://broadrouter.com/blog/long-running-agent-context-management/)
-   [How plan sessions work](https://broadrouter.com/guides/unlimited-llm-api-sessions/)
-   [Flat-rate vs per-token calculator](https://broadrouter.com/tools/flat-rate-vs-per-token-calculator/)

## More free tools

-   [**LLM API cost calculator**Price a workload on every model at once, with cache hits, reasoning and a flat-plan check.](https://broadrouter.com/tools/llm-api-cost-calculator/)
-   [**Speech-to-text cost calculator**Hours, calls or voice notes to a monthly transcription bill, against your current provider.](https://broadrouter.com/tools/speech-to-text-cost-calculator/)
-   [**LLM token counter**Exact token counts with each model's real tokenizer, with a token view and cost.](https://broadrouter.com/tools/token-counter/)
-   [**Arabic token counter**Arabic vs English token counts per tokenizer: the "Arabic tax" in tokens and money.](https://broadrouter.com/tools/arabic-token-counter/)
-   [**Tokens to words converter**Tokens ↔ words ↔ characters ↔ pages, by language and content type.](https://broadrouter.com/tools/tokens-to-words/)
-   [**Context window calculator**Will it fit? Window used per model, room left for output, cost to send.](https://broadrouter.com/tools/context-window-calculator/)
-   [**Flat-rate vs per-token LLM cost calculator**Break-even between an unlimited plan and paying per token, per agent.](https://broadrouter.com/tools/flat-rate-vs-per-token-calculator/)
-   [**Prompt caching savings calculator**Bill with and without caching, by prefix share and hit rate.](https://broadrouter.com/tools/prompt-caching-calculator/)
-   [**Image token calculator**Tokens and cost per image under each model's documented rule. Drop an image; nothing is uploaded.](https://broadrouter.com/tools/image-token-calculator/)
-   [**Self-hosting vs API cost calculator**GPU rental against your current API and BroadNet per-token and flat-plan prices: cost per 1M tokens and break-even volume.](https://broadrouter.com/tools/self-hosting-vs-api-calculator/)
-   [**Embedding cost calculator**Index, update and query costs for a corpus at OpenAI, Google, Voyage, Mistral and Jina list prices.](https://broadrouter.com/tools/embedding-cost-calculator/)
-   [**LLM rate limit and concurrency calculator**Which limit binds first: RPM, TPM or concurrency, with Little's law.](https://broadrouter.com/tools/llm-rate-limit-calculator/)
-   [**JSON schema generator for LLM structured output**Sample JSON to strict schema, Pydantic, Zod and a ready request.](https://broadrouter.com/tools/json-schema-generator/)
-   [**OpenAI-compatible API request builder**One request, copied as curl, Python, Node or the OpenAI SDKs.](https://broadrouter.com/tools/api-request-builder/)
-   [**Audio file splitter for speech-to-text limits**Chunk count, overlap and copy-ready ffmpeg commands to fit a transcription file-size limit.](https://broadrouter.com/tools/audio-splitter-ffmpeg/)
-   [**OpenAI to BroadNet migration helper**Paste OpenAI SDK code; get base URL, key and model edits, a diff and the checks that remain.](https://broadrouter.com/tools/openai-to-broadnet-migration/)
-   [**Arabic text normalizer**Tashkeel, tatweel, alef, ya, ta marbuta, digits and invisible characters, with a matching Python function.](https://broadrouter.com/tools/arabic-text-normalizer/)
-   [**RAG chunking calculator**Chunks, embedding tokens, input per query, context check and monthly LLM cost for a RAG pipeline.](https://broadrouter.com/tools/rag-chunking-calculator/)
-   [**max\_tokens calculator for reasoning models**Answer length + reasoning budget + margin = a max\_tokens that does not cut the answer off.](https://broadrouter.com/tools/reasoning-token-budget/)
-   [**LLM batch job planner**Run time, binding limit, cost per model and the flat sessions needed to finish a big job by a deadline.](https://broadrouter.com/tools/llm-batch-job-planner/)
-   [**LLM JSON output validator**Parse errors by line and column, safe repairs, cut-off detection and JSON Schema checks for model output.](https://broadrouter.com/tools/llm-json-output-validator/)
-   [**Prompt token diff**Two prompt versions side by side: changed lines, exact token delta and the monthly cost difference.](https://broadrouter.com/tools/prompt-token-diff/)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-agent-run-cost-estimator&utm_content=page-cta) ·

**Sources**

-   [BroadNet Inference machine-readable prices (pricing.json)](https://inference.broadnet.ai/pricing.json?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-agent-run-cost-estimator&utm_content=sources)
-   [BroadNet Inference plans: one request at a time per session; typical speed about 100 tokens per second (checked 2026-11-15)](https://inference.broadnet.ai/plans?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-agent-run-cost-estimator&utm_content=sources)
-   [BroadNet Inference API reference: reasoning and cached tokens in usage (checked 2026-11-15)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-agent-run-cost-estimator&utm_content=sources)
-   [BroadNet Inference prices](https://inference.broadnet.ai/pricing?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-agent-run-cost-estimator&utm_content=sources)
