Skip to main content
Start with the Lago CLI when your coding agent has terminal access. Its 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.
You can inspect public docs and build local application tests without a Lago account. Calling your organization’s API requires its API key and the product catalog enabled on the organization.

Start with the CLI and OpenAPI

The lago 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.
Once signed in to that organization, get its API key from Developers → API keys, or ask an admin to provide one. See API keys. Keep it out of prompts and source control. Follow the billing workflow to connect the CLI and check usage. 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.