AI Agent Cost Per Task Calculator for Tool-Calling Loops
A tool-calling agent re-sends its whole conversation on every step, so input tokens grow roughly with the square of the step count. This calculator makes that visible and prices a task and a month of tasks.
Your numbers
System prompt, tool definitions and the user request.
ERP query results are often truncated rows. Measure yours.
Reasoning text plus the tool call arguments.
Your results
Assumes no prompt caching and no context trimming. Real providers may charge differently for cached input or long contexts.
Cost per task as steps increase
Sweeps Tool-calling steps per task from 1 to 40, holding your other inputs fixed.
Agent cost model review
Share your step counts and we will sanity check the cost model against your ERP workload. Optional.
Optional. The tool and every export work without this. No spam.
How to use it
Set the number of tool calls a typical task needs, the starting prompt size, and the average size of each tool result. Add output tokens per step and your model's prices. The cost per task is the headline. Then drag the steps slider to see what happens when the agent takes twice as many steps because of a vague tool or a failing query. The chart plots cost per task from one to forty steps, which shows the curve bending upward rather than rising in a straight line.
Formula and reading the result
At step i the input is the base prompt plus all earlier results and outputs, so the sum over n steps is n times base plus (result + out) times n(n-1)/2. Output tokens are simply n times the per-step output. Multiply each by its price per million. If the last-step context approaches your model window, the real agent will fail or need truncation, regardless of cost.
- Halving tool result size often saves more than switching models.
- Cutting steps has a compounding effect.
- Prompt caching on the stable base prefix reduces the first term.
Common mistakes
Teams often price one call and multiply by the step count, which understates cost because later calls are larger. Another mistake is ignoring retries and failed tool calls, which add steps. For ERP agents, unfiltered list queries can return thousands of tokens per call; capping rows and returning only requested fields is the cheapest optimization. Add a hard step limit and a budget guard so a confused agent cannot spend unbounded tokens on one task.
Frequently Asked Questions
Why does cost grow faster than linearly with steps?
Because each step includes all previous messages as input. Step ten carries nine steps of history. The sum of those growing inputs scales with steps squared, while output scales linearly.
Does caching remove the quadratic growth?
It lowers the price of the repeated prefix, so growth is cheaper, but the context still gets longer and uncached portions such as new results are billed normally. Check your provider's cache pricing and minimum sizes.
How do I measure average tool result size?
Log the token count of each tool response for a week of real tasks and take the mean or median. ERP queries vary widely, so also look at the 95th percentile to find outliers worth truncating.
Does this apply to self-hosted models?
The token growth does, but the price is replaced by GPU time and capacity. Use your measured tokens per second to convert total tokens into GPU seconds, or compare with an on-prem cost calculator.
Netray builds ERP agents with step limits, trimmed results and models served on your own GPUs, which changes this cost curve. We can model your workload with you.
Related Tools
MCP Tool Definition Context Token Overhead Calculator
Sizes the context window and input cost eaten by MCP tool schemas before the user says a word, and shows the what-if as you add tools.
AI Agents & AutomationPrompt Cache Savings Calculator for Agent Tool Prefix
Compares input spend with and without prompt caching for a stable tool and system prefix, and sweeps cache hit rate.
AI Agents & AutomationAgent Multi-Step Reliability Calculator
Shows how per-step success compounds across an agent workflow, what retries buy you and how many tool calls to expect.
AI Agents & AutomationAgentic Workflow ROI Calculator
Turn monthly task volume, manual handling time, and automation rate into a realistic monthly and annual ROI for an agentic AI workflow, net of platform and token costs.
More AI Agents & Automation tools
See all- Business Process Automation ROI Calculator
- AI Agent Use Case Prioritizer
- Document Processing Automation Savings Calculator
- AP Invoice Automation ROI Calculator
- Order Entry Automation Savings Calculator
- Quote-to-Cash Cycle Time Calculator
- Manufacturing AI Readiness Assessment
- RPA vs AI Agent Selector
- ERP AI Maturity Assessment