Insights / AI Operations · · 12 min read
Cost discipline for AI products
AI features can quietly become the largest line on a product's bill. How Oryvelon keeps AI cost visible and controlled across a portfolio: per-product budgets, model routing, caching, batching, output limits and quarterly tool reviews.
There is a pattern we have seen many times in AI products. A feature ships. It works well. Usage grows. Nobody looks closely at the bill until a month when it is suddenly the largest line item — larger than hosting, larger than the database, sometimes larger than the revenue the feature brings in.
AI cost is unusual because it scales with use in ways that are easy to underestimate. Every request costs money. Longer inputs cost more. Longer outputs cost more. Retries cost more. A prompt change that adds a paragraph of context can quietly raise costs across every call.
In a group of companies, there is an extra risk: one product's spending can hide inside another's, or inside a combined invoice that nobody breaks down. At Oryvelon we treat AI cost as a first-class metric for every company, with the same seriousness as revenue.
Principle: every product sees its own economics
The foundation of cost discipline is visibility. For each company we aim to track, side by side:
- hosting and infrastructure;
- database and storage;
- AI model usage;
- email and messaging;
- third-party tools and subscriptions;
- revenue and gross margin.
A single group invoice must never hide whether an individual product is healthy. If ZodiVela's AI usage doubles, we want to see it in ZodiVela's numbers, not as a slightly larger total that nobody can explain. See Unit economics per product in a shared-infrastructure group.
Separate AI projects, keys and budgets
The simplest structural decision we made is also one of the most effective: each product has its own AI project, with its own API keys and its own budget.
That does three things:
- Spend is attributable. Every request is billed to the product that made it.
- Limits are local. A soft limit warns the team when spending approaches the monthly budget; a hard limit stops runaway usage before it becomes a financial problem. One product hitting its limit does not affect the others.
- Keys are contained. If a key leaks, the damage is limited to one product and the key can be rotated without disrupting the group.
The shared AI gateway applies these budgets consistently, but the budgets themselves belong to each company.
Model routing: the right model for the task
Not every task needs the most capable model. Classifying a support message, extracting fields from a product description, summarising a short text or reformatting data can often be done well by smaller, faster, cheaper models. Complex reasoning — interpreting an unusual combination of eligibility rules, or writing a nuanced explanation — may justify a stronger one.
We route tasks deliberately:
| Task type | Typical routing |
|---|---|
| Classification, tagging, extraction | Small, fast model |
| Short summaries and reformatting | Small or mid-sized model |
| Explanations grounded in verified data | Mid-sized model, stronger if quality requires |
| Complex multi-step reasoning | Strong model, used sparingly |
Because our products ground models in verified data rather than asking them to recall facts, many tasks become formatting and explanation problems — exactly the kind smaller models handle well. We explain the routing logic in Model routing: matching tasks to the right AI model.
Caching where it is safe
If the same input produces the same useful output, there is no reason to pay for it twice. We cache responses for deterministic, low-variance tasks: a description of a product that has not changed, an explanation of a rule version that has not changed, a classification of identical text.
Caching needs care. It must never serve one user's personalised output to another, and it must be invalidated when the underlying data changes. For that reason, cache keys include the product, the prompt version and a fingerprint of the input data. See Latency, caching and batching in AI features.
Batching work that is not urgent
Some AI work does not need an instant answer: nightly store analyses, bulk content suggestions, periodic report generation. Running that work in batches — often through background jobs — lets us use cheaper processing options where providers offer them, smooth out load and retry failures without a user waiting.
Output limits
Outputs cost money too. A briefing that could be five bullet points does not need to be five paragraphs. We set output length limits per feature and design prompts to ask for the format we actually need. Shorter outputs are cheaper, faster and usually easier to read.
Watching for silent cost growth
The most dangerous cost increases are the ones nobody decides to make. A few examples we watch for:
- Prompt creep. Each change adds a little context or a few instructions. After a dozen changes, every request is much larger. Versioned prompts make this visible.
- Retry storms. A validation rule that rejects many outputs can cause repeated retries. Monitoring rejection rates catches this.
- Context bloat. Retrieval systems that send too much text to the model on every request. We cap retrieved context and measure its size.
- Forgotten features. Background jobs that keep running long after anyone uses their output.
Tools, reviewed quarterly
AI is not the only cost that creeps. Shared infrastructure only saves money if it stays lean, and SaaS subscriptions have a way of multiplying: a monitoring tool here, a form builder there, two overlapping analytics services because two people signed up for trials.
Every quarter we review the tools and subscriptions used across the group. For each one we ask: who uses it, which companies depend on it, whether another tool already does the same job, and whether its cost is attributed to the right company. Duplicates are closed. Unused seats are removed. See The quarterly tool review: fighting SaaS sprawl.
A cost review for a single AI feature
When we look at the cost of an individual AI feature, we walk through the same short list.
- Volume. How many requests per day, and is that growing in line with usage or faster?
- Size. What is the average input and output size, and has it changed since the last review?
- Model mix. Which models handle which share of requests, and could any share move to a cheaper model without hurting quality?
- Cache hit rate. For cacheable tasks, how often are we serving a stored answer, and could more be cached safely?
- Failure cost. How much spending goes on requests that fail validation or time out and are retried?
- Value. What does the feature contribute — conversions, retention, time saved for users — relative to what it costs?
The last question matters most. A feature that costs a lot and drives a lot of value is fine. A feature that costs a little and nobody uses is not.
Quality and cost are not opposites
It is tempting to see cost control as a trade-off against quality. In our experience, disciplined cost work often improves quality.
Grounding makes smaller models viable. When a model receives verified facts and only has to explain them, a smaller model often writes as clearly as a larger one — and is less likely to wander.
Shorter outputs are easier to read. A tighter output limit usually produces a more useful briefing.
Batching makes retries calm. Background work can be retried and validated carefully without a user waiting, which reduces pressure to accept a borderline answer.
Evaluation sets protect both. When we try a cheaper model or a shorter prompt, the same evaluation set tells us whether quality held. We only keep changes that pass.
How it looks across the group
Each Oryvelon company uses AI differently, so the cost profile differs too.
- MerchNivo runs regular analyses of store data and on-demand requests from merchants. Batching and caching matter most here, because store data changes on a known rhythm.
- KeşifAtlası generates explanations for eligibility results. Rules are versioned, so explanations for the same rule version and the same answers can be reused safely.
- ZodiVela produces personalised consumer readings. Output limits and model routing keep per-reading cost predictable as usage grows.
- EduRelia supports learning interactions, where latency and safety matter as much as cost. Budgets are set conservatively and reviewed often.
- CastLyra uses AI to assist matching between briefs and talent profiles. Most matching work can use smaller models over structured profile data.
The tools are the same; the settings are tuned per company.
Mistakes to avoid
If you are building AI features yourself, these are the mistakes we see most often:
- one API key shared across several products, making spend impossible to attribute;
- no hard budget limit, so a bug or abuse becomes an expensive surprise;
- the strongest model used for every task by default;
- no measurement of input size, so prompt and context growth goes unnoticed;
- caching added carelessly, serving personalised output to the wrong user;
- AI cost reported only as a group total, never per product or per feature.
Each of these is easy to fix early and painful to fix late.
Setting a budget for a new AI feature
New features are where cost surprises start, so every AI feature gets a budget before it launches, not after its first invoice.
We estimate three numbers: expected requests per day, average tokens per request (input plus output) and the price of the model tier we plan to use. Multiplying them gives a daily cost; multiplying again gives a monthly figure. We then add a margin for retries and growth and set two thresholds.
- The soft limit sits around the expected monthly cost. Crossing it sends an alert to the team that owns the feature. Nothing breaks; someone looks.
- The hard limit sits well above the soft limit but below the point where the feature stops making economic sense. Crossing it switches the feature to its degraded mode until someone decides what to do.
The estimate is always wrong in the details, but writing it down forces useful questions. Is the input really that large? Do we need that model? What happens at ten times the usage? It also gives the team a baseline to compare against once real traffic arrives.
Pricing AI features for customers
Cost discipline is not only about spending less. It is also about charging sensibly for what AI costs to provide.
For products where AI usage varies a lot between customers, a flat subscription can become unfair in both directions: light users subsidise heavy users, or heavy users become unprofitable. That is why several Oryvelon companies combine a subscription with usage-based elements or credits. MerchNivo pairs a subscription with usage components; ZodiVela uses credits and one-off premium readings alongside subscriptions.
The goal is not to maximise revenue per request. It is to make sure the price of a product moves roughly with the cost of serving it, so growth makes the business stronger instead of more fragile. We cover the pricing logic in Subscription plus usage: pricing logic for AI SaaS.
Reporting AI cost in a way people read
A cost report that nobody reads does not control anything. We keep AI cost reporting short and consistent, per company:
- total AI spend this month and last month;
- spend per feature, with the top three highlighted;
- cost per active user or per unit of value (per report, per store, per reading);
- any feature that crossed a soft limit, and why;
- one proposed change, if there is one worth making.
Five lines, every month, for every company. It is enough to catch problems early and dull enough that it actually gets done.
Choosing providers and models with cost in mind
Model prices change often, and new models appear constantly. Rather than chasing every announcement, we evaluate providers and models against a stable set of questions.
Does it pass our evaluation sets? A cheaper model that fails the tests for a feature is not cheaper; it moves the cost to our users and our support time.
Is the price predictable? We prefer pricing we can model in advance. Features with unpredictable cost need tighter limits.
Can we separate projects and budgets? A provider must let us give each company its own project, keys and limits. Without that, per-product visibility breaks.
What happens when it is unavailable? Every provider has outages. The gateway needs an approved fallback — sometimes a second provider, sometimes a simpler non-AI path.
What does it do with our data? Inputs may contain customer information. Data handling terms, retention and training policies matter as much as price.
Is switching realistic? Because every call goes through the gateway with versioned prompts and evaluation sets, switching models is a configuration change followed by a test run — not a rewrite. That keeps us free to move when prices or quality change.
This approach means we rarely make dramatic model changes. Instead, costs drift down steadily as individual features move to better-priced options that pass their tests.
A worked example: the cost of a daily briefing
Abstract advice about AI cost is easy to agree with and hard to apply. So here is how we think through a single feature, using a daily store briefing of the kind MerchNivo produces. The figures below are illustrative, not measurements.
The naive version sends the model everything: yesterday's orders, the product catalogue, inventory levels, refunds and traffic, and asks it to "summarise what matters". For a store with a few thousand products, that input is large, and it is paid for every day, for every store. It is also worse for quality. The model is being asked to do arithmetic and spot trends in raw data, which is exactly where language models make confident mistakes.
The version we prefer splits the work.
- Code computes the facts. Revenue compared with the same weekday last week, products close to selling out, a refund rate above the store's normal range, a sudden drop in conversion. These are ordinary calculations on the store's own data.
- Code decides what is worth mentioning. Thresholds and rules pick the handful of signals that crossed a line today. On a quiet day that list may be short.
- The model explains. It receives a compact, structured list of verified facts — perhaps a few hundred tokens instead of tens of thousands — and writes a short briefing with suggested actions.
- A schema checks the output. The response must match a defined structure, and every number in it must appear in the input. See Structured outputs and schema validation.
Imagine a store whose refunds spike on one product line overnight. In the naive version, the model might notice, or might bury it in paragraph three. In the split version, the refund calculation flags it, the briefing leads with it, and the number shown is the store's own. The cost per briefing drops sharply, because input size is the main driver, and the briefing becomes more trustworthy at the same time.
The general rule: do the arithmetic in code and pay the model for language. It applies well beyond commerce.
When we spend more, not less
Cost discipline is not a race to the cheapest option. There are places where we deliberately accept a higher cost per request, and being explicit about them keeps cost reviews from eroding things that matter.
Safety checks stay on. For consumer products, and especially for anything young people use, the checks that run before and after a model call are part of the product, not overhead. We do not remove them to save money. See Safety hooks for consumer AI products.
Paid outputs get the stronger model when tests say so. When someone pays for a personal report — a KeşifAtlası eligibility report, for example — the explanation is the product. If evaluation shows a stronger model explains complex rule combinations more clearly, the margin on the report can usually absorb it.
Validation retries are worth paying for, up to a point. A retry that turns an invalid answer into a valid one is cheaper than a support ticket or a wrong answer. A retry loop that runs five times is a signal to fix the prompt, not to keep paying.
Evaluation runs are an investment. Running a feature's test set against a new model or prompt costs money, and it is the cheapest insurance we buy.
The test we apply is the one from the feature review above: does the extra spend produce value a user or the business would recognise? If yes, we keep it and budget for it. If a feature cannot justify its cost even after optimisation, that becomes an input to the continue, stop or scale decision rather than a problem to hide.
Summary
AI makes it possible for small teams to build powerful products. It also makes it possible for small teams to run up large bills without noticing. At Oryvelon, cost discipline is part of how every AI feature is designed: separate projects and budgets per product, the right model for each task, caching and batching where they are safe, output limits, monitoring for silent growth and a quarterly review of everything we pay for.
The goal is simple: every company should know what its AI costs, what it earns from it, and whether the trade is worth making. For the broader principles behind our AI work, see AI explains, verified data decides.
Questions and answers
How does Oryvelon control AI costs?
With separate AI projects and budgets per product, model routing, caching where safe, batching of non-urgent work, output length limits and regular reviews of tools and spend.
Why track AI cost per product?
So a single group invoice never hides whether an individual product is healthy, and so problems can be fixed where they occur.
Does cost control reduce quality?
Not when done carefully. Routing simple tasks to smaller models and grounding them in verified data often keeps quality the same at much lower cost.