Agent Cost-per-Run Estimator
Describe one agent run as steps: the fixed prefix of system prompt and tool definitions, each step's new input and output tokens, and how often each step repeats. The estimator re-sends the history on every later call the way an agent loop does, applies prompt-cache reads and writes at a hit rate you set, bills retries in full, and multiplies by runs per day or CI runs per pull request. It shows which step and which kind of token the money goes to. Prices come from a table dated to the day it was read from each provider's pricing page, with a warning once it is more than 30 days old, and every price can be overridden. Token counts can be filled from an Agent Trace Viewer export. Everything runs in your browser.
Agent Cost-per-Run Estimator
Client-Side Only
Prices checked 2026-10-06 on each provider's official pricing page. The page warns once they are more than 30 days old. Any price can be overridden.
Model and prices
- Cache write is the 5-minute rate (1.25x input). The 1-hour cache writes at 2x input.
- Batch rates are the 50% Batch API discount; Anthropic says the caching multipliers stack with it, so batch cache rates are derived from the batch input price.
How the agent calls the model
System prompt and tool definitions, sent on every call.
10 means one call in ten is made twice.
For server-side tools billed per call, such as web search. Leave 0 for your own tools.
Steps in one run
One model call per step and repeat. New input is what the step adds: the task, or the tool results returned since the last call.
Fill the steps from an agent trace
How often it runs
Estimated cost
- Per run
- $0.728
- 8 model calls, 325,270 input tokens
- Per day
- $43.69
- 60 runs
- Per month
- $961.08
- 1,320 runs
Where one run's money goes
Patch and rerun the test costs the most: $0.439 of $0.728 per run (60%).
- Read the failure summary$0.021 · 2.9%
- Read the job log$0.061 · 8.4%
- Read the spec and page object$0.084 · 12%
- Patch and rerun the test (4 calls)$0.439 · 60%
- Write the PR comment$0.123 · 17%
By what was sent
- Input: re-sent history$0.458 · 63%
- Input: fixed prefix$0.106 · 15%
- Input: new per step$0.086 · 12%
- Output$0.078 · 11%
Every call in one run (8)
| # | Step | History | Total input | From cache | Output | Cost |
|---|---|---|---|---|---|---|
| 1 | Read the failure summary | 0 | 7,500 | 0 | 400 | $0.021 |
| 2 | Read the job log | 1,900 | 25,900 | 0 | 350 | $0.061 |
| 3 | Read the spec and page object | 20,250 | 35,250 | 0 | 600 | $0.084 |
| 4 | Patch and rerun the test | 29,850 | 38,350 | 0 | 1,200 | $0.098 |
| 5 | Patch and rerun the test (2) | 33,550 | 42,050 | 0 | 1,200 | $0.106 |
| 6 | Patch and rerun the test (3) | 37,250 | 45,750 | 0 | 1,200 | $0.114 |
| 7 | Patch and rerun the test (4) | 40,950 | 49,450 | 0 | 1,200 | $0.122 |
| 8 | Write the PR comment | 44,650 | 51,450 | 0 | 900 | $0.123 |
Token columns are one attempt; cost includes the 10% extra attempts.
Calculated in this browser tab. The estimate is fixed arithmetic over the dated price table. Nothing you enter or paste is uploaded, and no model is called.
Price table, checked 2026-10-06
| Model | Input | Cached | Cache write | Output | Source |
|---|---|---|---|---|---|
| Claude Fable 5.1 | $10 | $0.25 | $12.5 | $50 | Anthropic |
| Claude Opus 5.5 | $4 | $0.2 | $5 | $20 | Anthropic |
| Claude Sonnet 5.5 | $2 | $0.2 | $2.5 | $10 | Anthropic |
| Claude Haiku 4.5 | $1 | $0.1 | $1.25 | $5 | Anthropic |
| GPT-6 Astra | $10 | $1 | $12.5 | $50 | OpenAI |
| GPT-6.1 Sol | $2 | $0.1 | $2.5 | $10 | OpenAI |
| GPT-6 Luna | $0.1 | $0.01 | $0.125 | $0.5 | OpenAI |
| Gemini 3.1 Pro Preview | $2 | $0.2 | $2 | $12 | |
| Gemini 3.8 Flash | $0.75 | $0.075 | $0.75 | $3.75 | |
| Gemini 3.5 Flash-Lite | $0.3 | $0.03 | $0.3 | $2.5 |
Frequently Asked Questions(click to expand)
Why does the history option change the total so much?
Every call is billed for its whole input, and an agent loop's input is the conversation so far. That holds even when the API stores the conversation for you: OpenAI says that with previous_response_id, all previous input tokens in the chain are billed as input. The fifth call pays again for everything the first four sent and received. The estimator adds each step's input and output to the history of every later call, which is why a long loop costs far more than its steps would alone.
How is caching priced?
Only a prefix an earlier request wrote to the cache can be read from it: the fixed prefix, if it reaches the model's caching minimum on its own, and in full-history mode everything the last cached call sent. The hit rate is the share of that part actually read at the cached price. Everything else in the call is billed at the cache-write rate, because writing it is what lets the next call read it. Calls shorter than the caching minimum are priced uncached and write nothing, so the next call cannot read them.
Where do the token counts come from?
From your own runs, ideally. The Agent Trace Viewer reads an OpenTelemetry trace and shows input and output tokens per model call; paste its JSON export into "Fill the steps from an agent trace" to price that run here.
What do retries cost?
Each extra attempt is billed like the first. When retries come from tool timeouts or flaky endpoints, the guide to testing API idempotency, retries and timeouts covers proving a retry is safe before you pay for it.
How do I check a cheaper model is good enough?
Run the same cases against both. The LLM Eval Test-Case Builder turns a run into promptfoo test cases you can point at each model before switching.