Langfuse scales cloud billing with Stripe while metering billions of events

Langfuse builds an open-source LLM observability platform that helps engineering teams trace, evaluate, and monitor AI applications. By adopting Stripe Billing’s usage-based capabilities and related APIs, Langfuse implemented a hybrid subscription-plus-metered model that accurately invoices customers and supports graduated volume pricing.

Prodotti utilizzati

    Billing
    Payments
    Checkout
    Tax
In tutto il mondo
Start-up

Challenge

Langfuse needed to balance its open-source commitment with a sustainable cloud business model. Since anyone can self-host for free, its cloud offering had to be competitively priced, easy to understand, and aligned with customer value. Langfuse began with a homegrown billing system that used a simple flat per-event rate, but that setup could not support the pricing flexibility and accurate metering the company needed as it scaled.

As Langfuse grew, it became clear the company needed graduated per-event tiers and tiered monthly plans so pricing would scale with usage and reflect volume discounts. Customers range from accounts processing 100,000 events per month to hundreds of millions, and each event produces marginal costs for Langfuse. The company wanted automatic volume discounts so pricing would scale without requiring custom negotiations.

The team also faced several billing edge cases. Checkouts sometimes showed $0 because usage is billed after the fact, confusing customers. Enterprise trials required payment details up front, but the standard checkout flow didn’t support this. Plan changes could terminate the current billing cycle, causing customers to lose prepaid days. Langfuse also needed reliable tooling and testing for complex upgrade or downgrade behavior, and wanted spend alerts expressed in dollar amounts rather than event counts. At the same time, Langfuse needed a dependable approach to recover failed payments without manual collections and a unified global solution for taxes and payments so it could bill customers across regions.

Solution

To enable reliable, scalable metered billing that ties usage to value, Langfuse implemented a hybrid model with Stripe Billing’s usage-based billing. Customers subscribe to tiered monthly plans, and each subscription includes a separate Langfuse Cloud metered usage product that records events. The tiered plans address different customer needs, while the metered usage product tracks event ingestion consistently across all plans so pricing scales with usage. Langfuse posts hourly event counts from its ClickHouse/OLAP data store to Stripe’s metered usage API for accurate billing with near-real-time visibility.

The team chose Stripe Checkout to create subscriptions and Billing to produce a single invoice with separate line items: the up-front SaaS fee (charged at cycle start) and end-of-period usage. This eliminates $0 checkouts and customer confusion while capturing payment details during signup to meet enterprise procurement requirements. Subscription schedules and Stripe’s proration controls let Langfuse apply upgrades immediately while preserving usage accumulation, and schedule downgrades to maintain paid access through the current billing period.

Because native alerts didn’t match Langfuse’s dollar-based needs, the team uses Stripe’s preview-invoice feature hourly to compute dollar exposure. When customer thresholds are exceeded, the system triggers email and in-app notifications. Webhooks synchronize subscription and payment state into Langfuse’s product. For analytics and reconciliation, Langfuse syncs Stripe data to BigQuery via Airbyte and combines it with product analytics (dbt, Metabase); operational webhook events also feed a Slack channel for real-time visibility.

For payment recovery, Langfuse uses Stripe’s built-in automated retry logic and follow-up emails rather than manual collections. The team monitors failed payments in the Stripe Dashboard and syncs subscription states (past_due, unpaid) via webhooks to display in-app banners that prompt customers to update payment details.

To manage taxes globally, Langfuse uses Stripe Tax alongside Stripe’s global payment platform, which calculates applicable taxes, supports local payment methods, and provides a single integration for cross-border billing.

Results

Pricing is clear, and volume discounts are automated

Langfuse implemented a clear hybrid model in two weeks: an up-front SaaS fee plus graduated per-event charges in Stripe. Graduated tiers apply automatically as usage grows, removing the need for individual volume negotiations.

Upgrades prorate immediately while preserving usage continuity

Using Stripe’s subscription schedules and flexible billing, Langfuse prorates upgrades and invoices the prorated amounts right away while keeping accumulated usage and tier progress intact. Downgrades are scheduled to take effect at the end of the billing period, so customers retain paid-feature access until then.

Stripe handles metered usage at scale

Langfuse ingests event counts hourly into Stripe’s metered usage API, managing up to 200 million events per month for single accounts and hundreds of millions to billions across all customers. Metered billing ensures usage is recorded and invoiced through Stripe.

Dollar-based spend alerts use preview invoices

Langfuse generates preview invoices hourly via Stripe and compares dollar amounts to user-configured thresholds, triggering email and in-app notifications when limits are exceeded. Stripe webhooks keep subscription and payment-state data synchronized for the product and operations teams.

Stripe-native tools reduce maintenance overhead

The team is progressively replacing custom billing features with Stripe-native capabilities. The latest end-to-end revamp using Stripe’s flexible billing and metered usage took one month.

Massima trasparenza dei costi

Tariffazione integrata per transazione, senza costi occulti

Avvia la tua integrazione

Inizia a usare Stripe in appena 10 minuti