API and authentication
Lago Cloud useshttps://api.getlago.com/api/v1 as its REST API base URL. 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.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, and wallet 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
Connect supported AI clients to the documentation MCP server at/mcp. It exposes search and retrieval capabilities through Streamable HTTP. For application-level billing agents, begin with the agent SDK overview, then select the guide for your model provider. Keep financial mutations behind human approval and enforce the same authorization rules used by non-agent integrations.
Examples and self-hosting
- Billing examples
- Main Lago repository
- Self-hosted overview
- Docker deployment
- Kubernetes Helm charts
- Integration testing