Stripe Metered Billing

Choosing between reporting raw or pre-aggregated data to Stripe is pivotal in implementing usage-based billing. This decision shapes your primary data source for consumption metrics—Stripe or a dedicated metering system. Considerations include operational scale and intricacies of data usage, as Stripe has limitations in query capabilities and rate limits.

Do I need a metering system?

When engineers decide whether to report usage records to Stripe directly or use a metering system like OpenMeter, the question concerns two aspects of metering:

  1. Writing usage records
  2. Reading aggregated usage

1. Consider your metering load

Let's start discussing the write or ingestion side of metering. With usage-based pricing models, you must record every billable event in your system. The volume of these events depends on your business, customers, and pricing model. For example, a company charging after every API call or AI token usage likely must track millions of events from the early days of business, and they will run into scaling issues quickly as their customer base grows. This can quickly lead to rate limiting if you report raw usage to Stripe and use it as your primary metering system. This is especially true with traffic spikes and bursty load. Let's see common data ingestion use cases with their metering requirements:

Usage Write Use CasesMetering Requirements
Company scale is growingScalable ingestion
Traffic and usage spikesCapturing all events without rate limits
Retries and network errors in distributed systemsDeduplicating usage events

To summarize, when it comes to ingesting billable events, the primary consideration is volume. If you anticipate a larger scale of product consumption, reporting usage directly to Stripe will not be sustainable, and you need an external metering system like OpenMeter.

2. Reading meters

In a usage-based company, you will consume the aggregated and metered usage in multiple places, from product to sales and finance. These use cases have different volume, latency, and integration data requirements. If you use Stripe to aggregate usage, and this way, it becomes the source of truth for your metered usage; you will run into scenarios where you get restricted by their APIs, latencies, and rate limits. Let's look at some of the common use cases where you need to read metered usage and consider data requirements:

Usage Read Use CaseData Requirements
Billing from metersRobust reporting to the billing provider
Customer consumption dashboardsInstant meter aggregations
Enforcing usage limits and quotesLow-latency data access
Providing data to sales and CSIntegration with Salesforce and CRMs
Cost and unit economics calculationsFlexible usage querying

In summary, Stripe APIs are limited to retrieving metered usage and in many cases, don't provide the requirements to use it as a source of truth to read your meters and power your team's data needs.

How does OpenMeter help?

OpenMeter provides a robust usage metering solution that handles the load, usage spikes, and duplicates required to implement accurate usage-based billing. It provides instant aggregates on meters with low latency to access your usage data and power your team's metering data requirements. At the same time, it can continuously report aggregated usage to Stripe and other payment providers with an exactly-once guarantee. OpenMeter was built with experience working at Stripe, Netflix, IBM, and Cisco to serve your metering needs.

Last edited on February 23, 2024