AI agent cost in production: what a company actually pays each month

·10 min read

Imagine a fifteen-person services company testing an AI agent. It reads incoming email requests, finds the customer in the CRM and drafts a reply that an employee checks before sending. During testing, a few dozen requests barely register on the API bill. The risk appears when the agent takes over the whole flow: the model provider's monthly invoice can then land well above what the manager had in mind.

That gap would rarely come from the advertised price. It would come from what nobody counted: model calls per request, the context re-read at every step, retries, the executions billed by the automation tool, and the team's checking time.

This article breaks down AI agent cost in production using the vendors' public price lists, then shows how to estimate the bill before launch and monitor it afterwards.

What makes up AI agent cost in production

The monthly spend has five components:

  • Model tokens. At Mistral AI (the French model provider) and at Anthropic, most models are billed per million tokens, with input (what you send) and output (what the model generates) counted separately (Mistral pricing, Claude pricing).
  • Orchestration. The tool that triggers the agent and chains the steps together, for example n8n.
  • Paid tools. Web search through the Claude API costs $10 per 1,000 searches, tokens not included (Claude pricing). Mistral's OCR is billed per batch of 1,000 pages.
  • Monitoring. Logs, alerts, and the time to read them.
  • Human review. Time spent approving and correcting outputs.

The last two never show up on a vendor invoice.

Why an agent uses more tokens than a chatbot

A simple chatbot makes one model call per question. An agent works in a loop, which Anthropic's documentation describes this way. The model asks for a tool and your application runs it. The application then sends a new request containing the original messages, the model's response and the tool result.

So at every step, instructions, tool descriptions, the initial request and previous results are billed again as input. A five-step task pays for the start of the conversation five times.

Three factors push the bill up. The first is tool results that are too long, such as a full CRM record when three fields would do. The second is too many declared tools, since their descriptions go out with every request. The third is unnecessary steps. In n8n, the Max Iterations option of the AI Agent node (how many model turns before the agent stops) is 10 by default.

One last trap: on Claude Haiku 5.5, once a prompt exceeds 100,000 tokens, the price per million tokens is multiplied by five, for input and output alike (Claude pricing, November 13, 2026). A growing history can cross that threshold without anyone noticing.

Estimating the monthly bill before launch

The formula fits on one line:

monthly token cost = tasks per month x (input tokens per task x input price + output tokens per task x output price)

Tokens per task means the total across all steps. I recommend measuring it on about twenty real tasks, including the difficult cases, using the usage fields the API returns with each response.

Worked example. The assumptions are illustrative and should be replaced with your own measurements. Only the prices come from a source: Claude Sonnet 5.5 at $2 per million input tokens and $10 per million output tokens (Claude pricing, November 13, 2026).

  • 1,500 requests per month, 5 model calls per request.
  • Fixed part (instructions and tool definitions): 6,000 tokens. Customer request: 1,500 tokens.
  • Each step adds 300 generated tokens and 1,000 tokens of tool result. Final answer: 600 tokens.

The five calls send 7,500, 8,800, 10,100, 11,400 and then 12,700 tokens: 50,500 input tokens and 1,800 output tokens per request. Over a month, that is 75.75 million input tokens ($151.50) and 2.7 million output tokens ($27), about $178.50 in total.

As a single call, chatbot style (7,500 input tokens, 600 output), the same request would cost about $31.50 a month. Input accounts for 85% of the agent's bill, so input is what you should reduce first.

Cost levers documented by the vendors

Prompt caching

Anthropic's prompt caching lets the API resume from the beginning of a request it has already processed (tools, system instructions, messages). In automatic mode, a single cache_control field is enough, and the cache point moves forward with the conversation. That suits an agent loop.

Writing to the cache costs 1.25 times the input price for a 5-minute duration and 2 times for one hour. Reading costs 0.1 times the input price, or 0.05 times on Opus 5.5 and Sonnet 5.5. The cache lasts 5 minutes by default and is extended at no extra cost each time it is used.

Two precautions apply:

  • Below a minimum size (512 tokens on Sonnet 5.5), nothing is cached and no error is returned. Check that cache_read_input_tokens is above zero from the second call onwards.
  • The cache only works if the beginning of the request stays identical. Keep instructions and tools stable, and put whatever changes at the end.

In the example, the bill drops to about $80 if the five calls of a request fall within the 5-minute window. Each request then writes 12,700 tokens to the cache (the first call, then the 1,300 tokens added at each step) and reads 37,800, at $2.50 per million written and $0.10 per million read. To stay conservative, nothing is reused from one request to the next. Mistral advertises up to 90% off cached input tokens for repeated prompts (Mistral pricing).

Batch processing

The Message Batches API bills all usage at 50% of the standard price. Most batches finish in under an hour, but a batch can take up to 24 hours and expires after that. The discount stacks with caching, and the documentation recommends the 1-hour cache for batches with shared context, since a batch can run longer than 5 minutes. Each request in a batch is a standalone call, so batches suit non-urgent single-call tasks, such as enriching CRM records overnight. They do not suit an agent loop where each step waits for a tool result. Mistral also lists a 50% discount for batch processing.

A small model for triage

Anthropic positions Claude Haiku 5.5 for high-volume tasks (classification, extraction, routing). It costs $0.10 per million input tokens and $0.50 per million output tokens under 100,000 prompt tokens. Placed at the start of the workflow, it filters out ads, out-of-office replies and duplicates. To compare with a European or open model, see open vs proprietary AI models and a day testing Mistral AI.

Scenario (example assumptions) Monthly tokens, estimate
Sonnet 5.5 agent, no optimization about $178.50
With prompt caching about $80
With caching, and 40% of requests filtered out by Haiku 5.5 triage about $48.50
For comparison, a single call per request about $31.50

Third row: triage reads all 1,500 requests (1,800 input and 50 output tokens each, about $0.30 a month), and the cached agent then handles only 900. The 40% rate is arbitrary, so measure your own.

Capping steps and response length

The max_tokens parameter limits the output of each call. When the limit is reached, the loop stops with the max_tokens stop reason, and your workflow has to handle that case. In n8n, set Max Iterations to the number of steps the task actually needs.

Orchestration: n8n Cloud or self-hosted

According to the n8n pricing page (November 13, 2026), n8n Cloud is billed by monthly executions. Starter costs €20 per month billed annually for 2,500 executions, and Pro costs €50 per month for 10,000. If you use your own API keys, the model provider bills tokens separately. The same page also lists AI models without API keys and "Gateway credits" included on Starter and Pro. Check how that usage is counted before you build your budget on it.

An execution can last at most 5 minutes on Starter and 40 minutes on Pro, and Starter allows 5 concurrent executions. According to the n8n FAQ, a workflow scheduled every 5 minutes uses about 8,600 to 8,900 executions a month on its own. The 1,500 event-triggered requests in the example fit within Starter, but not if the agent also polls a mailbox every 5 minutes.

The self-hosted Community edition is free, but hosting is not. On top of the server, someone has to handle updates, backups, safekeeping of the encryption key and monitoring of the machine. I advise against it if nobody can administer and secure a server. For an example setup, see the self-hosted stack with Hetzner, Coolify and n8n.

Hidden costs: retries, human review, monitoring

Retries. Every new attempt is a new request, billed with its full context. In n8n, the Retry On Fail option, for example on the HTTP Request node, reruns the node up to the number set in Max Tries (n8n documentation). An agent may also retry on its own after a tool error: in the example, a request that runs to 10 iterations sends 133,500 input tokens instead of 50,500. I recommend keeping automatic retries for temporary technical errors and sending business errors to a person.

Human review. This is often the largest item: review minutes per task x number of tasks reviewed x the person's hourly cost. To decide what should be reviewed, see where to put human approval.

Monitoring. n8n Cloud keeps execution logs for 7 days on Starter and 30 days on Pro. Log the usage of each execution in your own table and count the time spent on alerts (see n8n error handling in production).

Monitoring costs after launch

One workspace per agent. In the Claude Console, each workspace can have a monthly spend limit and per-model rate limits. A spend limit cannot be set on the default workspace, so create a dedicated workspace for the agent with its own API key. Treat that limit as a guardrail rather than an exact cap: according to the batch processing documentation, batches can slightly exceed it. At Mistral, the Mistral Studio dashboard breaks down usage and costs by service.

Cost per task rather than the total. A rising total may simply reflect more requests. A rising cost per task points to a loop, longer tool results, or a cache broken by a prompt change. A daily workflow can calculate it and notify a named person above a threshold set from the first few weeks. Each month, compare the actual bill with the initial estimate.

Checklist before putting an agent into production

  • Tokens per task measured on real tasks, prices checked against the current price list.
  • Caching on, non-urgent tasks in batches, triage by a small model.
  • Max Iterations, max_tokens and retries capped.
  • n8n plan chosen from actual executions, scheduled workflows included.
  • A workspace, an API key and a spend limit for the agent.
  • Daily alert on cost per task, review time assigned to someone.

A budget you read as cost per task

AI agent cost is managed task by task: calls, re-read tokens, retries, minutes of review, all measurable during testing. To choose which use case to start with, see how to pick a first AI project. At Kirako, we design AI agents and n8n automations and account for these running costs from the design stage.

Sources

Checked on November 13, 2026:

Also available: Read in French