# API Reference

> Where the LevelFour REST API lives, the Bearer token every request carries, the envelope every response comes back in, and the endpoint reference by category.

Source: https://docs.levelfour.ai/api-reference


The base URL, the authorization header and the response envelope are the same for every endpoint below.

## Base URL

```text
https://api.levelfour.ai
```

> **Note**
>
> All endpoints require a Bearer token in the `Authorization` header: `Authorization: Bearer l4_live_your_key_here`. See [Authentication](/authentication).

## Endpoints

| Category                                          | Covers                                                                                                     |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| [Auth](/api-reference/auth)                       | Confirm which organization, plan and role a key resolves to                                                |
| [Providers](/api-reference/providers)             | Per-provider data for recommendations, costs, and savings                                                  |
| [Costs](/api-reference/costs)                     | Spend summaries, breakdowns, trends, usage, allocation and forecasts                                       |
| [Google Cloud](/api-reference/google-cloud)       | Google Cloud inventory, utilization, budgets, access and data availability                                 |
| [Anthropic](/api-reference/anthropic)             | Claude Code and Cowork usage, activity and cost from a connected Anthropic organization                    |
| [Twilio](/api-reference/twilio)                   | Cost per unit, monthly fees and data availability from a connected Twilio account                          |
| [Tags](/api-reference/tags)                       | Provider cost allocation tags read from the bill, and virtual tags LevelFour assigns from ordered rules    |
| [Cost Views](/api-reference/cost-views)           | Saved cost views: a named set of filters you can read back and reuse                                       |
| [Recommendations](/api-reference/recommendations) | List savings recommendations, choose resources, give rejection feedback and request execution              |
| [Savings Grants](/api-reference/savings-grants)   | Scoped, time-limited access that lets LevelFour apply a saving for you                                     |
| [Repo Binding](/api-reference/repo-binding)       | Choose the repositories an infrastructure-as-code saving opens its pull request in                         |
| [Audit](/api-reference/audit)                     | Realized savings from completed recommendations                                                            |
| [Commitments](/api-reference/commitments)         | Reserved Instances and Savings Plans: inventory, utilization, coverage, renewals and purchase plans        |
| [Anomalies](/api-reference/anomalies)             | Cost anomalies, their detail, and your notification preference                                             |
| [Cost Alerts](/api-reference/cost-alerts)         | Budget, spend change and commitment alerts: create, change, pause and delete them, and read what they said |
| [Accounts](/api-reference/accounts)               | Connected cloud accounts, enabled modules, and work-tool connections                                       |
| [Integrations](/api-reference/integrations)       | Read a connected work tool and file tasks in it, such as a Jira issue from a saving                        |
| [Webhooks](/api-reference/webhooks)               | Subscribe to event notifications                                                                           |

## Response format

Every response arrives in the same envelope.

```json
{
  "success": true,
  "data": { ... },
  "timestamp": "2025-10-15T10:00:00Z"
}
```

An error sets `success` to `false` and replaces `data` with `error`.

```json
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Resource not found",
    "details": null
  },
  "timestamp": "2025-10-15T10:00:00Z"
}
```

## Next

* [API Quickstart](/api-quickstart) installs an SDK, points it at a key, and makes the first call
* [Authentication](/authentication) is the key formats, what each scope reaches, and where an SDK looks for a key
* [Error Handling](/error-handling) is the full list of error codes and the class each one raises in every SDK
* [Pagination](/pagination) is what list endpoints add inside `data`, and how to walk it
* [Resources](/resources) is the same surface as method calls in the Python, TypeScript and Go SDKs
