---
title: AI billing on managed Lago Cloud
description: Evaluate one subscription, model-specific usage, prepaid credits, automatic top-ups, and Stripe collection in the same billing system.
canonical: https://getlago.com/solutions/industries/ai
---

# AI billing on managed Lago Cloud

Consider an AI API with a $49 monthly platform fee, different token prices by model, and prepaid usage credits. These values are an illustrative buyer scenario, not a Lago price quote or a claim about an existing customer's configuration. Lago Cloud operates the billing service; the product sends customer and usage data, and Stripe processes payment.

## Voice AI with included minutes

A voice API could charge $500 monthly, include 10,000 transcription minutes, and charge $0.04 for each additional minute. At 12,000 minutes, the illustrative overage is $80, or $580 before credits and tax. Send completed minute counts to a SUM billable metric and use a graduated charge for the allowance and overage. Lago rates and invoices the usage; the voice service decides whether to accept or stop a live call. In a local Lago v1.55.0 test, this model produced a $500 base invoice at subscription start and a separate $80 usage invoice when the subscription ended. Normal month-end renewal and Cloud payment collection were not tested. The [voice AI field guide](https://getlago.com/academy/monetizing-voice-ai-products) covers the wider call-to-cash workflow.

For enterprise accounts, Lago Premium can [override a subscription's base fee and charge properties](https://getlago.com/docs/guide/subscriptions/assign-plan#overriding-a-plan). Its [usage-charge spending minimum](https://getlago.com/docs/guide/plans/charges/spending-minimum) creates a true-up when usage billed in arrears falls below the agreed floor. The [negotiated contract billing guide](https://getlago.com/docs/guide/lago-cloud/contract-billing) shows a customer-specific monthly minimum and the invoice checks for below- and above-minimum usage. A plan minimum counts subscription and usage fees, so do not treat it as a usage-only annual drawdown. Validate the actual contract: these options do not cover every commitment structure.

Customers can view their subscriptions, invoices, usage units and costs, and usage breakdowns by billing filters and groups in the [Lago customer portal](https://getlago.com/docs/guide/customers/customer-portal). Use Lago's [current and past usage APIs](https://swagger.getlago.com/) if your voice product needs its own consumption display. [Premium ongoing credit balances](https://getlago.com/platform/credits) update about once a minute in the portal. Build voice-quality reporting and live call enforcement in the voice service. The local voice fixture above did not test Premium overrides, minimums, or a customer dashboard; validate those against the proposed contract before choosing a platform.

## One customer, one commercial workflow

1. **Start with the flat fee.** Define a monthly Lago plan with a $49 subscription fee and assign it to the customer. Lago generates invoices according to the plan's billing cycle. The fee can stay while usage pricing changes. See [subscriptions and billing cycles](https://getlago.com/docs/guide/subscriptions/assign-plan).
2. **Price tokens by model.** Send usage events with a model property. A billable metric aggregates the token quantity; filter values on the charge set different rates by model. Set and test an explicit fallback rate: usage for an unconfigured model can otherwise be metered at the charge's default rate, including zero. See [billable-metric filters](https://getlago.com/docs/guide/billable-metrics/filters) and [missing filter values](https://knowledge.getlago.com/articles/4445273964-how-events-are-priced-when-a-billable-metric-filter-value-is-missing).
3. **Fund usage with credits.** Give the customer a wallet scoped to the token billable metric so prepaid credits fund the intended usage charges. Lago supports paid and granted credits, credit movements, and automatic fixed or target top-ups on a schedule or below a balance threshold. Purchased credits become available after payment succeeds. See [credits and top-ups](https://getlago.com/platform/credits) and [wallets](https://getlago.com/docs/guide/wallet-and-prepaid-credits/overview).
4. **Collect with Stripe.** Lago rates the usage, applies eligible wallet credits to subscription invoices, and connects to Stripe for payment collection. The payment method and checkout/onboarding flow must be verified with the provider. Lago is the billing system, not the payment processor. See [Stripe payments](https://getlago.com/docs/integrations/payments/stripe/payments) and [billing and invoicing](https://getlago.com/platform/billing-invoicing).
5. **Keep hard limits in the product.** Lago's premium ongoing wallet balance accounts for current usage and refreshes every minute. Alerts and webhooks are asynchronous. The product's gateway owns request authorization, reservation, throttling, and any hard stop; it should not treat a Lago balance as synchronous permission. See [credits and spend control](https://getlago.com/platform/credits).

## Reproduce the rating decision in a Cloud test organization

This is a proposed validation fixture, not a claim that these requests were run against a Lago Cloud account. Use a staging organization, its regional API URL and a test-only key. Create a customer and monthly subscription with an illustrative $49 base fee. Before sending events, create a `tokens` billable metric with `sum_agg` on the `tokens` property and a `model` filter with values `model_a` and `model_b`. Add that metric as a charge on the plan with a standard per-token rate of $0.000004 for `model_a` and $0.000008 for `model_b`. Set an explicit fallback price for missing or new model values. The [SUM metric](https://getlago.com/docs/guide/billable-metrics/aggregation-types/sum), [model filter](https://getlago.com/docs/guide/billable-metrics/filters), [charge](https://getlago.com/docs/guide/plans/charges/usage-based-charges), and [subscription](https://getlago.com/docs/guide/subscriptions/assign-plan) guides document these steps.

Post each JSON body to `POST /api/v1/events` with the staging API key. Replace `sub_ai_01` with the actual external subscription ID and use current Unix timestamps. Keep each transaction ID and timestamp unchanged when testing a retry:

```json
{"event":{"transaction_id":"ai-model-a-001","external_subscription_id":"sub_ai_01","code":"tokens","timestamp":1792099200,"properties":{"tokens":100000,"model":"model_a"}}}
```

```json
{"event":{"transaction_id":"ai-model-b-001","external_subscription_id":"sub_ai_01","code":"tokens","timestamp":1792099200,"properties":{"tokens":100000,"model":"model_b"}}}
```

The hand calculation is $0.40 for `model_a` plus $0.80 for `model_b`, or **$1.20 of usage before credits and tax**. Check the [current usage endpoint](https://swagger.getlago.com/) (`GET /customers/{external_customer_id}/current_usage`) and the next invoice against those amounts. Add a $2 credit wallet scoped to the `tokens` metric: the expected commercial result is that the $1.20 usage draws on that wallet while the $49 base fee remains payable, subject to the actual credit and tax configuration. First use granted test credits to isolate rating; then test paid credits and payment success/failure with your chosen processor before promising a prepaid launch. The [wallet guide](https://getlago.com/docs/guide/wallet-and-prepaid-credits/overview) and [event API](https://getlago.com/docs/api-reference/events/usage) cover the payload and payment states. A Cloud account and connected payment-provider test account are needed to verify the complete result.

## What to prove before choosing a platform

- Replay a known sample of events for at least two models. Compare the rated amounts with a hand calculation, and confirm how an unconfigured model is priced.
- Send an event twice with the same transaction identifier **and timestamp**, then verify the invoice does not double-charge it. On Lago's ClickHouse event pipeline, a retry with the same identifier but a different timestamp can be billed as a separate event. Check the [event ingestion documentation](https://getlago.com/docs/guide/events/ingesting-usage) for the chosen pipeline's rules.
- Issue a paid top-up, simulate a failed payment, and confirm when credits become spendable. Test the gateway's own behavior while payment or the balance update is pending.
- Inspect the generated subscription invoice, wallet transactions, and Stripe payment status for the same customer. Confirm whether credits should pay usage only or also subscription fees.
- Get a current Lago Cloud quote and confirm the licensed features, integration work, and support terms. The public [pricing page](https://getlago.com/pricing) does not publish a rate for this scenario.

The [Lago Agent SDK](https://github.com/getlago/lago-agent-sdk-python) can collect usage from supported model clients. The application can also send events through the [REST API or SDKs](https://getlago.com/developers). An isolated local [billing demo](https://github.com/getlago/lago/tree/main/examples/agentic-ai-demo) works without Cloud credentials; its self-hosted test environment does not imply that production requires self-hosting.
