What does an AI agent cost to run? Understanding AI token costs
In short: An AI agent pays for the tokens it sends to and gets back from the model on every single run; a rule-based workflow pays for none of them. You can work out the bill in advance: tokens per run times runs per month times the model's list price.
This article is for teams planning an AI workflow who want to know what it costs to run before the first invoice lands. You get the formula, a worked example with list prices and the levers that keep token costs low or avoid them altogether.
Key takeaways
- Token costs hit on every run. Every request to a language model is billed by input and output tokens, even if the workflow does the same thing a thousand times.
- An agent usually calls the model several times per run. Every tool call is a new request that resends the instructions and the history so far.
- The formula is simple. Tokens per run times runs per month times list price, with input and output counted separately.
- Model choice changes the bill dramatically. For the same work, a provider's cheapest and most expensive models are many times apart.
- The cheapest tokens are the ones you never use. Whatever runs as a rule costs nothing but your n8n hosting.
What are tokens, and what are you paying for?
A language model reads and writes text in chunks called tokens. A token is usually shorter than a word. You pay for both directions: the tokens you send to the model (input) and the tokens it sends back (output). With the major providers, output tokens cost considerably more than input tokens.
Input is more than your actual question. Every request carries the instructions for the model, the descriptions of the tools it may use, the data from your system and, for an agent, everything that has happened in the run so far. Anthropic's pricing page, for example, notes that simply enabling tools adds its own system prompt to every request.
Bottom line: you pay for everything the model reads and writes, not just the question.
Why an agent pays on every run and a rule doesn't
A rule-based workflow in n8n checks fields, compares values and writes the result. It never calls a language model, so no tokens are used. Its cost depends on your n8n hosting, either cloud executions or your own server.
An AI agent calls the model on every run, and rarely just once. The model plans a step, calls a tool such as a weclapp search, gets the result back and asks again. Each round is a separate request that resends the instructions, tool descriptions and history. That's why an agent with three rounds usually costs more than three times a single request.
Bottom line: with an agent, costs grow with every run and with every round inside a run.
How to calculate AI token costs
The formula has three parts, and you calculate input and output separately:
Monthly cost = (input tokens per run × input price + output tokens per run × output price) × runs per month
Providers list their prices per million tokens. Don't guess tokens per run, measure them: the API reports input and output tokens with every response. Run the agent on ten to twenty real cases, take the average and only then scale up.
Bottom line: measure tokens on real cases and multiply by the list price before you switch the workflow on.
Worked example: an agent for incoming requests
The numbers below are an example based on assumed values, not a measurement from a client project. Say an agent reads incoming requests, looks up the matching record in weclapp and drafts a reply. It needs three rounds with the model, 12,000 input tokens and 1,000 output tokens per run in total, and runs 2,000 times a month.
That's 24 million input tokens and 2 million output tokens a month. At the providers' list prices as of 2 December 2026, without discounts or caching:
| Model (provider) | Input per 1M tokens | Output per 1M tokens | Example: cost per month |
|---|---|---|---|
| Claude Haiku 5.5 (Anthropic) | $0.10 | $0.50 | $3.40 |
| Claude Sonnet 5.5 (Anthropic) | $2 | $10 | $68 |
| gpt-6.2-sol (OpenAI) | $2 | $10 | $68 |
| Claude Fable 5.2 (Anthropic) | $8 | $40 | $272 |
| Rule-based workflow in n8n | – | – | $0 in token costs |
The table shows two things. First, model choice is a multiplier: the same work costs $3.40 or $272 a month depending on the model. Second, every assumption scales straight through: if the agent needs six rounds instead of three or runs twice as often, the bill grows accordingly, and with more rounds even faster because the history keeps getting longer.
Bottom line: run the numbers with your own measurements and at least two models before you commit.
Subscription or API: what your team plan covers
Many teams already pay for an AI subscription per person, for Claude or ChatGPT, say. The subscription covers working in the chat, within your plan's usage limits. A workflow that runs automatically in n8n talks to the model through the API instead, and the API bills by the token.
For budgeting, that means subscription costs are fixed per person while API costs grow with every run. Check how your provider bills subscriptions and API usage before you put an agent into continuous operation.
Bottom line: an automated workflow with a model costs tokens, however many subscriptions your team has.
How to avoid and cap token costs
Rules before the model. Let a rule handle everything that's clear-cut and only pass the unclear cases to the model. If nine out of ten cases go through the rule, you only pay for the tenth. How to decide what should be a rule and what a model is covered in AI agent or automation?.
The smallest model that does the job. Anthropic explicitly positions its smallest model for classification, extraction and routing. Move to a larger model only when the small one fails on real cases.
Keep the context lean. Send only the fields the model really needs and give it only the tools it should use in this workflow. Every tool description travels along on every round.
Use caching and batch processing. If the start of your request stays the same, providers bill reused parts much more cheaply through prompt caching. If the result doesn't need to be instant, Anthropic's pricing page lists a 50 percent discount on input and output through its Batch API.
Watch your usage. Log the token counts from the API responses and compare them with your invoice every month. An agent that suddenly takes more rounds shows up there first.
Bottom line: most token savings come from letting the model see only the cases a rule can't solve.
What our n8n agents for weclapp cost to run
Most of our free n8n agents for weclapp work without AI, for example matching payments automatically, the best-before and batch alert or creating return labels automatically. They follow fixed rules and never call a language model, so they cost no tokens, however often they run.
That's a deliberate choice. Where a rule is enough, a workflow shouldn't depend on a model provider's pricing. For the workflows worth automating first in weclapp, see our page on weclapp automation.
Bottom line: whatever runs as a rule has no token costs and no exposure to model pricing.
The next step for your team
Which workflows need a model and which don't is best decided on a real process. That's exactly where our AI enablement programme starts: you pick a workflow from your daily work, build it together in a private n8n instance, test it and work out along the way where a model is worth what it costs.
Bottom line: if you run the token numbers first, you'll use AI where it pays for itself.
Checklist before going live
- The workflow can be written down as a rule → build it without a model, no token costs
- Tokens per run measured on ten to twenty real cases
- Runs per month estimated from your data, not from gut feeling
- Costs calculated with at least two models, list price noted with its date
- Clear-cut cases pre-sorted by a rule, only the rest goes to the model
- Only the fields and tools that are needed in the context
- Usage checked against the invoice every month
Sources and limitations
- Anthropic: Pricing (list prices per million tokens for Claude Haiku 5.5, Sonnet 5.5 and Fable 5.2, tool use system prompt, batch discount, prompt caching), retrieved 2 December 2026.
- OpenAI: API pricing (list prices per million tokens for gpt-6.2-sol), retrieved 2 December 2026.
- Workflow files of the free n8n agents for weclapp (wals.pro library): no AI or model node in the agents named, checked 2 December 2026.
The worked example uses assumed values to show the method, not the costs of a real project. Prices are list prices in US dollars excluding tax, discounts, caching or special terms; they change, which is why the retrieval date is given. Your n8n hosting and your own time are not included.
Further reading: AI agent or automation? · weclapp automation: which workflows pay off first · n8n with weclapp
Frequently asked questions
How much does an AI agent cost per month?
It depends on three values: tokens per run, runs per month and the model's list price. Measure tokens on real cases and scale up; depending on the model, the result for the same work can differ many times over.
How do I calculate AI token costs?
Multiply input tokens per run by the input price and output tokens by the output price, add both and multiply by your runs per month. Providers quote their prices per million tokens.
Why does an AI agent use more tokens than a single request?
An agent usually calls the model several times per run, for example after every tool call. Each round resends the instructions, tool descriptions and history so far.
Do n8n workflows without AI cost tokens?
No. A workflow without an AI node never calls a language model and uses no tokens. Its cost depends on your n8n hosting, either cloud executions or your own server.
Does my ChatGPT or Claude subscription cover automated workflows?
A subscription covers working in the chat within your plan's limits. An automated workflow in n8n uses the API, which bills by the token; check with your provider how the two are billed.
How can I reduce token costs?
Let clear-cut cases run as rules, use the smallest model that does the job and send only the fields and tools that are needed. Where the result can wait, providers' caching and batch processing help.