Blog
/
Guides

Metered billing: how it works, examples, and what to build

Metered billing charges customers for what they actually use. See how it works, common pricing structures, real examples, and what engineers need to build.

Sara NelissenSara Nelissen
Written by
Sara Nelissen
Last updated
July 10, 2026
read time
11
minutes
Metered billing: how it works, examples, and what to build

Table of contents

Metered billing looks simple on a whiteboard. You count what each customer used, multiply by a price, and send the invoice. Then a retry storm double-counts a day of API calls, or a customer upgrades on the 14th of the month, and the simple part turns into a reconciliation project.

Metered billing is how cloud providers, utilities, and telecom carriers have always charged, and AI products now meter every token for the same reason.

This guide covers the plain definition, the pricing structures you can put on top, real examples with real rates, and the systems engineering teams end up building to run it in production.

What is metered billing?

Metered billing is a pricing model where charges are calculated based on actual usage. The system tracks consumption and applies pricing rules to work out what each customer owes, so the bill moves with usage.

It works the same way your electricity bill does. A meter records how much you used, and the bill multiplies that by a rate. In software, the meter is a stream of usage events, such as:

  • Tokens consumed in AI or LLM workloads
  • API calls processed by your service
  • Storage used over time
  • Compute time or other resources consumed

Each event has to be captured, attributed to a customer, and translated into billable units before anyone sees an invoice.

How metered billing works

Metered billing works in four steps:

  1. Track usage: record every billable event as it happens and tie it to a customer.
  2. Aggregate: roll events up into totals for the billing period.
  3. Rate: apply the pricing rules (per unit, tiers, base fees) to those totals.
  4. Invoice: generate the bill at the end of the cycle and collect payment.

It sounds straightforward, and on a quiet day it is. Each step depends on systems that need to stay consistent under load, which is where the engineering work needs to happen.

Usage tracking

Usage tracking is where everything starts, and if you get it wrong, nothing downstream matters.

Every billable event needs to be captured at the moment it happens, tied to the right customer and subscription, and stored in a way you can audit later. In practice, that means an event pipeline with ingestion, validation, and durable storage.

The tricky part is reliability, because events don't behave cleanly in production. Your pipeline needs to handle:

  • Retries and duplicate events that inflate usage if they aren't deduplicated
  • Service outages or delays that leave gaps in tracking
  • Backfills and reprocessing when data needs to be corrected

That's why idempotency and deduplication belong in the pipeline from day one. If you miss events, you lose revenue, and if you double-count them, you lose trust (and usually a few days to the support thread that follows).

Billing cycle

The billing cycle defines when you stop counting and start charging.

Monthly billing is common, though some systems bill daily or close to real time.

The challenges show up when state changes mid-cycle.

Take the customer from the top of this guide who upgraded on the 14th. Usage before the upgrade bills at the old plan’s rate, and usage after bills at the new one. Downgrades and cancellations split the period the same way, so you need time-aware aggregation.

Rate determination

Rate determination is where usage becomes money.

At a basic level, you map units to a price. In reality, pricing is rarely flat, as there are tiers, volume discounts, feature-based pricing, and contract-specific overrides.

If the first million API calls cost one rate and the next ten million cost another, your system has to know both the total and where that usage falls within each threshold.

This logic has to be deterministic. If the same usage produces different charges in two systems, you have a reconciliation problem.

Invoice generation

Invoice generation is the last step, and it depends on everything upstream being right.

The billing system takes aggregated usage, applies pricing rules, and produces an invoice. Tools like Stripe, Chargebee, or Zuora handle invoicing and payments, but they rely entirely on the accuracy of the usage data you send them.

If your aggregation or pricing logic is off, the invoice will be wrong, and the billing platform won't catch it.

Where systems break

Most failures come from small mismatches between these steps, like an aggregation job that lags behind the event stream and skews totals, or a mid-cycle change one service applies and another misses.

When they drift, the problem shows up on an invoice, and by then it’s already customer-facing.

Common metered billing structures

Metered billing is the mechanism, and the structure is how you turn measured usage into a price. Most products use one of these, or a mix:

  • Per-unit (pay-as-you-go): every unit costs the same, like a fixed price per API call or per SMS.
  • Tiered: the unit price changes as usage crosses thresholds, so the first million calls cost more per call than the next ten million. The tiered pricing guide covers the variations.
  • Volume: once total usage reaches a tier, every unit in the period is billed at that tier's rate.
  • Base fee plus overage: a flat subscription includes an allowance, and usage above it is billed per unit. The overage fees guide walks through the models and how to enforce them.
  • Prepaid credits: customers buy a balance upfront and usage draws it down, which is common in AI products.

Metered billing examples

Metered billing shows up anywhere usage varies a lot between customers and costs money to serve. The same pattern runs through cloud, AI, utilities, and telecom.

Cloud infrastructure: AWS and Azure

Amazon S3 is a classic case. You pay for storing objects, and the rate depends on how much you store, for how long, and the storage class: S3 Standard for frequently accessed data, Standard-Infrequent Access for data you access less often but still need quickly.

That goes well beyond counting gigabytes. AWS measures several kinds of usage, works out which bucket each falls into, and prices them differently, so billing is tied directly to how the system works under the hood.

Cloud marketplaces meter software, too. On Microsoft Marketplace, SaaS vendors define billing dimensions like bandwidth, tickets, or emails processed, then report billable events to Microsoft's metering service API as they occur.

AI tokens: OpenAI's API

AI APIs bill per token, usually with separate rates for input and output. On OpenAI's API pricing page, GPT-6.1 Sol costs $2.00 per million input tokens and $10.00 per million output tokens on standard processing.

A request that sends 20,000 tokens and gets 5,000 back costs $0.04 for input plus $0.05 for output, so $0.09. Multiply that by a few million requests and you can see why AI companies meter every call.

Utilities: electricity by the kilowatt-hour

Utilities are the original metered business. The average US residential electricity price was 18.16 cents per kilowatt-hour in August 2026, according to the U.S. Energy Information Administration.

At that rate, a home that uses 900 kWh in a month pays about $165 for the electricity itself, and a home that uses 400 kWh pays about $73. It’s the same rate and the same meter, but you see very different bills.

Telecom and messaging: Twilio SMS

Messaging APIs bill per message. Twilio's US SMS pricing lists $0.0083 per outbound SMS on a standard long code, with carrier fees added on top.

That means a company that sends 100,000 verification codes in a month pays about $830 before carrier fees, and one that sends 2,000 pays about $17.

Subscriptions with overages

Plenty of AI products mix a subscription with metered usage, so a plan includes a monthly allowance of credits, tokens, or API calls, and anything above that allowance is billed per unit.

That's the base-fee-plus-overage structure, and it's often the first step a subscription product takes toward metering.

Benefits of metered billing

These are the reasons product and finance will give you for switching, and they’re worth knowing before you scope the build:

  • Customers pay for what they use: light users aren't subsidizing heavy users, and nobody pays for capacity they never touch.
  • Lower entry cost: a new customer can start small without committing to a big plan, which makes the first purchase easier.
  • Revenue grows with usage: as customers use more, you earn more, without renegotiating a contract.
  • Less churn from overpaying: customers who go through a quiet month see a smaller bill, which gives them less reason to cancel.
  • Pricing that tracks your costs: when usage drives your own spend (compute, tokens, bandwidth), metering keeps margins from eroding as heavy users scale.

When to use metered billing

Metered billing makes sense when usage varies significantly across customers, and that variation is big enough that a flat rate would be unfair to one side.

Use metered billing when:

  • Usage per customer spans orders of magnitude (a free user makes 100 API calls; an enterprise customer makes 100 million)
  • Your product has real marginal costs tied to usage, like compute, tokens, data transfer, or storage
  • Customers expect to pay in proportion to the value they get
  • You need to stop a few heavy users from consuming resources that degrade service for everyone else

It usually isn't worth it when:

  • Usage differences between customers are small and don't map to real cost differences
  • The usage metric is hard to explain to customers in a way that feels fair
  • The tracking infrastructure costs more to build than the pricing precision is worth

AI products have made metered billing far more common in SaaS. LLM inference has direct marginal costs, so more tokens consumed means more compute spent, and that cost structure makes flat-rate pricing hard to sustain at scale.

What to weigh before switching

Moving from flat pricing to metered billing changes more than the invoice, so check these before you commit:

  • Tracking infrastructure: can your systems capture, deduplicate, and aggregate usage reliably today, or does that pipeline still need to be built?
  • Bill predictability: some customers, especially enterprise buyers with fixed budgets, prefer a known monthly number. Caps, alerts, or committed plans can help.
  • Finance and support requests: finance will ask for usage data to forecast revenue, and support will need per-customer usage to explain bills, so plan those views from the start.
  • Internal alignment: sales, support, and finance all need to explain the model with confidence before it reaches customers.
  • Enforcement: decide upfront what happens when a customer hits a limit or runs out of credits, because the billing system won't stop usage on its own.

Metered billing vs. usage-based billing

Metered billing and usage-based billing are often used interchangeably.

When people do separate them, usage-based billing is the commercial model (deciding to charge for usage at all), and metered billing is the mechanism that measures, aggregates, and prices that usage.

There's also an architectural choice inside that mechanism. Some teams pre-aggregate usage in their own pipeline and send totals to billing, which keeps metric logic under their control but means every pricing change touches the pipeline.

Others send raw events and let the billing layer aggregate them, which moves complexity out of your code but raises the stakes on event volume and schema consistency.

Approach What billing receives Where metric logic lives Pricing changes
Pre-aggregated Totals per customer Your data pipeline Pipeline updates and backfills
Raw events Individual usage events The billing or metering layer Configuration changes

Billing tracks and charges for usage, and enforcement of limits happens in a different layer, before billing ever sees the data.

What metered billing requires engineers to build

Most teams underestimate the scope of a metered billing implementation. The billing platform handles invoicing and payment processing, and everything upstream is yours.

The systems your team ends up building or maintaining include:

  • Event ingestion: a pipeline that captures usage events, attributes them to the right customer and subscription, and stores them durably at scale (usage metering covers the architecture)
  • Deduplication logic: protection against double-counting when services retry or recover from outages
  • Aggregation layer: logic that rolls raw events up into the quantities your billing platform expects
  • Limit enforcement: real-time checks that stop or warn customers approaching a cap before the invoice is generated
  • Mid-cycle handling: logic for upgrades, downgrades, and cancellations partway through a billing period
  • Grandfathering: support for customers on legacy pricing who shouldn't move to new rate cards automatically

The initial scope rarely accounts for edge cases that only appear at scale.

Miro launched a credit-based AI pricing model in under six weeks with Stigg and saved 5,000 engineering hours it would have spent building and maintaining that infrastructure in-house.

Best practices for metered billing

The teams that run metered billing smoothly tend to do the same few things well.

Pick a value metric customers understand

Charge for a unit customers can see and predict, like API calls, messages, or tokens. If a customer can't estimate next month's bill from their own usage, expect disputes.

Track usage in real time

Report usage as it happens, with an idempotency key on every event, so retries can't double-count and dashboards stay current. Batch jobs that run once a night make both limits and dashboards stale.

Test billing scenarios before launch

Simulate real usage patterns, including retries, traffic spikes, outages, and mid-cycle plan changes, then compare system-generated usage against raw event logs. Billing bugs found in staging are cheap, but ones found on an invoice can get expensive.

Show customers their usage

Give customers dashboards, threshold alerts, and itemized line items that match your internal numbers. If the two drift apart, you’ll spend sprints debugging the difference.

Enforce limits before usage happens

Decide what each plan allows and check it in the request path, before the expensive work runs. The next section shows how that check works.

How entitlements work in metered billing

Entitlements define what each customer is allowed to use and enforce those limits before billable activity happens, so metered billing only records consumption the customer was allowed to make.

In a metered system, entitlements are the guardrails:

  • One plan might allow 50,000 API calls a month
  • Another might allow 1,000
  • Enterprise plans may have custom or unlimited limits

These limits are enforced at runtime, before the request is processed. If a customer is over their entitlement, the system can block the request, throttle it, or prompt an upgrade.

Entitlements can come from several sources at once, like the base plan, add-ons, trials, and promotional grants, and the system resolves them into a single effective limit. In Stigg, when sources conflict, the most generous value wins.

What an entitlement check returns

In Stigg's API, a check entitlement call returns structured data your code can act on during the request:

  • isGranted: whether this request can proceed
  • usageLimit: the allowed cap for the period
  • currentUsage: what has been consumed so far
  • hasUnlimitedUsage: whether a limit applies at all
  • accessDeniedReason: why access was denied, such as requested usage exceeding the limit

The backend checks the entitlement first. If it's granted, the request runs and usage is reported. If not, the request is blocked or flagged. Billing happens after usage, and enforcement happens before it, which is how metered billing connects to how your product behaves in production.

Credits in metered billing for AI products

Credits are a prepaid version of metered billing. Customers buy credits upfront and spend them as they use the product. They're common in AI products, where usage maps to tokens, compute, or model calls.

Supporting credits takes more than tracking usage:

  • Credits are issued as grants, each with its own expiry date and cost basis
  • Paid and promotional credits are tracked separately
  • Burn order matters, so promotional or soon-to-expire credits are usually consumed first

Depletion behavior also needs to be defined:

  • Hard limits deny usage when the balance runs out
  • Soft limits let usage continue and track the overage as a negative balance, which your own commercial policy then settles

Every grant, deduction, and expiry has to land in an append-only ledger, which finance uses for revenue recognition and support uses for audits and disputes. That ledger, plus burn order and expiry, is the part teams tend to underestimate, and it's built into Stigg's credits engine.

When teams outgrow in-house systems

Most teams start with a simple setup, and it works well early on. Things get more complex as pricing evolves.

Early stage (works fine) At scale (breaks down)
A few database tables Legacy and grandfathered plans
Conditional logic for limits Multiple products with different usage rules
Basic feature flags Frequent pricing changes and add-ons
One system Systems inherited from acquisitions

What started as a quick solution turns into a system that needs ongoing maintenance and coordination across teams.

Enterprise accounts add another layer, with teams, departments, products, and agents all drawing from shared budgets, and the enforcement layer has to stay accurate and fast across all of it.

That's usually when teams either rebuild internally or move to dedicated infrastructure.

Keep metering, enforcement, and billing in sync

Metered billing tends to break at the seams, in the form of an event counted twice, a limit checked after the compute already ran, or a credit balance that doesn't match the invoice. Your billing system handles invoices, tax, and payments well, but it sees usage only after it happens.

Stigg is a usage runtime that sits in your request path, checks entitlements and credits before the expensive work runs, then meters what actually happened.

It works alongside your billing system, with native integrations for billing (Stripe, Zuora, Chargebee) and invoicing (Stripe Invoicing, Airwallex).

With Stigg, engineering teams can:

  • Check entitlements in the request path: effective limits combine plans, add-ons, trials, and promotional grants into one answer per request.
  • Report usage without double-counting: batches of up to 1,000 events, parallel reporters with no coordination, and built-in idempotency so duplicates count once.
  • Serve checks from inside your infrastructure: the Sidecar answers from an in-memory cache by default (Redis persistence is optional), fetches misses from the Edge API at around 100 ms, and returns configured defaults if the network times out.
  • Run credits on an append-only ledger: grants carry expiry, cost basis, category, and burn priority, with hard or soft limits per wallet.
  • Meter at volume in your own cloud: BYOC metering processes 1M+ events per second inside your VPC, with no per-event cost.
  • Start where the pain is: adopt entitlements or the credits ledger first, without moving your whole stack, and add the rest on the same platform later.

When the same system enforces limits and reports usage, the numbers your product allows and the numbers your invoice charges stop drifting apart.

If you're building this layer now, the Stigg docs are a good place to start, or talk to a human about how it would fit into your stack.

FAQs

What is metered usage?

Metered usage is the measured consumption of a product or service, such as API calls, tokens, gigabytes stored, or kilowatt-hours, recorded per customer over a billing period. Metered billing turns that recorded usage into charges by applying a rate.

Can I bill customers based on usage?

Yes, you can bill customers based on usage by tracking billable events per customer, aggregating them each period, and applying a per-unit, tiered, or base-plus-overage rate. Stripe, Chargebee, and Zuora all support usage-based charges once your system sends them accurate usage data.

What is the purpose of cloud metered services?

The purpose of cloud metered services is to charge customers only for the compute, storage, and data transfer they consume. Metering lets cloud providers like AWS and Azure price resources precisely, and it lets customers start small and scale without long fixed contracts.

How do you track usage accurately in metered billing?

You track usage accurately in metered billing by capturing every billable event with a unique identifier and storing it in a reliable event pipeline. Idempotency keys and deduplication logic prevent double-counting, and reconciling totals against raw event logs catches anything that slips through.

What is the difference between usage limits and billing limits?

The main difference between usage limits and billing limits is timing. Usage limits control access in real time, before a request runs, while billing limits only affect how charges are calculated after usage has happened.

Latest news.

One email per month.
From engineers, for engineers.

Thank you! Your submission has been received.
Oops! Something went wrong while submitting the form.