Cost sheet
It calculates the cost per successful task. The calculation is tokens times price, plus retries and human review, divided by the success rate. A token is a small piece of text, a few letters long: the provider charges for the model per token.
It has an example with simple numbers, a sensitivity table and a budget with a hard stop. The sensitivity table shows how the cost changes when each value changes. Write down the date of the prices, because they change.
Copy the block with the button in its corner, or open the file on GitHub.
# Cost sheet: [agent name]
<!--How to use this template:- Measure cost per successful task, not cost per token. A token is a piece of text: the provider charges for each one.- Take tokens, attempts and success rate from the evaluation, not from a guess.- Write down the date of the prices. Prices change, and sometimes they go up.-->
- Agent and task: [...]- Model and version: [...]- Prices checked on: [YYYY-MM-DD], at: [provider's pricing page]
## Inputs
| Input | Value | Where it comes from ||---|---|---|| Input tokens per attempt | [__] | Includes the context resent on every turn and the tool definitions. Doesn't count tokens read from cache. || Cached input tokens per attempt | [__] | The part of the context the provider already stored (cache) and bills at a lower price. || Output tokens per attempt | [__] | Includes reasoning tokens: they are billed as output. || Input price (USD per million tokens) | [__] | Pricing page, with date. || Cached input price (USD per million tokens) | [__] | Pricing page, with date. It is a fraction of the input price. || Output price (USD per million tokens) | [__] | Pricing page, with date. || Attempts per task (with retries) | [__] | Evaluation or production. || Success rate per task | [__] | Evaluation: the share of tasks the agent solves within the retry budget (pass@1, success in a single attempt, if there are no retries). || Minutes of human review per task | [__] | Measured with the reviewer. || Cost of one review hour (USD) | [__] | HR or finance. |
## Formulas
```cost per attempt = input tokens × input price / 1,000,000 + cached tokens × cached price / 1,000,000 + output tokens × output price / 1,000,000model cost = cost per attempt × attempts per taskreview cost = review minutes / 60 × cost of one hourcost per successful task = (model cost + review cost) / success rate```
The success rate in this formula is the probability of solving a task within the allowed retries. Don't use pass^k here: pass^k measures whether all k attempts succeed, and it serves as the exit criterion in plan-de-evaluacion.md.
## Example
<!-- Made-up numbers to show the math. These are not real prices. -->
| Input | Value ||---|---|| Input tokens per attempt | 40,000 || Cached input tokens | 0 (the example doesn't use cache) || Output tokens per attempt | 2,000 || Input / output price | USD 2 / USD 10 per million || Attempts per task | 1.5 || Success rate | 80% || Review | 3 minutes at USD 30 per hour |
- Cost per attempt: 0.08 + 0.02 = USD 0.10- Model cost: 0.10 × 1.5 = USD 0.15- Review cost: 3 / 60 × 30 = USD 1.50- Cost per successful task: (0.15 + 1.50) / 0.80 = USD 2.06
In this example, human review costs 10 times more than the model. A cheaper model barely moves the total.
Someone also handles the tasks that fail. Add that cost separately: [__].
## Comparison
| Option | Cost per successful task ||---|---|| Agent | [__] || Person alone | [minutes × cost of one hour] || Fixed workflow | [__] |
## Sensitivity
| If this happens | Cost per successful task ||---|---|| Attempts rise to [3] (loops, retries) | [__] || Success rate drops to [60%] | [__] || Price per token doubles | [__] || Review rises to [10] minutes | [__] |
## Budget with a hard stop
- Cap per task: [__] tokens or [__] steps. When it is reached, the agent stops and hands the case to a person.- Cap per day: USD [__]. Alert at [__]%, cutoff at 100%.- The agent's own code enforces the cutoff, not only the provider's dashboard.- If the spend meter fails or doesn't respond, the agent stops.- Who can lift the cutoff: [role].
## Why this is here
- The cost that matters is cost per successful outcome, not cost per token: *Price is not cost* (r/OpenAI, 2026). Measure cost and accuracy together: *Holistic Agent Leaderboard* (Kapoor et al., 2025).- More agents cost more. For the same game, a single agent cost 9 dollars and the game did not work. A three-agent harness (the code that coordinates the agents) cost 200 dollars and the game was playable: *Harness design for long-running application development* (Anthropic, 2026).- Tool definitions are tokens too. MCP is a protocol to connect tools to the agent. 58 tools from 5 MCP servers take up about 55,000 tokens before the work starts: *Introducing advanced tool use on the Claude Developer Platform* (Anthropic, 2025).- Prices also go up. From 1 January 2027, Google doubles the price of Gemini 3.8 Flash: *Gemini Developer API pricing* (Google, checked on 1 November 2026).- Review is part of the cost. With the agent, the slowest part of the work moved from writing code to reviewing it: *Ten Months with Copilot Coding Agent in dotnet/runtime* (Stephen Toub, 2026).