How much does it cost to implement an AI agent in a SaaS?

The model price is not the TCO (total cost of ownership: what it costs to deploy and operate the agent, not just the model). Split that cost into five lines and measure it per successful action.

the open ai logo is displayed on a computer screen

The investment of adding an agent to a SaaS is not the model price. It is a TCO (total cost of ownership): what it costs to deploy and operate it, split into five lines and measured per successful action.

There is no closed price for an AI agent in a SaaS. There is a TCO, and that number splits into five lines and is measured per successful action: if the cost of an action exceeds the value it creates, the case does not go in.

The most expensive mistake is not picking the wrong model, but budgeting only tokens. Three months later, 70% of the spend is usually in engineering, operations, and the time of people who already had a roadmap.

The model price is not the TCO

When someone asks how much it costs to integrate AI into a SaaS, they almost always show a sheet with API rates. That sheet helps, but it does not answer the question: the model is the most visible line and, in many cases, also the smallest.

A weekend demo costs little. Taking that same flow into a multi-tenant product (several customer accounts, with permissions, traces, a cost limit, and someone on call) changes the order of magnitude, not because the model suddenly gets more expensive, but because the system around it appears. We cover that in the demo versus production checklist. Here we stay with the bill. Why the token price is not the cost of the agent is a separate breakdown.

Those costs show up as three numbers, each with a different owner.

Model cost. Input tokens, output tokens, cache, and tool calls (each time the agent calls an API or a tool). Finance sees it on the provider invoice. It changes every quarter. You can cut it with a smaller model, cache, and less context.

System cost. Identity, permissions per tenant, observability, evaluation, queues, retries, rollback. Engineering sees it. It does not show up on the API rate card, and it is what decides whether the agent scales or stays a pilot.

Decision cost. Hours from the CEO, CTO, legal, and product to approve the case, define acceptable risk, and decide whether to build or buy. Every month in limbo is a month without learning.

If the business case only has the first line, it is not a business case: it is a token budget.

The five line items that belong on the sheet

Before you ask a vendor or your team for a number, write these five lines. If any of them stays blank, the TCO is incomplete.

1. Model and execution. Price per million tokens, cache, embeddings if there is RAG (retrieving documents to give the model as context), and above all tool calls. Every time the agent touches your API, an MCP (a protocol to connect the agent to tools), or a sandbox, you pay inference plus infra. Treat providers' public pricing as a floor, not a cap. The real price goes up with retries, long context, and reasoning models.

2. Product engineering. Turning your API into tools, injecting context per tenant, defining permissions, and standing up the harness (the layer that runs, limits, and observes the agent). This is not an intern and a weekend: it is the work that makes the agent talk to your SaaS and not to a generic PDF.

3. Operations and quality. Traces, evaluation, regression datasets, alerts, on-call. An agent without measurement is variable cost without a brake. This is where you decide whether you can drop to a smaller model or whether you are operating blind.

4. Risk and support. Errors that reach the customer, tickets, compliance (GDPR and the AI Act), human review on flows that write. The cost is not only a hypothetical payout: it is Customer Success time and brand wear.

5. Opportunity cost. What the team stops doing while it builds the agent. If the product roadmap is already tight, doing it in-house is not free: it is postponing what pays payroll today.

DORA software delivery research has been saying the same thing for years: performance is not set by the tool you buy, but by the team's delivery capabilities. With agents, that sentence translates into euros per month.

Upfront investment: what you pay before the agent touches a customer

The cost of implementing an AI agent does not start when the user opens the chat. It starts when someone decides which case deserves production.

In a typical B2B SaaS, the upfront investment looks like this. These are ranges, not closed budgets. The low end assumes a narrow case and a team that already has clean APIs.

Discovery and scope cut (1-3 weeks). Pick a flow with measurable value, define what counts as success, and decide what the agent will not do. Cheap in money and expensive if you skip it, because an open scope multiplies the rest.

Integration with your product (2-8 weeks). Expose endpoints as tools, auth per tenant, real context, limits. If your API is already coherent, you land on the low end. If the agent has to "understand the company" through prompts, you land on the high end.

Production layer (2-6 weeks, in parallel or after). Logs, cost per run, minimum evaluation, spend limit, rollback. This is the work the demo does not show, and the work that prevents the invoice surprise.

People. A platform or AI engineering profile part-time or full-time, plus hours from product and from someone who knows the domain. Salary does not go on the vendor slide: it goes on yours.

A useful range for a committee: standing up the first usable agent in product is usually between a few weeks of a senior profile and a quarter of a small team, plus model spend from the tests. The €5,000 POC (proof of concept) over two Saturdays exists, and it is almost never the system you want to put in front of a customer.

If the case is a read assistant over internal docs, the upfront compresses. If the agent writes in the customer's tenant (creates objects, changes states, fires workflows), the upfront stretches, and it should stretch.

Recurring cost: tokens, tool calls, and people on call

Monthly spend is not a flat license. It is volume times complexity times required quality.

Model. A simple conversation turn, with little context and a light model, can cost cents of a dollar or less. The same turn with a long history, RAG, a reasoning model, and five tool calls goes to tens of cents or more than a dollar. Multiply by conversations per month. It stops being "the cost of AI" and becomes a COGS line (cost of goods sold: what eats margin per customer).

Tool calls. In product, the agent does not only talk: it calls. Each call to your API consumes orchestration tokens. If there is a sandbox or connectors, also infra. That is why we measure by tool call and not only by token: it is the unit that looks like a product action.

Observability and evaluation. Retaining traces, running evals, keeping a regression dataset. Cheap at first, and it grows when you want to catch failures before the customer does. Cutting here saves today and pays for incidents tomorrow.

Operations people. Someone looks at failures, tunes prompts, decides when to change models, and handles the case that left the lane. Even if it is 20% of a profile, it is recurring. If nobody has it on the org chart, the cost still shows up: in the CTO's late-night Slack.

A practical rule: if you cannot say how much a successful action costs you this week, you do not have a TCO, you have an invoice you have not read yet.

Unit economics: how much you can afford per conversation

The business case is not approved with an annual total. It is approved with an inequality.

Cost per successful action < value captured by that action × success rate.

Example, without inventing a customer. An agent that resolves a support ticket with €12 of internal cost. If it is right 70% of the time and the remaining 30% escalates to a human (with the human cost plus the failed attempt), the combined cost still has to stay under those €12. If the model alone already eats €2 per conversation and there are retries on top, the problem is not that "AI is expensive": it is that this flow should not be autonomous yet.

Three levers you do control.

Cut scope. Fewer tools, less context, less freedom to wander. The cheapest agent is the one that does one thing.

Drop to a smaller model when evaluation allows it. The large model is for the 10% of hard turns, not for saying hello. Without evaluation you do not dare to drop, and then you pay the premium forever.

Put a limit. Cap per tenant, per thread, and per day. A retry loop with no cap turns a cent into an invoice. We have seen it more times than we like to admit.

If you sell a SaaS with 70-80% gross margin, an agent that adds 15 points of COGS in the segment where you turn it on is not innovation: it is a pricing decision. Either you raise price, or you pick a flow where value per action is higher, or you do not turn it on across every plan.

A business case a CEO can sign

For the committee, one page and four numbers fit. You do not need slides about "AI potential".

1. Case and metric. Which flow, which action counts as success, who the user is. If it does not fit in one sentence, it is not ready to budget.

2. Upfront investment. Engineering weeks plus test cost. Include the production work, not only the prototype.

3. Recurring cost at volume. Three scenarios: 1,000, 10,000, and 100,000 actions per month. In each one, model + operations + support. The middle scenario is usually the most honest.

4. Payback. In which month the value (hours saved, conversion, retention, tickets avoided) covers upfront + recurring. If payback depends on a volume you do not have, the case is a bet, not a plan.

Add a line for "what happens if the model changes price", because it will change. If the TCO cannot take a 30% rise in inference, the number is not closed yet.

Add another for risk: what percentage of actions needs a human, and what that human costs. The agent that "almost" resolves and then escalates everything is more expensive than having no agent.

Signs the number does not add up

You do not need a sophisticated financial model: these signs are enough to stop. The team estimates tokens and says the rest will come later, when the rest is the project. Nobody knows the cost per thread this week, so nobody can decide whether to drop to a smaller model. The use case writes to customer data and there is still no spend limit and no owner, and the hidden cost is the incident. ROI (return on investment) is calculated with a 95% accuracy that nobody has measured: measure first on 5% of traffic. And the "we'll build it ourselves" alternative does not include platform, evaluation, or on-call, so you are comparing a prototype with a product.

If several of these are true, you do not need a cheaper vendor: you need a narrower scope or more weeks of system. The price of creating an AI agent in-house is not the salary of whoever writes the first prompt. It is the cost of operating it in month 6, when the model has changed twice and the person who built it is already gone.

How to lower TCO without shrinking the business case

There are ways to spend less that do not consist of picking the weakest model and hoping it works.

Start on one plan or one segment. Unit economics are learned with real volume, not with an extrapolation from 40 demos. A free plan or an instrumented pilot is for that: seeing tool calls, tokens, and failures before you commit the margin of the whole base.

Measure by agent, not by account. A support agent and an onboarding agent do not have the same cost or the same value. If you mix them, the one that destroys margin hides behind the one that creates it.

Cache, minimum context, just enough tools. Every document you stuff in "just in case" is paid on every turn. Every extra tool is a chance to get it wrong and retry.

Do not build the platform layer twice. Observability, permissions, a cost limit, and MCP on your API are platform work. If your team stands that up for a single agent, the TCO of the second agent stays high. If that layer already exists (owned or bought), marginal cost drops. The build versus buy debate for that layer comes after you have the number, not before.

At Devic that layer is the product: a harness with observability and cost control, tool calls as the unit, and plans with included volume so you can measure before you scale. The free plan covers 5,000 tool calls a month with no card. It is not the production TCO: it is how you measure before you guess. If the case needs on-premise, long retention, or hands-on support, the number is no longer self-serve. You talk with the requirements on the table.

Checklist: do you have a TCO or only a token invoice?

Before you approve the business case, the team should be able to answer yes to this: whether the flow and the success metric are written down; whether the upfront investment includes production, not only the demo; whether there is a cost per successful action, not only a monthly total; whether there are three volume scenarios, not one "conservative" one taken from a slide deck; whether there is a spend limit per tenant and an owner with a name; whether payback survives a 30% rise in the model; and whether you know which part you will build and which part you do not want to build again.

If you cannot answer several of these, the next step is not to negotiate price: it is to close scope and instrument.

Once you have those lines, the rest is arithmetic. If you want to check them against a real case (your API, your margin, your volume), we look at it with the numbers in front of us.

logo devic ai

Alberto Iglesias

CEO

Turn your SaaS AI-Native

Get a free trial just by signing up


Ready to turn your platform AI-Native?

Centralize agents, tools, and flows in one platform and start scaling with less friction.

Build and run agents without friction

Connect your current infrastructure

  • Devic AI

  • Devic AI

  • Devic AI

Ready to turn your platform AI-Native?

Centralize agents, tools, and flows in one platform and start scaling with less friction.

Build and run agents without friction

Connect your current infrastructure

  • Devic AI

  • Devic AI

  • Devic AI