icon of Lago

Lago

Lago is an open source usage-based billing API for SaaS companies that need metered, hybrid, or consumption-based pricing without Stripe Billing's subscription model constraints. AGPL-3.0 licensed.

9.7K stars601 forksGoAGPL-3.0Active this week
Open source alternative toStripe BillingChargebeeZuora

What Lago does

Lago is an open source billing and metering API that lets SaaS companies implement usage-based, tiered, and hybrid pricing models with precise event ingestion and invoice generation, serving as a self-hostable alternative to Stripe Billing and Chargebee.

The Problem

Stripe Billing and Chargebee are built around flat subscription plans and seat-based pricing. SaaS products with usage-based or consumption pricing (charging per API call, per GB processed, per active user) require complex workarounds: custom metering logic, external event aggregation, and manual invoice line items that break Stripe's subscription model or require expensive add-ons.

How Lago Solves It

Lago ingests usage events, aggregates them by billing metric (count, sum, max, unique count), and generates invoices according to configurable pricing rules. It handles tiered pricing, graduated billing, pay-in-advance, and hybrid subscription-plus-usage models. The open API and webhook system integrate with any payment processor. AGPL-3.0 licensed; deploy via Docker.

Key Features

  • Flexible billing metrics: count, sum, max, and unique count aggregations over any event property
  • Multiple pricing models: flat rate, per-unit, tiered, graduated, and pay-in-advance in any combination
  • Invoice generation with PDF export, credit notes, taxes, and coupon and discount management
  • Webhook events for payment processor integration (Stripe, GoCardless, Adyen, and others)
  • Real-time metering: events are ingested and visible in the billing dashboard within seconds
  • AGPL-3.0 licensed; self-host via Docker Compose or use Lago Cloud for managed hosting

Who It's For

Lago is best for SaaS teams implementing usage-based or hybrid pricing models who need precise metering, flexible billing logic, and clean invoice generation without paying Chargebee or Zuora's platform fees. It suits engineering teams that want to own their billing data and pricing logic in code rather than in a SaaS dashboard.

Compared to Stripe Billing

Unlike Stripe Billing, Lago is purpose-built for usage-based and consumption pricing with native event metering and flexible metric aggregation. Stripe Billing handles subscriptions well but requires complex workarounds for true per-unit consumption pricing. Lago runs on your own infrastructure and stores billing data in your PostgreSQL database.

GitHub Activity

Last commit

1 day ago

Last synced

May 13, 2026

9.7KStars
601Forks
24Open Issues
AGPL-3.0License

Tech Stack

Detected via GitHub

Languages

GoRuby

Frameworks

React

Details

Frequently Asked Questions

Similar Open Source Tools

Stay Updated

Subscribe to our newsletter for the latest news and updates about Alternatives