%20(1).png)
Billing Mediation: What It Is, How It Works, and Why It Matters
What billing mediation is, why AI usage pushes it harder than traditional SaaS, the four functions, a worked event example, and build vs. buy guidance.
A practical guide to software monetization for AI products. Pricing models, entitlements, metering, and the enforcement layer billing was never designed to be.
.png)
A credit-based AI product ships without a governance layer. Three months in, an enterprise customer's power user runs a batch job over a long weekend.
By Monday, they have burned through their entire quarterly allocation. The billing system recorded every event correctly. Nothing stopped it.
That is the engineering problem software monetization infrastructure for AI products has to solve. This guide covers the models, the enforcement layer underneath them, and where in-house builds hit their ceiling.
Software monetization is the process of turning software capabilities into revenue. It defines how you control access, track usage, and enforce pricing inside the product.
In practice, it connects a few key layers:
Many engineering teams do not build this as one system. Instead, they patch it together over time with billing integrations, feature flags, and usage counters. This works early on, but it becomes fragile as pricing evolves.
The real challenge is building a system that lets you change pricing models without redeploying your application.
Every pricing change touches engineering. A new tier needs new entitlement logic. Usage-based pricing needs metering. Credits need a ledger. Trials must work alongside paid plans without breaking either.
When you hardcode monetization into the application, pricing becomes tied to deployment cycles. Simple experiments slow down. A change that should take a day can take weeks. The business wants to move faster, but engineering becomes the bottleneck, and pricing updates pile up.
To avoid this, monetization needs its own infrastructure. It typically includes three core layers:
Entitlement resolution is where most in-house systems eventually break. Access for any given customer comes from multiple sources: base plan, parent plan, add-ons, trials, and promo grants.
The system has to evaluate all of them simultaneously and return the highest allowed value when sources conflict. That logic needs to be consistent, fast, and correct on every request across every service.
You usually start with billing. The entitlements layer and product catalog tend to surface later, which is where complexity starts to break things.
Feature gating turns entitlement data into product behavior by controlling access, shaping the UI, and driving upgrade paths in real time.
It helps to separate two responsibilities:
Feature gating is also how you monetize new features because it makes value visible and ties it to upgrade paths.
How you handle visibility directly impacts conversion. Hiding and gating are not the same thing:
Showing locked features with clear upgrade paths performs better, but only if the frontend has enough context to render the right state.
That’s why the entitlement response shape matters. Each check returns:
The frontend uses this data to enforce access, render usage states, and trigger upgrade prompts without making additional calls.
Software monetization models require three core capabilities: tracking usage, controlling access through entitlements, and applying pricing through billing systems.
Each pricing model builds on these in different ways. The challenge is not choosing a model, but building systems that can support it as complexity grows.
Across all models, the pattern stays the same. Billing handles charges, entitlements enforce access, and the product catalog defines the rules. If these are not designed together, every new pricing change adds more complexity.
Subscription pricing looks simple because the billing model is simple. The complexity shows up in access control. Every request in your system needs to resolve whether a user is entitled to a feature based on their current plan, and that decision has to stay correct as subscriptions change.
Usage-based pricing shifts the problem from “who has access” to “how much can they use.” This introduces a continuous stream of events that must be captured, processed, and enforced in real time.
Hybrid pricing combines subscriptions with usage. This is where systems that worked independently start to conflict.
Credit models introduce financial state directly into the product. You are no longer just tracking usage. You are maintaining balances that change over time, and those balances carry real complexity.
Each credit block needs its own expiry date, cost basis, and category: paid or promotional. When a customer holds multiple blocks, the system needs explicit burn order logic: promotional before paid, expiring before non-expiring. Depletion behavior also needs to be configurable, whether that means a hard stop at zero or allowing overage.
Freemium is controlled exposure. You are designing a system that shows value while restricting access.
Tiered pricing introduces variation across plans. This is where entitlement logic becomes deeply embedded in the system.
Most engineering teams start by building monetization in-house, and for good reason. A few database tables, some feature flags, and a billing integration are a pragmatic call when the product is early, and pricing is simple. It ships fast and solves the immediate problem.
The trouble starts when pricing evolves beyond what that system was designed for:
What started as a pragmatic call becomes a system that is hard to extend and harder to trust. Rebuilding as pricing changes is the common outcome, and the market rarely waits for that cycle to finish.
Miro is a clear example of this pattern. Their product portfolio grew to include tiered packages, usage-based pricing, and AI features. Each new launch added more monetization logic to a system never designed to handle that complexity.
A straightforward plan introduction turned into a months-long, cross-functional effort.
Buried assumptions in the codebase were the cause. They chose to layer a dedicated usage and entitlement runtime on top of their existing stack instead of rebuilding again. That decision saved an estimated 5,000 engineering hours.
Software monetization should operate as a decoupled system. The application should not manage pricing logic, and billing should not define product structure.
At a high level, the architecture is separated into three layers:
In this setup, the application asks one question: Does this customer have access to this feature right now?
The entitlements layer evaluates access using the product catalog, subscription state, add-ons, trials, and any overrides.
Instead of returning a simple yes or no, each entitlement check returns:
Your application uses this response to enforce limits, show usage indicators, and trigger upgrade prompts without extra calls. Billing runs after the purchase and does not affect real-time access decisions.
In practice, this means running entitlements close to your application. Stigg’s Sidecar runs as a Docker container alongside your app and caches entitlement data in Redis, so most checks happen locally and return instantly.
When there’s a cache miss, it falls back to Stigg’s Edge API at around 100ms, with a configurable timeout to avoid blocking your app. It also adds built-in resilience during outages without extra engineering work.
At enterprise scale, the enforcement problem compounds. Different products and business units build their own credit and entitlement systems over time, especially after acquisitions.
This creates a few consistent problems:
The solution is consolidation around a shared control plane:
This moves enforcement from scattered custom logic to one consistent layer that enterprise customers can actually see and manage.
Usage data is not just for billing. It helps engineering teams understand how well the monetization system is working.
It serves two audiences:
For engineers, usage data highlights a few key signals:
Usage data acts as a feedback loop. It shows where the system breaks before customers report it.
Billing being in place does not mean enforcement is. Every new tier, limit, or credit model runs into the same problem between the product and the billing stack, and it always lands in the engineering backlog.
Getting that layer right is what separates a pricing model that ships in a day from one that takes a sprint.
Stigg runs as a usage runtime above your billing stack, checking entitlements, credits, usage limits, and spend governance synchronously before each request executes.
You don't have to adopt all of this at once. You can start with entitlement enforcement, add the credit ledger when a usage model lands, and bring in metering later. A startup can get AI-credits-ready from a single integration point, and an enterprise can consolidate one product line at a time.
If pricing changes are routed through engineering, or enforcement logic is scattered across services, the Stigg docs show how the enforcement layer fits into a stack that already covers billing.
The main difference between software monetization and software licensing is scope. A software license grants the right to use software under defined terms. Software monetization for AI products encompasses the full system for access control, usage tracking, credit management, and enforcement along the request path before billing occurs.
The main difference between software monetization and billing lies in where they operate in the stack. Billing records what was consumed and invoices after the fact. Software monetization for AI products controls access, enforces usage limits, and governs credit spend before each request executes.
Usage-based software monetization for AI products requires real-time metering to capture token and inference events, an entitlements layer that enforces limits synchronously before each request executes, and a billing system to calculate charges afterward.
Metering and enforcement are separate concerns. Billing tools handle metering. Enforcement in the request path requires a dedicated layer that billing was never designed to be.
A homegrown system breaks down when the credit model outgrows a simple counter, when enterprise customers ask for per-team allocations and spend caps, or when concurrent agent workflows start overdrawing the same balance before either completes. These are enforcement problems that billing was never designed to solve.
Entitlement management is the layer that defines and enforces what each customer, team, agent, or department can access and consume based on their plan.
For AI products, it resolves credit balances, token limits, and spend caps synchronously in the request path before actions execute. It is distinct from billing, which records what happened, and from RBAC, which handles team roles without the commercial consumption dimension.