

Lago is an open-source billing platform built for companies managing usage-based, subscription, and hybrid pricing. Its product combines usage metering, invoicing, prepaid credits, entitlements, payment collection, revenue analytics, and flexible deployment. Lago also provides an Agent SDK that normalizes LLM usage and converts token or model-cost data into billing events.
That makes Lago relevant to SaaS, API, infrastructure, and AI products whose economics no longer fit neatly into flat recurring subscriptions. As AI products become more autonomous, the commercial stack can extend beyond billing into agentic payments infrastructure, where spending authority, request-level authorization, and settlement become part of the transaction itself.
Lago operates as a billing layer between product usage and the systems responsible for collecting and recording revenue. Plans can combine recurring charges, usage-based components, commitments, entitlements, and invoicing rules rather than tying the commercial model to a simple flat subscription.
Its open-source foundation is central to the product. Lago uses the GNU AGPLv3 license, giving teams access to the underlying code and the option to operate the platform on their own infrastructure. Lago Premium is also available through both cloud and self-hosted deployment.
Lago covers the major functions required for complex SaaS and AI billing:
This structure gives teams room to change packaging and pricing as the product evolves without rebuilding billing logic around every new commercial model.
Usage-based billing is one of Lago's primary use cases. Instead of charging every customer the same amount, businesses define billable metrics around the units customers actually consume and apply pricing rules to those measurements.
For SaaS and API products, those units might include requests, transactions, active users, storage, or compute. AI products can add tokens, model calls, and other workload-specific consumption to the mix.
Many products need both predictable recurring revenue and variable usage charges.
A plan might include a monthly platform fee, an included usage allowance, and additional charges after that allowance is consumed. Lago supports these hybrid structures alongside fixed charges, commitments, entitlements, and progressive billing.
This is particularly useful for AI products because consumption can vary sharply between customers. When pricing also needs to adapt to individual workloads, dynamic pricing patterns provide examples based on tokens, request complexity, time, and usage tiers.
AI and API products can generate a large number of small billing events. Lago separates the usage event from the pricing rule, allowing teams to meter consumption first and determine the resulting charge through the billing plan.
Its event infrastructure is designed for large workloads. ClickHouse documents how Lago built an ingestion architecture around ClickHouse Cloud, ClickPipes, and Kafka or Redpanda to support million-event billing workloads at the upper end of its scaling requirements.
That architecture is relevant when model calls, API requests, or transactions produce far more billing activity than a conventional monthly subscription system.
Lago's Agent SDK brings usage metering directly into supported LLM applications. It wraps supported model clients, extracts normalized usage from responses, and streams billing events to Lago in the background.
The SDK supports two main billing modes.
Token mode sends normalized token quantities into Lago. The associated plan determines how those units translate into customer charges.
This works well when a business wants to define its own commercial units or keep customer-facing pricing independent of an external model-price source.
Price mode looks up the model's token price, calculates the underlying cost, applies an optional markup, and sends the resulting cost to Lago.
The billing events can retain details such as model, provider, token type, base cost, markup, and final amount. That gives AI companies a clearer connection between upstream model costs and downstream customer pricing.
Automatic instrumentation does not cover every AI workload.
Lago currently documents automatic wrappers for selected model providers and chat or completion surfaces. Embeddings, image and video generation, audio endpoints, batch APIs, and some provider-specific interfaces can require custom usage events instead.
The relevant evaluation is therefore not simply whether a provider appears on the supported list. Teams need to confirm that the exact production workload is instrumented or plan for custom event collection.
Prepaid credits and entitlements extend Lago beyond basic postpaid invoicing.
Lago wallets let businesses fund usage in advance and apply credits against eligible invoices. Wallet configuration can cover eligible fees or billable metrics, expiration, and top-up rules.
Lago also exposes an ongoing balance that accounts for current consumption. The estimate refreshes every five minutes or when an invoice is finalized, giving applications a more current view of remaining prepaid value than the finalized balance alone.
This model fits products that want customers to fund variable usage before it accumulates into unrestricted postpaid spend.
Entitlements connect commercial plans to product access.
Lago can define feature gates, privileges, allowances, and quotas for a plan or individual subscription. A company could therefore use one plan to include a limited API allowance and another to provide higher quotas or additional functionality.
For paid machine-accessible services, access may eventually need to be checked inside the transaction itself. Request payment validation provides a pattern for confirming commercial authorization before a protected workload executes.
Progressive billing gives Lago a way to invoice high-consumption accounts before the normal billing cycle ends.
Teams can configure step-based or recurring thresholds. When cumulative usage reaches one of those thresholds, Lago generates an invoice during its progressive-billing process rather than allowing all charges to accumulate until period end.
Lago then connects invoicing with payment collection. Its current official payment-provider integrations include Stripe, GoCardless, and Adyen, while community and custom integration options cover additional providers. Native integrations can synchronize customer data, initiate payments, generate payment links, update invoice status, and support credit-note refund workflows.
That arrangement keeps billing calculations separate from payment processing. When an application instead needs authorization attached directly to an individual service request, a payment-aware request flow moves the commercial check closer to execution.
Lago supports managed and self-hosted deployment. Premium capabilities can run through Lago Cloud or a self-hosted environment, and Lago also promotes flexible deployment for organizations that need more control over infrastructure location.
Its fully hosted product has achieved SOC 2 Type II compliance. Lago also documents encryption at rest and in transit for hosted customers.
Self-hosting gives teams greater control over where billing infrastructure and data operate, but it also increases operational ownership.
Teams need to account for areas such as:
This makes self-hosting most practical when infrastructure control is valuable enough to justify the additional engineering work.
Lago offers a forever-free open-source product alongside Lago Premium.
Premium pricing is not published as one universal monthly rate. Lago structures packages around company stage and usage dimensions such as events ingested, invoices generated, or active customers. Premium capabilities can be deployed through the cloud or self-hosted.
The open-source edition removes the software license cost, but not the full operating cost. Infrastructure, upgrades, monitoring, engineering ownership, and incident response should all be included when comparing self-hosting with a managed deployment.
Lago's strongest characteristics center on billing flexibility and infrastructure control.
Subscriptions, usage charges, prepaid credits, commitments, entitlements, and progressive billing can operate within the same billing architecture.
That gives teams room to change packaging without treating each pricing experiment as a new infrastructure project.
The Agent SDK reduces the custom work required to turn supported LLM consumption into billing events.
Token mode supports teams that want to control their own pricing logic, while price mode connects underlying model costs and markup more directly to customer charges.
The combination of open-source and Premium self-hosted deployment gives organizations more choice over where billing infrastructure runs.
This is particularly relevant to teams with dedicated platform engineering or infrastructure requirements that make SaaS-only billing less suitable.
Lago is structured around event-heavy billing rather than only recurring subscription records.
For AI, API, and infrastructure products, that makes the platform better aligned with commercial models where thousands or millions of usage events can contribute to customer charges.
Lago covers a broad billing surface, but several factors deserve close evaluation.
Running Lago internally shifts deployment, upgrades, observability, availability, and infrastructure maintenance to the operating team.
Open-source access creates flexibility, but it does not remove the operational work required to run production billing infrastructure.
The Agent SDK simplifies billing for supported LLM surfaces, but teams still need custom instrumentation for workloads outside its wrappers.
Applications using multiple modalities, specialized endpoints, or unsupported providers should test coverage against their actual production architecture before relying on automatic event capture.
Billing an agent's usage and giving an agent authority to spend are different commercial operations.
Once software becomes the buyer, the system needs to establish what the user authorized, how much the agent can spend, how a merchant verifies that authority, and how the resulting transaction is settled.
This is becoming a broader industry concern. Google's Agent Payments Protocol uses verifiable mandates to represent user intent and transaction authorization in agent-led commerce.
For AI products reaching that stage, billing remains necessary, but it becomes one component of a larger transaction stack.
As AI products move beyond metering customer usage, they need infrastructure that lets agents transact without requiring a human to approve every purchase. Nevermined is purpose-built for that stage of the commercial stack, connecting payment authorization, pricing, metering, spending controls, and settlement to autonomous workflows.
Nevermined places payment verification directly inside the service request.
An API, agent, MCP tool, or protected resource can communicate payment requirements through x402. The caller submits payment authorization, Nevermined verifies the relevant permissions, and the workload proceeds once those requirements are satisfied.
The x402 facilitator overview explains how verification and settlement operate across these payment-aware interactions.
For model calls, data requests, tool executions, and other paid workloads, this lets the provider establish payment authority before consuming the underlying resource.
AI services do not all generate value in the same way.
Nevermined supports dynamic pricing patterns based on tokens, request complexity, time, usage tiers, and application-defined metrics. Credits-based, time-based, dynamic, and hybrid structures can also be applied depending on how the service is sold.
This gives teams flexibility to price the workload itself instead of forcing every agent or API into a fixed subscription or flat per-request charge.
Nevermined also supports the buyer side of agentic commerce.
Its card delegation controls let users give agents bounded purchasing authority without exposing raw card credentials. Delegations can include a spending limit, expiration period, transaction cap, API-key restriction, and revocation controls.
Nevermined also supports two x402 schemes for crypto and fiat/card transactions. The nvm:erc4337 scheme uses ERC-4337 smart accounts and session keys, while nvm:card-delegation supports delegated card-payment flows.
As agent deployments expand, individual spending limits are not enough.
Nevermined provides groups and budgets that let organizations centralize funding while enforcing separate spending ceilings across teams or agent groups. Shared payment methods can fund multiple groups without giving every agent unrestricted access to organizational funds.
These controls keep financial policy outside the agent's own reasoning while preserving autonomous execution inside defined boundaries.
Nevermined connects payments with the operational data behind the workload.
Its payment observability tools can track request activity, token usage, costs, performance, credit consumption, and custom metadata. That gives teams more visibility into how individual agents, plans, and paid workflows perform after monetization goes live.
The same data can support pricing adjustments, margin analysis, and operational oversight as transaction volume grows.
Nevermined is designed to reduce the amount of custom infrastructure required to begin monetizing an AI service.
Its quickstart documents a working payment integration in five minutes for an agent API, MCP tool, or protected resource. Teams can start with payment validation and settlement, then add dynamic pricing, delegated spending, organization controls, and observability as the service scales.
Nevermined currently charges 1–2% of settled transaction volume, with no setup fees or minimums. For AI products moving from usage billing into autonomous commerce, Nevermined provides the infrastructure to let agents pay, accept payments, and transact within programmable financial boundaries.
Lago is used for usage metering, subscription billing, usage-based pricing, invoicing, prepaid credits, entitlements, and payment-collection workflows. It is particularly relevant to SaaS, API, infrastructure, and AI products whose pricing depends on measurable consumption. Its open-source architecture also gives organizations the option to operate the billing stack through a self-hosted deployment.
Lago can support AI usage-based billing through its Agent SDK, which normalizes supported LLM usage and generates token- or cost-based events. Applications outside the SDK's automatic coverage can submit custom usage data instead. When pricing also needs to adapt directly to individual service requests, dynamic pricing patterns cover token, complexity, time, and usage-tier calculations.
Lago covers important monetization functions such as metering, credits, entitlements, invoicing, and payment collection. Autonomous purchasing introduces an additional requirement when an agent must present payment authority before receiving a protected service. An x402 request flow can place that authorization directly in the machine-to-machine interaction.
Businesses can keep financial authority outside the agent's own reasoning by placing hard limits around delegated payment access. Nevermined's card delegation controls support spending limits, expiration, transaction limits, API-key restrictions, and revocation. Larger deployments can add organization spending controls to keep shared funding subject to team-level budgets.
Integration time depends on the existing application, authentication model, pricing requirements, and production environment. Nevermined documents a working payment integration in five minutes for an agent API, MCP tool, or protected resource. Teams can then add workload-specific pricing, delegated spending, organizational policies, and observability as the payment workflow expands.

See Nevermined
in Action
Real-time payments, flexible pricing, and outcome-based monetization—all in one platform.