Getlago

Lago for developers

Build and verify billing with the CLI

Configure billing and inspect usage from your terminal on managed Lago Cloud. Use OpenAPI for exact schemas and an SDK or REST API in your application. Self-hosting is optional.

Lago CLI.

Start here to configure billing, inspect JSON results, and verify usage from your terminal or coding agent.

OpenAPI specification.

Read exact request and response schemas, generate clients, or build agent tools from the complete API contract.

REST API.

Create customers, plans, subscriptions, and events over a typed REST API. Scoped bearer keys, pagination, and regional base URLs.

Official SDKs.

Ship with maintained JavaScript, Python, Ruby, Go, PHP, and Kotlin clients generated from the API contract.

Webhooks.

Receive billing events with delivery retries and idempotency keys. Verify every payload with a JWT or HMAC signature.

MCP server.

Connect Claude, ChatGPT, and other MCP clients to Lago billing data and operations through a documented server.

Developer integration FAQ

Does Lago update prepaid credit balances in real time?

Yes. Lago’s ongoing wallet balance typically refreshes in under a second after a new event is included in usage. It reflects remaining prepaid credits after current usage, including taxes.

Use this live balance in customer dashboards and configure balance alerts and automatic top-ups.

See the event-to-wallet flow and wallet documentation.

Can Lago handle negotiated enterprise contracts?

Yes. Customize subscription fees, usage rates, minimum commitments and billing thresholds for each customer’s subscription while keeping a shared plan structure.

Lago applies those negotiated terms when calculating charges and generating invoices.

Explore customer-specific pricing.

Do I need to self-host Lago or manage billing infrastructure?

No. Lago Cloud is a fully managed billing platform. Lago handles hosting, scaling, upgrades and monitoring. Your team connects customer and usage data, configures pricing and connects your payment and finance tools.

Self-hosting is also available if you prefer to operate Lago in your own environment.

Explore managed Lago Cloud.

Can business teams change pricing without an engineering deployment?

Yes. Once your customer and usage data are connected, business teams can configure plans, prices and discounts directly in Lago’s dashboard.

Launch new offers or adjust customer-specific pricing using Lago’s existing billing configuration.

Explore plan configuration.

Can I test a real customer contract before switching billing systems?

Yes. Model the contract in a separate test environment, send representative usage and compare the resulting invoices with your current system. Include discounts, credits, taxes and payment settings so your team can validate the complete billing flow.

Explore integration testing

Can I stop usage when a customer runs out of prepaid credits?

Yes. Configure Lago’s ongoing balance alerts to trigger a restriction in your application when credits reach your chosen threshold. Your application enforces access using those alerts and its own request checks.

You can also set earlier thresholds to warn customers and prompt them to top up before their credits run out.

Explore credit balance alerts.

Enterprise-grade security and privacy

SOC 2 Type II

SOC 2 Type II

Your data is protected with enterprise-grade rigor.

Self-host

Flexible Deployment

Deploy Lago on-prem, in a VPC or elsewhere.

Role Based Access Control

RBAC

Role-based access control to set user roles and permissions.

Lago self-hosted

Deploy Lago seamlessly on your own infrastructure to keep full control.

Create a Lago plan from plan.json using the CLI:

lago plans create --input @plan.json --output json

Example Lago JSON response for a yearly Basic plan with usage-based API charges:

{
  "plan": {
    "name": "Basic",
    "code": "basic",
    "interval": "yearly",
    "amount_cents": 90000,
    "amount_currency": "USD",
    "charges": [
      {
        "billable_metric_code": "api_calls",
        "charge_model": "standard"
      }
    ]
  }
}