lago v2 commands configure the product catalog, plans and contracts, return JSON, and read contract usage. Your application connects to Lago through the REST API under /api/v2. Lago Cloud is managed. Self-hosting is optional.
API v2 is in beta. Endpoints return the
X-Lago-Endpoint-Status: beta header.Start with the CLI and OpenAPI
Thelago v2 commands ship in CLI 1.3.0 and later.
lago init asks for your region and API key. Get access to your organization before connecting. Keep keys out of prompts and source control.
The v2 OpenAPI contract supplies exact fields for requests, generated clients and agent tools. An agent with HTTP access can call the API directly. The CLI is optional. Read the API introduction for base URLs and conventions.
To add contract billing to your application, follow Build Lago billing with a coding agent. It covers repository work, local tests, CLI setup and a check against Lago.
Pick your agent
The Lago plugin gives Claude Code and Codex guided examples and implementation instructions. Its guidance targets the v1 API: plans with charges on/api/v1. For contract billing, give your agent this page, How v2 differs from v1 and the v2 OpenAPI contract instead.
Connect to Lago when you are ready
First, get access to the organization you will use:- Your team already uses Lago Cloud: Ask your Lago organization admin for an invitation, accept it, and sign in. Confirm whether the organization is in the US or EU region.
- You need a new Lago Cloud organization: Request access from Lago. Tell the team which region you need and that you want the product catalog for contracts.
- You use self-hosted Lago: Deploy Lago and sign up in its web app to create your organization, or ask your team’s operator for access to an existing instance. Record the API service URL.
If you want your agent to look up exact event or pricing guidance while coding, add
https://docs.getlago.com/mcp as a remote HTTP MCP server. It searches public docs and cannot read your organization’s data.
The Lago MCP server, the in-app assistants, the Agent SDK, the Agent Storefront and x402 work with the v1 API (/api/v1) only. See Agent tools and contracts.