Companies are adopting artificial intelligence much faster than they are learning to control its costs. Early prototypes look inexpensive, individual subscriptions are easy to buy, and a handful of API calls barely registers. Then adoption spreads, agents become more autonomous, contexts grow longer, and subscriptions accumulate. The bill rises without anyone being able to say exactly what value it is funding.
I see two opposing reactions, neither of which is usually satisfactory. Some companies let spending grow because AI is considered a strategic investment. Others abruptly impose caps, remove access, or systematically choose the cheapest model. In the first case, waste becomes entrenched. In the second, the company may damage the very uses that were creating real value.
The problem is not merely the price of the models. It is primarily how processes are designed, subscriptions are allocated, and outcomes are measured.
An AI bill is actually made up of two very different bills:
- the variable consumption of automated processes, charged per call, token, image, second, or tool used;
- employee subscriptions, charged per seat or account, with provider-specific quotas and service levels.
These two categories cannot be optimized with the same levers. Automations require work on architecture, model selection, context, retry loops, and quality. Subscriptions require work on seat allocation, adoption, training, usage profiles, and—when contracts permit it—pooling available capacity.
The right question is not “how many tokens did we consume?” but “how much does an accepted business outcome cost us?”
This article presents a complete method for turning opaque spending into a manageable system without turning optimization into employee surveillance.
1. Measure the full cost, not just the provider bill
A provider dashboard usually shows calls, tokens, and an amount. That is useful, but insufficient. It does not show the human time spent on corrections, failed runs, duplicates, or the consequences of a bad answer.
For an automated process, the relevant economic unit is:
cost per useful outcome = (inference + infrastructure + human oversight + cost of failures) / accepted outcomes
For a support assistant, the useful outcome might be an answer sent without substantial rewriting. For a document extraction system, it might be a correctly structured and validated document. For a software development agent, it could be a task merged after review—not simply a quantity of generated code.
The full cost should therefore include at least:
- model-call costs, including input, output, cached data, and reasoning tokens where applicable;
- additional calls triggered by tools and sub-agents;
- retries, fallbacks, and timeouts;
- OCR, search, vector databases, and gateway infrastructure;
- human review or correction time;
- the cost of errors that reach production;
- the proportion of outcomes that are actually usable.
That last item changes the entire analysis. A model that is half the price but produces more errors can increase the final cost. Conversely, using a premium model only for ambiguous cases can reduce total cost if it prevents manual rework.
2. Why automations become unnecessarily expensive
The largest overruns do not usually come from a unit price that suddenly exploded. They come from a process that multiplies a small inefficiency across thousands or millions of executions.
The most powerful model is used everywhere
A prototype is often built with the best available model because that speeds up validation. The problem appears when this temporary choice becomes the production configuration.
Not every step needs the same level of reasoning. Language detection, request classification, extraction of three simple fields, or format validation can often be handled by a smaller model—or even deterministic code. The larger model should be reserved for situations where its additional quality materially changes the outcome.
The most robust strategy is complexity-based routing:
- deterministic rules remove trivial or invalid cases;
- a small model handles common cases;
- a more capable model receives only complex or low-confidence cases;
- a human resolves high-risk exceptions.
This routing must be evaluated on real examples. A confidence score reported by the model is not enough; it must be calibrated against annotated outcomes.
The entire context is sent every time
Teams sometimes confuse “provide more information” with “provide all information.” They send a complete conversation history, an entire knowledge base, or a document hundreds of pages long with every call.
This approach increases input cost, latency, and noise. It can also make answers worse because relevant information is buried among material unrelated to the task.
A better pipeline selects context before the call using lexical or vector search, metadata filters, state summaries, sliding windows, and the removal of information already known. It then measures two simple ratios: the proportion of context actually cited or used and the number of input tokens per accepted outcome.
Responses are needlessly long
A vague instruction such as “analyze this case in detail” often produces a verbose, expensive answer that is difficult to use. A precise output contract reduces both volume and integration errors.
It is better to request a structured schema, limit the fields, set a maximum length, and prohibit repeating the reasoning in the final answer. The application can then validate that schema before continuing the workflow.
Retries hide design flaws
A retry is sometimes necessary after a transient failure. Sending the exact same call again after an invalid response, however, is not a quality strategy.
It is important to distinguish between:
- temporary technical errors, which justify a retry with backoff;
- quota limits, which justify another deployment or an authorized fallback;
- invalid outputs, which require a corrected instruction or stricter validation;
- tasks that are too difficult, which should be escalated to a better model or a human.
The retry rate per workflow is one of the best waste detectors. It belongs next to cost in the dashboard, not only in technical logs.
Agent loops have no budget
An agent can plan, search, call several tools, review its work, and start over. That autonomy is useful, but its cost is unbounded unless explicit limits are set.
Every execution should have a budget: maximum number of steps, external calls, context volume, duration, and estimated cost. As it approaches the limit, the agent should produce a usable status, request approval, or stop. An infinite loop that “keeps thinking” is a production incident even if it never throws an exception.
Caching is underused
Stable prefixes, reference documents, and identical queries are sometimes billed again on every run. Several providers offer specific pricing for cached inputs, and gateways can provide exact or semantic caching as well.
Caching should not be enabled blindly. Its key must account for the prompt, model, tool, and relevant data versions. A time to live must be defined, and reuse must be prohibited when freshness, confidentiality, or user identity requires it.
Quality is not evaluated continuously
Without an evaluation set, cost optimization is a gamble. A team replaces a model, shortens a prompt, or reduces context, then waits for complaints.
A small set of representative cases, versioned alongside the prompts, makes it possible to measure accuracy, refusal rate, schema compliance, and the need for human correction. Changes can then be rolled out gradually and compared with the previous behavior.
3. Example: redesigning document extraction
Consider a process that receives documents and must produce structured data. The first version sends all the text to a large model, requests an open-ended analysis, attempts to parse the response, and retries if the JSON is invalid.
A better-designed version can follow this path:
- compute the file fingerprint to remove duplicates;
- validate the document type, size, and quality with conventional code;
- use OCR only when text is not already available;
- select relevant pages or passages;
- have a small model classify the document;
- extract fields into a strict schema;
- run deterministic checks on dates, amounts, and totals;
- send only ambiguous fields to the large model;
- request human validation if risk or uncertainty exceeds a threshold;
- retain the decision, prompt version, and metrics for evaluation.
The aim is no longer to make one call cheaper. It is to remove unnecessary calls, reduce their context, and reserve expensive capacity for cases where it creates value.
Before deploying this new version, I would run it in parallel on a production sample. The comparison should cover cost per accepted document, correction rate, latency, and business errors. Savings shown by the provider are not real savings if the accounting team has to correct more results.
4. Make every dollar traceable with a gateway such as LiteLLM
Costs are difficult to manage when each application calls multiple providers directly, using its own key and log format. An LLM gateway creates a shared control point.
LiteLLM is one of the tools suited to this role. It exposes a consistent interface to many models and can centralize authentication, routing, retries, fallbacks, caching, and observability. Its virtual keys can associate usage with a user or team and apply rate limits and budgets. Its documentation also describes spend tracking by key, user, and team.
LiteLLM does not magically fix cost problems. It makes decisions enforceable and measurable. If every workflow still carries the same identifier, prompts are not versioned, or nobody defines the business outcome, the dashboard will remain of limited value.
What every trace should contain
To connect engineering and finance, I record at least:
- a trace identifier and environment;
- the product, project, workflow, and step;
- the prompt, model, and router versions;
- the provider and model actually used, not merely those requested;
- input, output, cached, and—where exposed—reasoning tokens;
- the price applied at the time of the call;
- latency, errors, retries, and fallbacks;
- tools called and their duration;
- outcome status: accepted, corrected, rejected, or abandoned;
- a quality score from an automated or human evaluation.
The OpenTelemetry semantic conventions for generative AI can provide a foundation and prevent every service from inventing a different proprietary format.
Four views are enough to get started
A useful first dashboard does not need fifty charts. It must answer four questions:
- Where is the money going? Spend by product, workflow, team, model, and environment.
- Why does it vary? Volume, context size, outputs, retries, cache, and routing.
- What are we getting in return? Accepted outcomes, correction rate, time saved, or revenue protected.
- Where should we act first? Cost per outcome, variance from the baseline, and leading failures.
An alert should identify an actionable anomaly: cost per outcome doubling, an abnormal retry rate, a fall in cache hits, or a premium model appearing in a workflow that did not previously use it. An alert based only on total monthly spend usually arrives too late.
Do not turn observability into a data leak
Tracing does not mean storing every prompt and response. That content can include personal data, private code, secrets, or customer documents.
By default, I favor metadata, counters, and pseudonymized identifiers. Full content is enabled only for a controlled sample, with redaction, encryption, a short retention period, and access controls. LiteLLM provides observability callbacks and mechanisms for scrubbing logged data, but configuring them remains the company’s responsibility.
5. Employee subscriptions: optimize allocation, not people
The second bill covers subscriptions: coding assistants, writing tools, search, image, meeting, and analysis products. It appears simple because the price per seat is fixed. Yet it often conceals inactive accounts, overlapping subscriptions, and power users blocked by insufficient quotas.
The wrong response is to rank employees by their number of prompts or tokens. Raw consumption does not measure productivity. One person might send many pointless queries; another might use the tool twice a week for high-value decisions. Individual rankings also create perverse incentives and a climate of surveillance.
The metrics that are actually useful
Instead, with appropriate granularity and at an aggregate level wherever possible, I would track:
- the number of seats assigned, activated, and actually used;
- cost per active user, based on a stable definition of activity;
- the number of days with useful usage per month;
- the proportion of users who regularly reach their quota;
- the frequency of manual provider or account switching;
- declared use cases and their criticality;
- time saved, estimated cautiously and then validated on samples;
- existing business metrics such as processing delay, cycle time, correction rate, or satisfaction;
- the number of overlapping subscriptions covering the same need.
Adoption must be distinguished from value. “Opened the tool this month” measures activation. “Reduced the time required to prepare a case without lowering quality” begins to measure an outcome.
A profile-based licensing policy
A simple policy can define three profiles:
- occasional: access to a shared or on-demand service;
- regular: an individual standard subscription;
- intensive: greater capacity, specialized tools, or multiple models justified by the role.
Assignments must be able to evolve. An inactive seat can be reallocated after an announced period, with a fast reactivation process. A user who regularly reaches their limits should not waste time working around the tool; their profile should be reassessed.
Training is a financial lever in its own right. Knowing how to choose a model, limit context, reuse an approved prompt, and verify an output reduces spending while improving quality. One hour of targeted training can have more impact than negotiating a small percentage off seat prices.
6. Pool subscription capacity with MultiVibe
Some workloads do not fit the “one subscription, one employee, one tool” model. Development agents, runners, and internal applications have uneven demand: one account remains idle while another reaches its quota.
I built MultiVibe, published in the multicodex-proxy repository, for this situation. The project exposes an OpenAI-compatible API and routes requests across multiple accounts and providers. At the time of writing, its capabilities include:
- quota-aware multi-account routing with failover on limit errors;
- model aliases and ordered fallbacks across models or providers;
- OAuth or manual onboarding depending on the provider;
- distinct per-application keys that share the same pool;
- traces containing model, token, error, and latency data;
- statistics by account, route, application, and period;
- project attribution for Codex sessions;
- support for the
X-LiteLLM-Key-Aliasheader to preserve project attribution when LiteLLM sits upstream.
The aim is to smooth the use of authorized capacity and present a single interface to internal tools. Clients do not need to know which account is available or be reconfigured when a quota is reached.
LiteLLM and MultiVibe solve different problems
LiteLLM is particularly useful as a governance layer: virtual keys, budgets, teams, model policies, and consolidated API spend. MultiVibe provides routing centered on subscription accounts and available quotas. Depending on the context, a company can use one, the other, or combine both:
Applications, agents, and IDEs
↓
LiteLLM: identity, budgets, policies, and reporting
↓
MultiVibe: account routing, quotas, aliases, and continuity
↓
Authorized providers and accounts
In this architecture, a LiteLLM key alias can track the project while MultiVibe selects an account capable of serving the request. The company retains financial visibility and attribution without exposing provider credentials to applications.
One critical limitation: technology does not replace the contract
The technical ability to pool accounts does not mean every subscription can be shared. Terms of service, licensing rules, OAuth policies, and organizational limits vary by provider and plan.
Before any deployment, the company must confirm that its contract permits the intended usage, automation, and account routing. MultiVibe must not be used to impersonate users, circumvent a contractual limit, or conceal quota abuse. For some requirements, an API or enterprise plan will remain the only compliant option.
The proxy must also be secured as a critical component: mandatory authentication, separation of administrative privileges, protected token storage, rotation, logging, network restrictions, and a revocation procedure. The repository provides technical primitives; the organization remains responsible for its security architecture and compliance.
7. A thirty-day roadmap
Regaining control does not require rebuilding the entire platform before producing a result. I would start with a short cycle.
Week 1: establish the baseline
- inventory providers, keys, subscriptions, owners, and cost centers;
- select the three highest-spending workflows;
- define an accepted business outcome for each one;
- instrument model, tokens, latency, retry, error, and outcome;
- calculate an initial full cost, even if it is imperfect.
Week 2: fix the multipliers
- remove duplicates and calls that produce no outcome;
- reduce the largest contexts;
- enforce structured outputs;
- bound loops and retries;
- test a small model on simple steps;
- enable caching where semantics and confidentiality permit it.
Week 3: rationalize subscriptions
- identify unactivated, inactive, or overlapping accounts;
- ask teams about their use cases, not only usage frequency;
- define occasional, regular, and intensive profiles;
- reallocate subscriptions according to a transparent rule;
- train users on the two or three behaviors that drive the most cost.
Week 4: install guardrails
- create budgets and limits by project;
- add alerts for cost per outcome and anomalies;
- version prompts, evaluations, and routing rules;
- document a procedure for changing models or providers;
- decide whether a gateway, MultiVibe, or a combination of both is justified.
At the end of the month, the objective is not merely a lower bill. The company should be able to explain its largest cost areas, detect a drift within hours, and decide where the next dollar will create the most value.
8. The metrics to retain over time
For automations:
- full cost per accepted outcome;
- first-pass success rate;
- retry and fallback rates;
- input and output tokens per outcome;
- cache hit rate;
- proportion of requests handled by a smaller model;
- human correction rate;
- latency to a useful outcome;
- quality drift by prompt or model version.
For subscriptions:
- seats purchased, assigned, activated, and active;
- cost per active user and use case;
- proportion of inactive or overlapping subscriptions;
- users regularly constrained by their quota;
- time required to reallocate a subscription;
- perceived value and business outcomes, measured in aggregate.
At the financial level, I always complete the visible bill:
total AI cost = APIs + subscriptions + infrastructure + governance + human review + cost of errors
I also remain cautious with “time saved.” Ten hours theoretically saved do not automatically become ten hours of margin. The benefit becomes real only when that time is reinvested, a lead time is reduced, additional hiring is avoided, or another outcome is produced.
Conclusion: optimize the system, not just the price
AI costs are not uncontrollable. They become uncontrolled when companies buy access without a policy, automate without instrumentation, and measure consumption without measuring outcomes.
The method is the same as for any mature infrastructure: define a unit of value, attribute every expense, observe drift, set limits, and improve the most expensive components. LiteLLM can provide a governance and traceability layer. MultiVibe can pool and route subscription capacity when contracts permit it. But tools cannot replace a lean architecture, evaluations, or a clear policy for teams.
A sound FinOps strategy for AI does not seek the lowest possible bill. It seeks the best balance of cost, quality, risk, and speed. That discipline is what allows useful adoption to grow without handing models a blank check.