.png)
Billing System Architecture vs. Entitlements Explained
Billing system architecture manages invoices and payments. Entitlements control product access and limits. See how both layers fit into a modern software stack.
Most revenue leakage guides were written for subscription SaaS. AI products leak differently and earlier. Here is what causes it and how to close the gap.
.png)
Your billing platform is accurate, your usage data is getting logged, and you're still losing revenue nobody can fully account for.
That's the situation most AI product teams hit somewhere between their first enterprise contract and their first serious dispute. The billing platform did its job. The leak happened before it ever saw the data.
Revenue leakage is money your business earned but did not collect. Not money you failed to sell, but money you already delivered value for, money a customer already consumed, that never made it into your bank account.
It happens in every industry. A consultant forgets to log two hours. A SaaS company keeps applying an expired promotional discount. A manufacturer ships a product and never invoices for it.
The root cause is usually the same: a difference between what was delivered and what was tracked, between what was tracked and what was billed, or between what was billed and what was collected.
For subscription SaaS, the common culprits include failed payment retries, missed renewals, and discount codes that outlived their campaigns. These are real and recoverable. A failed payment leaves a record, and an expired promo can be audited. The leak can be found if you look for it.
For AI products, though, the leak does not always leave a record. It often happens before any record is created. And because AI usage carries real marginal cost on every single request, the financial exposure compounds in ways that flat-rate subscription leakage simply does not.
Roughly 45% of businesses call revenue leakage a systemic problem.
For subscription SaaS, most of that is recoverable. The leak is downstream, which means you can find it and you can usually claw some of it back.
For AI products, the math works differently. Take a product processing inference call at $0.002 each. Ten thousand customers means an average of five hundred calls per customer per day.
If 3% of those calls run without being correctly metered because the enforcement layer is asynchronous and a cache went stale, that's fifteen thousand calls a day going unrecorded.
Thirty dollars a day, nine hundred a month, and ten thousand eight hundred a year, all from one product, one pricing tier, and one failure mode.
Most AI products have more than one, and the number scales with every additional place the enforcement layer falls short.
AI products are more exposed because the consumption layer is where money moves, and most enforcement infrastructure was never built to operate there in real time.
Subscription SaaS leaks downstream, in missed renewals and failed payments that leave a clear record. For AI products, the leak is upstream and often leaves no record at all.
When usage runs without real-time limits and credits are tracked loosely, the billing platform closes the cycle on numbers that were wrong from the start. It invoiced what the metering layer reported.
If that layer was asynchronous, running on stale cache, or built on infrastructure that was never designed for concurrent high-volume writes, the invoice was wrong before it was generated. The billing system did its job, it just had bad data.
When that breaks, the customer conversation stops being about a billing error and starts being about whether the product can be trusted with a real workload. That's a much harder problem to fix than a missed payment.
The billing platform is usually the last thing to find out. These are the three places the leak starts before it ever gets that far.
A customer gets onboarded with a prepaid credit balance that gets consumed across agents, teams, and API keys, all tracked in a database table that made sense at twenty customers and starts quietly breaking down at two hundred.
By the time month-end arrives, the overages have already been absorbed or disputed, and you waive the charge because explaining it is harder than absorbing it. You make a mental note to fix the ledger. It doesn't get fixed, and the next enterprise customer runs into the same thing.
The credit ledger wasn't accurate enough to give it the right number, and a prepaid balance without atomic deductions, automatic rollover enforcement, and an append-only transaction history will eventually produce a number the customer can legitimately dispute and you can't confidently defend.
What a production credit ledger actually needs:
A hard limit exists in the product, but the enforcement check runs asynchronously, or the cache TTL is long enough that a burst of usage clears before the limit registers.
The compute ran, the product delivered it, and the invoice reflects it. The customer disputes it because they expected a wall that would stop them, not one that let them through and sent a bill afterward.
From their perspective, the limit failed. From yours, the usage was real. Both things are true, and neither helps you collect the revenue.
This is one of the more common failure modes for teams that built their own entitlement layer early and never revisited it. At low volume, asynchronous enforcement is usually fast enough, and a cache that's a few seconds stale rarely causes a visible problem.
At higher volume, with agents generating thousands of events per minute, that same stale cache is enough to let a burst through before the limit kicks in. The solution is architectural rather than operational.
Enforcement has to run synchronously in the request path, reading from a cache that's kept current, with a latency budget that holds under concurrent load. An enforcement check that can't resolve at around 100ms will eventually let something through that it shouldn't.
An enterprise customer has five teams sharing a credit allocation; one team burns through the pool by Wednesday, and finance has no visibility until the invoice arrives two weeks later.
The customer expected per-team caps and real-time spend visibility and got neither, and the dispute that follows isn't really about the dollar amount.
They signed a contract with specific allocation expectations that the billing infrastructure had no way to enforce at the right level of granularity.
This is what happens when sales closes an enterprise deal, and engineering looks at the current credit system and knows it can't deliver what was just promised. Per-team spend controls get scoped, deprioritized, and the customer gets onboarded with a workaround that holds until their usage grows.
What enterprise contracts actually require from the credit infrastructure:
A credit system that only operates at the top of the account hierarchy can't support the commitments a sales team makes in an enterprise deal, and the distance between what gets sold and what the infrastructure can actually enforce is where this category of leak originates.
Billing platforms are built to record and charge what they are told, and they do that job well. Orb, Metronome, Stripe Billing are accurate at the invoicing layer, but not designed to enforce access decisions synchronously in the request path.
That is an architectural boundary, and it is worth understanding before assuming the billing platform can close the leaks described above.
What is missing is a layer between the product and billing that knows in real time what a customer is allowed to consume, tracks that consumption with ledger-level accuracy, and enforces limits before overages accumulate.
Most teams try to build this themselves, and it works fine until it doesn't. A few database tables, a middleware layer, some feature flags. It’s solid at twenty customers, fragile at two hundred, and genuinely problematic at two thousand when every request carries real marginal cost.
The homegrown system tends to handle the happy path well until credits, per-team allocation, rollover rules, and multiple pricing dimensions show up.
Each new requirement gets a workaround, the workarounds accumulate, and eventually someone needs to make a pricing change and discovers the system cannot support it without a two-sprint refactor.
That’s usually when teams start evaluating purpose-built enforcement infrastructure, one sprint too many after they should have.
Most teams find out what the enforcement layer needs to do by discovering what their current one can't handle. Here is what the requirements actually look like when you spell them out.
Cache hits need to resolve immediately with no perceptible latency added to the user experience. Misses need to come back at around 100ms.
Anything slower and you are making a product tradeoff on every single request, and at the call volumes AI products generate, enforcement latency is a product decision that affects every user interaction.
Zero balance discrepancies. Every grant, deduction, and rollover tracked with the accuracy you would expect from a payments system, written as immutable events in an append-only ledger.
A credit system that falls behind under load or updates a mutable balance column in place produces numbers your finance team cannot audit and your customers cannot trust when they dispute a charge, and they will.
Per agent, per team, per user, per department. A single shared balance works fine for a startup and breaks the moment an enterprise procurement team asks who spent what.
They will ask, usually in the first serious QBR. The data model has to support nested org hierarchies from day one rather than as a future roadmap item.
At the event volumes AI products generate, the enforcement layer either handles the load or becomes the bottleneck.
An entitlement check that adds meaningful latency to a request path is a tax on every user interaction, and a system that degrades under pressure creates new failure modes rather than preventing them.
The bar for real-time enforcement at enterprise scale is correctness under pressure, at hundreds of millions of events.
The enforcement layer is in the request path, which means if it goes down, your product's access control goes down with it. The runtime needs a local cache and redundancy that keep it operational during upstream outages.
For teams with data residency requirements or enterprise security reviews, that also means a sidecar deployment that runs inside your own cloud so the enforcement runtime never becomes a single point of failure you don't control.
Token-based pricing, per-action pricing, outcome-based pricing, and hybrid models that combine a subscription base with usage overages.
The enforcement layer needs to handle all of these without a code deploy every time the pricing model evolves.
Pricing experimentation is a real competitive advantage for AI products right now, and an enforcement layer that turns every pricing change into an engineering project is a direct constraint on that advantage.
This is the point where most engineering teams pause and ask the obvious question: can we just build this ourselves?
The answer is yes, for a while.
A single-product company with a handful of plans and a simple usage model can build a workable entitlement layer in a few sprints. A few database tables, some caching logic, and a middleware layer that checks the plan before processing the request.
That system will hold for longer than you expect, and there is nothing wrong with starting there.
The conditions under which it stops working are specific:
Any one of those is manageable to build, but all of them together, maintained alongside a product that is also evolving, is where the custom system starts consuming more engineering time than it saves.
Most teams that have been through that cycle once answer the build vs. buy question differently the second time.
Buying doesn't mean replacing everything at once, either. The enforcement layer, the credit ledger, and the metering pipeline are separable pieces:
With Stigg, the integration point stays the same whether a team uses one piece or all of it.
By the time a leakage problem shows up on an invoice, it is already too late to prevent it.
Stigg operates at the point where it can actually be stopped: the request path, before usage runs. On a cache hit, entitlement checks resolve instantly from local Redis. On a cache miss, the Sidecar fetches from Stigg's Edge API at around 100ms, with a configurable timeout
It works alongside Stripe, Zuora, or Chargebee without replacing any of them. It just handles the layer those tools were never built to own.
Every dollar you have already earned deserves to be collected. Start with the Stigg docs and close the gap.
Yes, billing platforms invoice what they are told. If the metering layer is asynchronous or credit limits are enforcing too late, the billing platform processes accurate invoices based on inaccurate inputs. The leak lives upstream of the invoice.
Trace a sample of high-usage sessions from the event in your product to the line item on the invoice. If you cannot complete that trace cleanly, you have a leakage risk.
Other signals include customers disputing unexpected overages, credit balances that fail to reconcile at month-end, and enterprise accounts where per-team spend is invisible until the invoice lands.
Rarely. Most leakage in AI products comes from enforcement gaps on the product side: limits that fired too late, credit balances that went negative before anyone noticed, usage that ran through a stale cache. The customer consumed what the product allowed them to consume.
Churn is revenue you stop receiving because a customer leaves. Leakage is revenue you stop receiving from a customer who is still active and still consuming. Churn shows up in your MRR. Leakage often stays invisible until it compounds into a dispute.
Earlier than most teams do. The enforcement architecture is harder to retrofit than to build correctly from the start, and every enterprise contract signed on top of a leaky enforcement layer is a liability. The first enterprise deal is the right time to make sure the enforcement layer can actually support the commitments being made.