.jpg)
Consumption Pricing: How It Works + Implementation Guide
Learn how consumption pricing works, the infrastructure it requires, and how engineering teams implement usage-based pricing.
Standard billing software architecture was built for post-usage settlement. Here is what AI products need on top of it to enforce limits in real time.
%2520(1).png)
Standard billing software architecture breaks at a specific point: when an AI agent generates thousands of requests, and the system has no mechanism to enforce budgets, credit limits, or entitlement rules during the request itself.
This guide covers the enforcement layer that AI products need on top of billing, and how to build it without replacing what already works.
Billing software architecture refers to the components and patterns that together manage a product's financial operations. That means calculating charges, generating invoices, processing payments, managing subscriptions, and providing revenue reporting.
The standard components are well-understood:
Platforms like Stripe and Zuora cover most of this reliably. For products with flat subscription pricing and no variable consumption costs, this architecture handles the job.
AI-native products require a different architectural conversation.
AI products introduce variable marginal costs per request that post-usage settlement was never designed to handle.
A single session can consume meaningful compute depending on the model, the prompt, the workflow, and whether an agent is running in a loop. Pricing has to reflect that variance, and the architecture has to enforce it.
Standard billing software architecture records what happened, aggregates it, and generates an invoice. That pattern works when costs are predictable and overages are a minor reconciliation problem.
When every request carries a variable compute cost, and when enterprise customers expect hard limits enforced before their budget is exceeded, post-usage settlement is not sufficient.
The architectural requirement that appears at this point is a runtime enforcement layer that sits upstream of billing entirely. It decides what is allowed before the compute runs.
That layer has its own set of components, its own data requirements, and its own deployment considerations. Treating it as a billing platform feature is the architectural mistake that generates the most technical debt.
The enforcement and entitlements layer handles access decisions at request time, credit and wallet management, and governance across org hierarchies, three problems that billing was not built to solve.
Before a model is called, the architecture needs to answer: does this user, on this plan, with this remaining balance, have permission to make this request? That decision requires a live view of entitlement state.
The architecture that handles this deploys a local cache of entitlement data close to the application and resolves checks in single-digit milliseconds without a round trip to a remote service.
Token-based and credit-based pricing requires a ledger architecture.
The ledger needs to record every consumption event with full attribution, support credit blocks with their own expiry, cost basis, categories, and burn priority, and produce an append-only record with real-time deductions that finance can reconcile.
This is a distinct data model from what billing engines maintain.
Enterprise customers need the ability to allocate budgets to teams, departments, and products, and to enforce those allocations in real time.
The tenancy model required to support per-user limits, per-team budgets, and org-level overrides does not exist in standard billing architecture. It has to be designed into the enforcement layer from the start.
These three components form the control plane that sits between the AI product and the billing system. The billing system handles invoicing and payments downstream. The control plane handles who can consume what, and how much, upstream.
The four pitfalls in billing software architecture for AI products include wiring usage limits into the billing engine, coupling billing and entitlements in the same deployment, tracking credits without event sourcing, and skipping the event-level audit record.
A team sets overage thresholds in their Stripe metered billing configuration. Usage above the limit triggers a credit on the following invoice. No request was blocked.
The customer accumulated the overage over three days before the billing cycle caught it. The billing engine recorded the event correctly. It was never designed to prevent it.
Pricing changes require coordinated updates across the product code and the billing integration simultaneously. A plan tier change involves four engineers, a feature flag, and a 2-week deployment window.
Configuration-driven catalogs exist precisely to separate the pricing decision from the code release, but this pattern only works if the product catalog is a data layer as opposed to a set of constants in the application code.
Credit balances live in the same database as product data. At high request volume, concurrent writes produce race conditions: two sessions deduct from the same balance simultaneously because neither reads the post-deduction state before committing.
A credit ledger architecture handles this with reservation and settlement patterns that the application database was not designed to provide.
A billing dispute arrives. The finance team requests a transaction-level record of every credit consumed over the past 90 days, with timestamps and attribution per session.
The engineering team has opening and closing balances per billing cycle, but they do not have the individual events. The audit trail was never built because the billing system's aggregate records seemed sufficient at the time.
Each of these is a predictable failure, and none of them requires exotic architecture to prevent. They require the right components in the right layer of the architecture, built before the product depends on them.
The two layers integrate through a defined contract. Usage events flow from the runtime layer to the financial layer for billing. Plan changes from the financial layer propagate to the runtime layer's cache. Each layer handles its own concerns, and neither reaches into the other's data model.
The runtime layer's deployment pattern matters as much as its data model. A Sidecar container deployed inside the customer's own infrastructure holds a local copy of entitlement state, which means:
P95 under 100ms is a correctness requirement as well as a performance target. A check that takes 200ms gets bypassed or disabled under load. A check that resolves under 100ms is one that the architecture can afford to run on every request.
Billing software architecture decisions made early are hard to undo. A missing enforcement layer means retrofitting access control into a system designed to record. A missing tenancy model means an enterprise deal that exposes the architecture's limits before the contract is signed.
Stigg is the usage runtime for AI products. Entitlements, credits, usage limits, and spend governance are enforced synchronously in the request path.
For teams working through the architecture decisions, this article covers:
Explore how Stigg structures the runtime layer for entitlements and real-time enforcement across your system, to fit with your architecture.
Billing software architecture is the set of components and patterns that manage a product's financial operations: calculating charges, generating invoices, processing payments, managing subscriptions, and reporting on revenue.
For AI-native products, a complete billing software architecture includes a second layer above the financial infrastructure that handles real-time enforcement, credit management, and entitlement checks before compute is consumed.
Traditional billing software architecture was designed for post-usage settlement. It records consumption, aggregates it, and invoices at the end of a billing cycle.
AI products carry variable marginal costs per request, which means the architecture needs a runtime enforcement layer that makes access decisions before the model is called, not after the usage has already occurred.
The most common are wiring usage limits into the billing engine instead of an enforcement layer, coupling billing and entitlements in the same deployment so pricing changes require code releases, building credit tracking as a balance field rather than an event-sourced ledger, and skipping the event-level attribution layer that governance and auditing depend on.
A complete billing software architecture for AI products has two distinct layers. The financial layer covers invoicing, payment processing, subscription management, and revenue recognition.
The runtime layer covers entitlement checks, credit wallet management, usage governance across org hierarchies, and enforcement at the request level. Both run in production simultaneously and communicate through a defined contract of usage events and plan state updates.
A sidecar container deployed inside the customer's own infrastructure holds a local copy of entitlement state. Entitlement checks resolve against the local cache rather than making a live call to a remote service on every request.
This means an outage or latency spike at the upstream vendor does not affect production traffic, and enforcement continues to run correctly regardless of the availability of the remote billing software architecture components.