The $0.004 AI Task With a $0.0566 Agent Receipt
01 / A $40 token budget becomes a $566 receipt
A single model call looks cheap: 2,000 input tokens and 500 output tokens. At illustrative rates of $1 per million input tokens and $4 per million output tokens, that is $0.004. Run 10,000 tasks and the budget appears to be $40.
Then an agent framework adds planning, tool execution, validation and repair. The same workload can produce a $566 receipt under the assumptions below. These are worked-example numbers, not provider quotes, measured benchmarks or CheapRelay prices. The point is to expose the multiplication, not predict your bill.
02 / Receipt one: eight calls cost $0.048
Assume one completed workflow uses eight calls: one planner, four workers, one validator, one repair call and one final response. Together, they consume 32,000 input tokens and 4,000 output tokens. Here is the token receipt:
- ■ Original task and supplied context: 2,000 input tokens, $0.002.
- ■ Repeated instructions, role definitions and tool schemas: 4,000 input tokens, $0.004.
- ■ Conversation history replayed across calls: 14,000 input tokens, $0.014.
- ■ Tool results sent back to the model: 12,000 input tokens, $0.012.
- ■ Generated plans, intermediate work and final text: 4,000 output tokens, $0.016.
- ■ Total model cost per workflow: $0.048.
That is twelve times the single-call estimate before retries or external services. The framework might be free software. Its execution pattern is not free.
03 / The largest input charge is yesterday’s context
History replay is easy to miss because your application creates each message once. Billing follows what each request sends, not how many times your application originally wrote the text.
A 2,000-token tool response included in five later requests contributes 10,000 input tokens. Large search results, repository files and verbose error messages become recurring charges when the framework keeps forwarding them.
Log the actual input and output usage for every call. Label calls by purpose, then inspect the biggest repeated payloads. Replacing a full tool response with a bounded extract can matter more than shortening the final answer.
04 / Receipt two: retries and evaluation reach $0.0566
Now assume that, for every 100 accepted results, ten workflows require exactly one complete replay. That means 110 workflow executions for 100 accepted results. Also assume every accepted result gets a separate evaluation call using 2,000 input tokens and 200 output tokens.
- ■ Base workflow: $0.048 per accepted result.
- ■ Full-workflow retry allowance: $0.0048 per accepted result.
- ■ Evaluation call: $0.0028 per accepted result.
- ■ Hypothetical paid trace storage allocation: $0.001 per accepted result.
- ■ Total: $0.0566 per accepted result, or $566 for 10,000.
The trace-storage line is an assumed external expense, not an API token charge. Tool subscriptions, browser sessions, sandbox compute and developer maintenance are excluded. Add them separately rather than hiding them inside a vague agent overhead percentage.
05 / Cache reads need their own receipt line
Caching can reduce repeated-input costs, but cached does not necessarily mean free. Suppose 12,000 input tokens qualify for cache reads priced at an illustrative $0.10 per million tokens. Those reads cost $0.0012 instead of $0.012, saving $0.0108 on that workflow.
That calculation excludes cache-write charges. Check write pricing, expiration and actual read eligibility before budgeting the saving. A changing prefix or expired cache can erase the expected benefit.
06 / Buy tokens cheaply, then stop buying unnecessary ones
CheapRelay offers pay-as-you-go access to multiple model providers through one key, with no monthly fee or subscription. Billing is per real token, including cache reads and writes. Its OpenAI-compatible routes let you keep existing SDK integrations while comparing actual workflow spending. Sign up for CheapRelay and test a small, instrumented batch before committing your production budget.
Track dollars per accepted result alongside quality, not just price per million tokens. Keep useful validation; remove redundant calls, cap tool payloads and retry failed steps instead of whole workflows where safe. The cheapest token is still the one your agent never sends.
Sign up Try the prices yourself, sign-up credit included.
More reading
| Date | Aisle | Written in | Title |
|---|---|---|---|
| 2026-10-26 | Spend less | EN | $30 a Month for AI: An Indie Hacker’s Receipt A $30 monthly AI budget with token math, cache allowances, retry limits, and practical spending controls for solo builders. |
| 2026-10-26 | Spend less | EN | $3.45 for 95 accepted answers beats cheap tokens A worked receipt shows why token prices can mislead: count retries, rejected outputs and cache charges before ranking models. |
| 2026-10-26 | Spend less | EN | $2.53 for 10,000 JSON Jobs: Read the Receipt A worked JSON-output budget: token costs, schema overhead, retries, and the checks that keep cheap API calls from becoming expensive workflows. |
| 2026-10-26 | Spend less | EN | $0.012 Either Way: Streaming Changes the Habit A token-by-token receipt shows why streaming has no automatic discount, but stopping early and avoiding retries can change your API bill. |
| 2026-10-26 | Spend less | EN | $1.71 to $1.02: A Long-Chat Summarisation Receipt A worked token receipt shows when summarising chat history saves money, including the summary fee, break-even point and caching caveats. |
| 2026-10-26 | Spend less | EN | ¥0.32 for a 100,000-token translation batch A worked translation receipt shows how to rank model quotes by yuan spent, then adjust for retries, cache charges and human review. |