LevelFour Developer Docs
The LevelFour REST API serves your cloud spend, the savings recommendations LevelFour has found, and the optimizations it can apply for you. It covers AWS, GCP, Azure and Kubernetes. You reach it with an official SDK for Python, TypeScript or Go, with the l4 CLI from a terminal, or with an assistant through the MCP server.
The REST API and the SDKs take a LevelFour API key. Create one in the dashboard under Settings > API Keys. Authentication has the key formats and what each scope reaches. The CLI and the MCP server can sign you in instead.
Start here
- Onboarding: connect your cloud accounts and GitHub organizations so LevelFour can read cost data and open savings pull requests
- Quickstart: install an SDK, point it at a key, and make your first call
- Authentication: key formats, what each scope reaches, and where the SDKs look for one
Ways in
| Language | Package | Install |
|---|---|---|
| Python | levelfour | pip install levelfour |
| TypeScript | levelfour | npm install levelfour |
| Go | github.com/LevelFourAI/levelfour-go | go get github.com/LevelFourAI/levelfour-go |
- SDKs: constructor options, minimum versions, and the per-language reference
- CLI: the
l4binary: the same data in a terminal or a CI job, plus local Terraform cost estimation - Model Context Protocol (MCP): Claude Code, Claude, Cursor, VS Code, Windsurf or any MCP client, reading your cloud spend and savings
Reference
- Resources: recommendations, savings, costs, providers and API keys, method by method
- Virtual tags: one tag key across AWS and Google Cloud from rules you write, for spend your providers tagged inconsistently or not at all
- Webhooks: signed HTTPS callbacks when a recommendation or an optimization changes state
- Error Handling: typed error classes per status code, and the failures the SDKs retry before you see them
- Pagination: the envelope every list response carries, and how to walk it: auto-iterate, or drive
pageyourself - Guides: wiring LevelFour into CI/CD, GitHub Actions, Backstage, Slack, Google Chat, or your own internal CLI
- API Reference: every REST endpoint by category, with the base URL and the
Authorizationheader they all take