API and authentication
Choose the REST API base URL for the Lago deployment you are targeting:https://api.getlago.com/api/v1 for US Cloud, https://api.eu.getlago.com/api/v1 for EU Cloud, or your Lago API origin followed by /api/v1 for self-hosted. Authenticate server-to-server requests with the API key from your Lago organization settings. Send the key only over HTTPS, store it in a secret manager, and never expose it in browser code, logs, or source control.
- API overview and authentication
- API standards
- API versioning and deprecation policy
- Pagination
- Rate limits
- Structured API errors
- Authentication guide for agents and developers
- Interactive Swagger reference
OpenAPI schemas
Use the same-origin OpenAPI discovery schema for automated discovery, function generation, and error-shape inspection. It describes representative high-value operations and points to the production server. Use the complete Lago OpenAPI specification for code generation and exhaustive endpoint coverage. The source is maintained in the Lago OpenAPI repository. Agents can also discover these surfaces through the Agentic Resource Discovery catalog and the RFC 9727 API catalog. The root-level JSON files provide version-controlled aliases of those well-known documents. The Agent Skills discovery index publishes the Lago billing-integration skill with a content digest. The A2A agent card and MCP server card expose Lago’s identity, documentation tools, and read-only skill resource at predictable URLs. Compatible agent clients can also load the repository as an Agent Plugin. Its MCP configuration declares both Lago MCP surfaces, and its packaged billing skill is maintained in the public Lago documentation repository. Coding agents contributing to these docs should read the repository’s version-controlledAGENTS.md instructions. They preserve Lago’s established design, identify authoritative API sources, prohibit invented product claims, and define the required validation workflow.
SDKs and clients
Lago maintains open-source clients for common server-side languages. Check each repository’s README and release history before selecting a version.- JavaScript client on npm and source
- Python client on PyPI and source
- Ruby client on RubyGems and source
- Go module and source
- Java client
- PHP client
- C# client
- Rust client
- Lago Agent SDK on PyPI
Webhooks and asynchronous processing
Use webhooks to react to customer, subscription, invoice, credit note, payment, wallet, and quote lifecycle changes. Consumers should verify authenticity, acknowledge delivery quickly, deduplicate retries, and move expensive work to a queue. Treat the API as the source of truth when a webhook payload and locally cached state disagree.AI agents and MCP
Lago exposes two distinct MCP surfaces:- The Lago Docs MCP at
/mcpis a public, read-only Streamable HTTP server for documentation search and retrieval. - The Lago Product MCP is the open-source, Docker-distributed server documented in the product MCP guide and maintained in the Lago Agent Toolkit repository. It authenticates with a Lago API key and exposes live billing data and operations over stdio. Set
LAGO_API_URLexplicitly to the US, EU, or self-hosted base URL before starting it.
Examples and self-hosting
- Billing examples
- Main Lago repository
- Self-hosted overview
- Docker deployment
- Kubernetes Helm charts
- Integration testing