canonical: https://jentic.com/apis/getlago.com/getlago

# Getlago Lago API

The Lago API meters usage and runs recurring billing for subscription and usage-based products. It creates and updates customers, ingests single or batched usage events that feed metered pricing, assigns plans to customers as subscriptions, and lists the invoices Lago generates from that usage. This agent-friendly profile covers the common billing operations; Lago publishes the full description separately. It is aimed at teams building metered or hybrid pricing that need programmatic control over customers, events, subscriptions, and invoices.

## For AI agents

Run usage-based and subscription billing with Lago: create customers, send single or batched usage events, assign plans as subscriptions, and list generated invoices.

## Scope

Does not handle payment capture, tax filing, or accounting ledgers. Use for usage metering, subscriptions, and invoice generation only.

## Capabilities

- Create and update customers that billing and usage attach to
- Send single usage events that feed metered pricing in real time
- Send batches of usage events in one call for high-volume metering
- Assign a plan to a customer to start a subscription
- List subscriptions and the invoices Lago generates from metered usage

## Use cases

### Agent-managed usage metering

An AI agent reconciling product usage can call the Lago API through Jentic to create the customer if needed, stream usage events as the product is consumed, and list the resulting invoices to confirm the charge. Jentic returns the usage-event operation from a natural-language query, so the agent meters consumption without reading the Lago reference first.

Example prompt: Create or update the customer, send a usage event recording the consumed quantity, then list the customer's invoices to confirm the charge landed.

### Subscription provisioning

Assign a plan to a customer to start a subscription when they upgrade, and keep the customer record current as their details change. Lago turns the subscription and any metered events into invoices, so a provisioning workflow only needs to manage customers, plans, and events.

Example prompt: Create the customer, assign the chosen plan as a subscription, and confirm the subscription appears in the customer's subscription list.

### High-volume event batching

Collect usage events from a metering pipeline and send them to Lago in batches rather than one call per event, which keeps high-volume metering efficient. The batch events operation accepts many events at once, and the resulting charges roll into the customer's invoices.

Example prompt: Buffer the usage events collected over the interval and send them in a single batch events call, then verify the count accepted.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/customers` | List all customers |
| POST | `/customers` | Create or update a customer |
| GET | `/customers/{external_customer_id}` | Retrieve a customer by external id |
| POST | `/events` | Send a usage event |
| POST | `/events/batch` | Send a batch of usage events |
| GET | `/subscriptions` | List subscriptions |
| POST | `/subscriptions` | Assign a plan to a customer |
| GET | `/invoices` | List invoices |

## Key resources

- **Customers** — Create, update, and retrieve the customers that billing attaches to
- **Events** — Send single or batched usage events that feed metered pricing
- **Subscriptions** — Assign plans to customers and list active subscriptions
- **Invoices** — List the invoices Lago generates from subscriptions and metered usage

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 72 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 100 / 100
  - Developer Experience & Jentic Compatibility: 69 / 100
  - AI-Readiness & Agent Experience: 55 / 100
  - Agent Usability: 94 / 100
  - Security: 60 / 100
  - AI Discoverability: 86 / 100
- **View full report:** https://jentic.com/apis/getlago.com/getlago/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the Lago API by hand means handling its bearer token, choosing the global or EU host to match where your data lives, and coding the event ingestion and subscription calls yourself. Through Jentic you install once, import the API from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Lago carries the customer external id in the URL path for customer retrieval, but usage events and subscriptions target resources through the request body, so bound your agent to the operations it needs. You choose which operations it may call, so subscription assignment is not included unless you add it.
- **Credential handling:** Your Lago token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'send a usage event' or 'list invoices', and Jentic returns the matching Lago operation with its input schema so the agent calls the right endpoint without reading the reference docs.

## Related APIs

- **Recurly API** — Hosted subscription management and recurring billing
- **Chargify API** — Billing and subscription management for B2B SaaS
- **Stripe API** — Payment processing for cards, wallets, and bank transfers

## FAQ

### Is there a Lago API MCP server?

You do not need an MCP server to give your agent the Lago API. Jentic connects it directly from the API Directory: import the API, store your token once, and your agent calls the customer, event, subscription, and invoice operations. Operations are discovered on demand, so no extra server definitions load into the agent's context.

### What authentication does the Lago API use?

The API authenticates with a bearer token per its OpenAPI spec, sent in the Authorization header on every billing call. Through Jentic the token is stored encrypted in your own Jentic One instance and supplied only when an allowed call runs, so it never reaches the agent's context.

### Does the Lago API offer separate EU and US hosts?

Yes. The spec lists a global host at api.getlago.com and an EU-resident host at api.eu.getlago.com. Call the host that matches where your Lago data lives so usage events reach the right region.

### What are the rate limits for the Lago API?

The OpenAPI spec does not specify rate limits. Lago announces changes through versioned migration guides, so confirm the current limits for your plan in the Lago documentation at https://doc.getlago.com.

### Can I limit what my agent is allowed to do with the Lago API?

Yes. Write a rule that permits only the event and read operations, sending usage events and listing invoices, when the agent should meter and report, and add customer creation or subscription assignment only for provisioning workflows, with every call logged.

### How do I send a usage event with the Lago API through Jentic?

Search Jentic for 'send a usage event for billing' to surface the event operation, load its input schema, pass the customer external id and metered quantity, and execute. To run it on your own infrastructure, install Jentic One from its GitHub repo.
