Getlago

AI billing software

Bill AI usage as your pricing evolves

AI companies like CoreWeave, Groq and Mistral AI use Lago to meter tokens, GPU time and agent actions in real time. Bill them pay-as-you-go, with prepaid credits, subscriptions, hybrid plans or enterprise contracts, all in one usage-based billing platform.

Lago meters input, output, and cached tokens in real time. Usage events from sources such as OpenAI, Anthropic, Google Gemini, Mistral, Ramp Router, Snowflake Cortex, Databricks, Cloudflare, AWS Kinesis, Amazon S3, Google Cloud, Redis, and Azure stream into one chart showing 1.2 million tokens. An events feed lists each metric as it arrives, at rates between 100 and 50,000 events per second.

Trusted by the most innovative companies

Mistral AI
PayPal
Groq
Synthesia
Laravel
Swan
Epicor
1NCE
Cerebrium
Blacksmith
Lune
OQC

Every AI pricing model, one billing engine

Start with one model, add the next when your pricing changes, and mix them in a single plan.

Charge for every minute, token or request, with no commitment.

LLM token usage in Lago, broken down by model and token type, above the revenue it billed over the year

Metering and billing for AI agents

AI Billing SDK

Wrap your OpenAI, Anthropic or Bedrock client and every model call becomes a usage event in Lago.

Agent spend control

Fund agents with prepaid wallets and get alerted as balances run low, before spend gets out of hand.

x402 Payments

Let agents pay per request over HTTP 402, with each payment tied to the usage it covers.

Tools for AI agents

Connect agents to Lago through the MCP server, the CLI or the API. Each one reads and writes the same billing data.

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"
      }
    ]
  }
}

Meter every token,
GPU-second and agent action

Engineering gets granular usage data.
Finance gets a clear path from consumption to revenue.

See AI metering in actionExplore usage metering

AI usage over time

Every token type, accounted for.

1.19Mtokens metered
Input tokens654.00K
Output tokens236.00K
Cached tokens295.00K

Illustrative stacked bar chart of 18 days of AI usage, totaling 1,185,000 tokens. Input, output, and cached tokens are measured separately. Daily usage grows from 24,000 to 135,000 tokens.

Any usage signal.Input, output and cached tokens, GPU time, requests and model variants, with no pre-aggregation.

Powering fast-growing AI scaleups.And global enterprises.

See how ambitious teams build and scale their billing with Lago.

Frontier AI
Lago has been able to follow the pace of our releases and has allowed us to focus on what we do best.

— Timothée Lacroix, CTO, Mistral AI

Timothée Lacroix

How Lago supports AI billing.

Every pricing lever AI companies use, in one engine.

Cost-plus pricing.

Pass provider costs through with your markup: $0.0100 + 30% = $0.0130 per call.

Usage quotas.

Cap tokens, requests or seats per plan, override per customer, and enforce limits from a webhook.

Real-time alerts.

Know when a customer's usage spikes or credits run low, and act before the bill does.

Related reading

AI Billing FAQ

What is AI billing software?

AI billing software meters AI usage (tokens, GPU time, requests and agent actions), prices it by model and customer, and uses it to update current usage and wallet balances before invoicing. Lago does this in one open-source billing engine, as a managed cloud or self-hosted.

How does Lago bill for tokens?

Send token usage as events with the model and token type as properties, then set a price for each. Input, output and cached tokens can each have their own rate. Lago totals usage per customer and invoices it, or deducts it from prepaid credits.

Can Lago bill voice AI with included minutes and overage?

Yes. For example, a voice AI app could charge $500 a month for 10,000 completed minutes, then $0.04 per extra minute. At 12,000 minutes, that is $80 of overage before credits and tax. Lago rates and invoices the usage; your app decides whether to start or stop a live call.

How do prepaid credits work?

Customers buy or receive credits in a wallet. The ongoing balance reflects current usage, while the invoiced balance updates when an invoice is finalized. Wallets support automatic top-ups, free credits, expiration dates, balance alerts, and up to five active wallets per customer applied in priority order.

Can customers see their usage and balance in real time?

Yes. The ongoing wallet balance typically updates in under a second after an event lands. Customers can see it in the portal, and your product can read it and current usage through the API. Real-time balances are a premium feature.

How do I enforce usage quotas and alert customers?

Define a quota per plan, such as 5M tokens a month, and override it per customer. Usage alerts fire a webhook at soft and hard thresholds, one-time or recurring. Credit alerts fire as balances drop or run out. Your product acts on the webhook to throttle, block, allow overage or offer a top-up.

How do I protect margins when model costs change?

Price each model separately, bill provider cost plus your markup, and update rates without redeploying. For example, billing $240 of tokens that cost $80 leaves a 66.7% gross margin.

Lago solves complex billing.