AI Agent Token Budget Calculator

Estimate token usage and model cost per agent run and per month. The calculator also suggests a hard token cap above the current estimate so a looping agent cannot consume an unlimited budget.
Set a Token and Cost Budget
Use average tokens per model call, including repeated context sent on later agent steps.
Estimated monthly cost
$688.00
Estimated cost per run
$0.0688
Tokens per run
23,600
$0.04 input + $0.0288 output
Suggested hard cap per run
30,000 tokens
25% above the current estimate; monthly volume is 236,000,000 tokens
Estimate excludes cached-token discounts, reasoning-token billing, embeddings, tool APIs, retries beyond the entered call count, and provider minimum charges.
What to Include in a Token Budget
Count every model call in the loop: planning, tool selection, reflection, retries, and the final answer. Input tokens include the system prompt, conversation history, tool definitions, tool results, and retrieved memory. Output tokens include both user-facing text and tool-call arguments produced by the model.
Token and Cost Formula
Tokens per run equal model calls multiplied by average input and output tokens per call. Cost is calculated separately for input and output because providers usually price them differently, then multiplied by monthly run volume.
Use effective prices from your bill when caching, batch discounts, or provisioned capacity apply. Add embedding and vector storage separately with the AI agent memory cost calculator.
Why Agent Context Grows
In a simple implementation, every new tool result is appended to the history and resent on the next call. A ten-step run may therefore send much more input than ten times the first prompt. Measure average tokens per call from traces across the whole run, not from the first request.
Summarizing old steps, dropping irrelevant tool output, and retrieving only the memories needed for the current decision can reduce context without reducing the maximum number of steps.
Budget Guardrails
- Enforce maximum model calls, input tokens, and output tokens.
- Set a monetary cap per run in addition to a token cap.
- Stop retries when the same tool error repeats.
- Alert on p50, p95, and p99 cost per successful task.
- Track failed runs so their spend is not hidden from unit economics.
The suggested cap is 25% above the entered average. It is a starting guardrail, not a universal target. Validate it against real high-quality runs before enforcing it.
Frequently Asked Questions
What is a good token budget for an AI agent?
A good budget is the smallest cap that still allows representative successful tasks to finish. Derive it from production traces or an evaluation set instead of copying a fixed number from another agent.
Should cached tokens count toward the budget?
Yes. They may cost less, but they still consume context capacity and can affect latency. Track raw tokens and billed cost as separate metrics.
Do tool calls use tokens?
The external tool may not, but the model uses tokens to choose the tool, generate its arguments, and read the returned result. The tool can also have a separate API or compute cost.
Next Steps
Implement per-call telemetry with the AI agent cost tracking guide and revisit the complete agent workflow to see where each model call enters the loop.
See where agents spend tokens →ai agent token budget calculator — return to the complete AI agent architecture guide.
Was this helpful?
Your feedback stays on this page — no tracking.