estimate_agent_cost
Estimate AI agent run and monthly costs, including per-step context growth, prompt caching savings, and alternative model pricing for budgeting.
Instructions
Estimate what one run of an AI agent costs, and a month of runs. Models what per-call math misses: each agent step re-sends the whole conversation (system prompt, tool definitions, earlier outputs and tool results), so input tokens grow every step. Returns cost per run and per month, the per-step token breakdown, how much of the input is context growth, what prompt caching saves, and the same run priced on other current models (Claude, GPT, Gemini, DeepSeek by default). Use for: 'what will my agent cost at 50k runs a month', 'is Sonnet or Haiku cheaper for this agent', 'how much does caching save', 'budget for an AgentCore / LangGraph / Agents SDK agent'. Defaults describe a typical 8-step tool-using agent; pass measured token counts for a real figure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model ID as in the LLM catalogue, e.g. 'claude-sonnet-5-5', 'gpt-5-mini', 'gemini/gemini-2.5-flash'. Find IDs with lookup_extended_model_pricing. | |
| steps | No | LLM calls per run, including the final answer. | |
| hosting | No | Add hosting to the token cost: prices the run on AgentCore Runtime (+ Gateway, Memory) and on Lambda, and returns full per-run and monthly totals. AgentCore bills CPU only while active; Lambda bills the whole run. | |
| provider | No | Host to price on, e.g. 'anthropic', 'bedrock', 'vertex'. Default: the model's first-party provider. | |
| compare_models | No | Model IDs to price the same run on. Default: popular current Claude, GPT, Gemini and DeepSeek models. | |
| runs_per_month | No | Agent runs per month. | |
| user_input_tokens | No | Tokens in the user's request. | |
| system_prompt_tokens | No | Tokens in the system prompt. | |
| output_tokens_per_step | No | Average model output tokens per step. | |
| tool_definition_tokens | No | Tokens in the tool/function definitions sent with every call. | |
| tool_result_tokens_per_step | No | Average tokens a tool returns per step. |