Skip to main content
The v2 OpenAPI specification describes the native /api/v2 operations: product catalog, rate cards, plans, contracts, billing, customers, organizations, billing entities, billable metrics, events, logs, and webhook endpoints. It lists request fields, responses, and authentication for each operation. Read or download it without a Lago account. You need an organization’s API key to call its authenticated operations.
API v2 is in beta. Endpoints return the X-Lago-Endpoint-Status: beta header.
Lago publishes one document per API version: The v2 document only lists endpoints checked against their v2 implementation. Some other /api/v2 paths fall back to v1 controllers and are not described in it. Do not assume a v1 endpoint exists in v2 or returns the same shape. Features v2 does not cover yet work with /api/v1 only and are described in the v1 specification.

Choose the right interface

OpenAPI describes the API. The CLI, SDKs, and tools execute requests. An agent with HTTP access can use the API directly. Neither the CLI nor the Lago plugin is a prerequisite for that path. The Python, JavaScript, Ruby, and Go SDKs ship a v2 client generated from this specification, in beta. The Lago MCP server exposes v1 operations only. It has no contract or product catalog tools.

Use the contract with an agent or generator

Give the downloaded contract to your coding agent or OpenAPI-compatible generator. Use the relevant operation’s request schema, required fields, response schema, and security requirements. Consult the contracts guides for billing behavior and sequencing.
  • Select the API region and organization explicitly. Cloud US uses https://api.getlago.com/api/v2. Cloud EU uses https://api.eu.getlago.com/api/v2. Self-hosted instances expose the same paths under /api/v2 on your API host.
  • Keep API keys server-side and outside prompts or generated source files.
  • Most catalog and contract operations require the product catalog to be enabled on the organization. A valid schema does not mean the organization can call the operation.
  • v2 lists use cursor pagination (limit, after, before), related objects are returned only through expands[], and errors carry a code and a details array. Generated clients must handle these. See Pagination, Expansions, and Errors.
  • Pin the contract revision when generating a client or tool, and review contract changes before regenerating. v2 is in beta, so operation and field names can change between revisions. The OpenAPI repository tracks the source in src/v2/ and the bundle in openapi-v2.yaml. lago version reports the v2 contract bundled with an installed CLI release as spec_v2_version and spec_v2_sha256.
  • Review write requests and test in an isolated organization before changing production billing. A schema describes a request’s shape. It does not authorize the operation or confirm the intended amount.

Explore with Swagger or Postman

Browse the v2 operations in Swagger. The selector at the top of the page switches between v1 and v2. Lago does not publish a Postman collection for v2. To import the contract into Postman:
  1. Open Import and choose the option to import from a link.
  2. Enter https://swagger.getlago.com/openapi-v2.yaml and complete the import.
  3. Generate a collection from the imported API if needed.
  4. Set the base URL for your region: https://api.getlago.com/api/v2 (US), https://api.eu.getlago.com/api/v2 (EU), or your self-hosted host followed by /api/v2. Provide your organization’s API key through Postman’s secret or environment controls.
Check the destination and request body before executing a write. For a complete walkthrough from product to invoice, see your first invoice.