DEV Community

Alex Spinov
Alex Spinov

Posted on

Lago Has a Free API — Open-Source Billing and Usage Metering

Lago is an open-source billing platform for usage-based pricing. It handles metering, invoicing, and subscription management with a full REST API.

What Is Lago?

Lago replaces Stripe Billing for usage-based pricing. It meters usage events, calculates charges, generates invoices, and integrates with payment providers.

Free (self-hosted): Unlimited
Cloud: Free tier available

Quick Start

git clone https://github.com/getlago/lago.git
cd lago
docker compose up -d
Enter fullscreen mode Exit fullscreen mode

REST API

# Send usage event
curl -X POST https://api.getlago.com/api/v1/events \
  -H "Authorization: Bearer YOUR_KEY" \
  -d '{"event":{"transaction_id":"tx_123","external_subscription_id":"sub_1","code":"api_calls","properties":{"count":1}}}'

# Create customer
curl -X POST https://api.getlago.com/api/v1/customers \
  -H "Authorization: Bearer YOUR_KEY" \
  -d '{"customer":{"external_id":"cust_1","name":"Alice Corp","email":"billing@alice.com"}}'

# Get invoices
curl https://api.getlago.com/api/v1/invoices \
  -H "Authorization: Bearer YOUR_KEY"
Enter fullscreen mode Exit fullscreen mode

Use Cases

  1. Usage-based billing — charge per API call, GB, seat
  2. Hybrid pricing — subscription + usage
  3. Metering — track any usage metric
  4. Invoicing — automated invoice generation
  5. Revenue reporting — MRR, churn, ARPU

Lago vs Alternatives

Feature Lago Stripe Billing Chargebee
Open source Yes No No
Usage metering Native Limited Limited
Self-hosted Yes No No
Price Free/OSS % of revenue $249+/mo

Need web data at scale? Check out my scraping tools on Apify or email spinov001@gmail.com for custom solutions.

Top comments (0)