NotCheap MAKE EVERY CREDIT COUNT
Analyze Your Costs

The Real Cost of Running an AI Agent in 2026

Budget the job you want your agent to finish, then count what it uses along the way. A research task might need several model calls, three searches and a second attempt at a poor answer. Those resources can cost money even if you still need to fix the result yourself. A useful budget therefore tracks both the bill per attempt and the cost per accepted result.

Share this guide

Count the model calls, not just the final answer

The model may receive earlier messages and tool results again on later calls. How much you retain matters: a short final answer can follow a large amount of paid input. Summaries and trimming change the input; prompt caching changes the price of eligible repeated content rather than making that content disappear.

For a worked example, use Claude Sonnet 5.5 at $2 per million uncached input tokens and $10 per million output tokens. These are standard USD reference rates, without caching, batch discounts or regional premiums.

Assume ten calls whose input rises from 1,000 to 10,000 tokens in steps of 1,000. Each produces 800 total billable output tokens, including any thinking tokens. These are invented workload sizes for the arithmetic, not an observed agent or a promise that a task fits that allowance. Input includes the retained history and tool content.

CallInput on this callInput paid for so farOutput on this call
11,0001,000800
55,00015,000800
1010,00055,000800

The ten calls use 55,000 input and 8,000 output tokens. That costs (55,000 ÷ 1,000,000 × $2) + (8,000 ÷ 1,000,000 × $10) = $0.19. Ten flat calls with 1,000 input tokens each would use only 10,000 input tokens. That 5.5-fold input difference belongs to this example; it is not an unavoidable multiplier for every agent.

Check tools and running time separately

Anthropic's rate card lists web search at $10 per 1,000 searches, plus tokens. Three billable searches add $0.03. A search error does not incur that search invocation fee, so counting every error as a paid search would overstate the bill.

Claude Managed Agents adds $0.08 per hour of running session time. Time in idle, rescheduling or terminated status is excluded. Twenty running minutes cost $0.026666…; twenty minutes spent waiting in idle status do not incur that runtime charge. Read the session status rather than treating all elapsed time as billable.

The Messages API code-execution rules are different. Including compatible web search or web fetch in the request removes the extra execution charge beyond tokens. Otherwise, the documented allowance is 1,550 container-hours per organization per month, then $0.05 per container-hour, with a five-minute minimum. Check which product's meter applies before adding a sandbox charge to a managed-session estimate.

On xAI's rate card, web search, code execution and attachment search are each $5 per 1,000 calls; collections search is $2.50. X search instead costs $5 per 1,000 posts or $10 per 1,000 profiles fetched. A call limit alone does not bound a per-item bill.

Decide how many retries you will pay for

Suppose each original model step has a 15% chance of needing one repeat, with at most one retry. Assume that repeat has the same token cost and does not repeat a paid tool. Expected extra token spend is 15% × $0.19 = $0.0285. This allowance does not guarantee that the second attempt succeeds.

Retrying until success is a different model. With an independent 15% failure probability on every attempt, the expected attempt count is 1 ÷ (1 − 0.15) = 1.17647, adding about 17.65% to token spend under the same fixed-cost assumptions. Longer error messages, repeated searches and restarting the whole task change that calculation. Use billed usage from your logs; error policies differ by service.

Put the example into a monthly budget

Keep the ten calls and capped retry assumption above. Allow three billable searches in total and twenty running minutes including retries. The table prices only these model, search and runtime resources; it is not the full operating cost of a deployed agent.

Budget linePer attempt, USD1,000 attempts10,000 attempts
Base input and output$0.1900$190.00$1,900.00
Expected retry tokens$0.0285$28.50$285.00
Three web searches$0.0300$30.00$300.00
Twenty running minutes$0.026666…$26.67$266.67
Total, rounded at the endabout $0.275167$275.17$2,751.67

Multiply the unrounded sum by volume before rounding the invoice estimate. Using a rounded $0.28 per attempt would give a different monthly total. These are attempt counts, not a forecast of successful customer outcomes.

Add what happens around the API calls

Persistent memory may involve embeddings, storage, reads, writes and retention. Your own workers, monitoring and human review also need budget lines. Their cost depends on your setup; this example assigns no price to them and makes no claim that they are negligible.

Run a representative sample and record resource use, accepted results and review time. Divide total spend by accepted results to compare useful delivery. If you change models, measure again: token counts, tool behavior and success rates can change together. The OpenAI Agents API guide covers another managed setup; our API price comparison helps with token-rate context.

For packaged options, see Manus, ChatGPT Work and Claude Agent. Match the billing unit to your job: support resolutions, Gorgias support outcomes, voice minutes or coding work. For broader workflows, compare n8n, Zapier and Make agents, enterprise automation and project-management AI.

Common questions

Should I budget per agent or per completed task?

Keep the resource bill per attempt, then measure cost per accepted task. One always-on agent may handle many tasks; one difficult task may need several attempts and human review.

Will a retry allowance cover every failure?

No. The example covers one possible repeat of each model step. A full restart, repeated paid tools or a changing prompt needs its own allowance.

Which number should I measure first?

Start with total billed usage and accepted results for the same sample. Then inspect the expensive runs to find whether context, tools, retries or running time caused the extra spend.

Sources and scope

The primary pricing and tool-rule pages linked above were checked on 2 November 2026. The example is an independent calculation with stated assumptions. It corrects earlier idle-time billing, code-execution allowance and retry assumptions; it is not evidence of a tested workload or a historical price-change date.

PASS IT ON

Useful for your team?

Share this guide with a colleague.