An AI agent rarely makes one API call per task. It plans, calls tools, reads the results and calls the model again, and each step usually re-sends the growing conversation. This calculator prices a task as a series of model calls so you can see how steps, context growth and caching drive the bill.
How the estimate works
- Input for step n = input tokens per step + context growth per step × (n − 1). This models the history the agent re-sends on every call.
- Each step is billed at the selected model’s published rates. Your cached-input share is billed at the cached rate where the vendor publishes one, and output tokens at the output rate. If a step’s input crosses a long-context threshold, that step uses the long-context rate.
- Cost per task = the sum of all steps + your external tool cost per task.
- Monthly cost = cost per task × tasks per day × days per month.
- Compare all models runs the same workload through every model with verified standard rates, cheapest first.
The default inputs are examples only, not measured agent traces. Replace them with step and token counts from your own logs.
What the result does not include
Agent hosting, vector databases, monitoring, retries after errors, web-search or tool fees that you haven’t entered, batch discounts and tax. A step whose prompt is larger than the model’s context window is flagged rather than priced as if it fits.
Related
API cost calculator · Prompt caching savings calculator · Context window cost calculator · LLM API pricing · Tokens explained
How we check prices
Per-token rates come from each vendor’s official pricing documentation. We rechecked the Anthropic, OpenAI, Google, xAI and Perplexity rates on 18 November 2026 (Asia/Colombo). DeepSeek and v0 rates date from 3 November 2026. Prices are USD and exclude tax. Corrections: [email protected].