> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lehar.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API Overview

> Base URL, authentication, errors, and pagination for the Lehar API.

The Lehar control-plane API is a JSON REST API. All customer endpoints live under a versioned base path.

<Info>
  **Base URL** — `https://api.lehar.ai/ca/api/v0`

  The base path is configurable per deployment (`API_BASE_PATH`, default `/ca/api/v0`). Confirm your host in the dashboard.
</Info>

## Authentication

Most routes accept either a workspace **API key** or a **bearer login session**. See [Authentication](/api-reference/authentication) for the full model, scopes, and the endpoints that require bearer auth.

```http theme={null}
X-API-KEY: lk_live_your_key
Content-Type: application/json
```

## Errors

Errors use a consistent envelope:

```json theme={null}
{ "error": { "code": "invalid_request", "message": "Human-readable description" } }
```

| HTTP | Code                   |
| ---- | ---------------------- |
| 400  | `invalid_request`      |
| 401  | `unauthorized`         |
| 402  | `insufficient_credits` |
| 403  | `forbidden`            |
| 404  | `not_found`            |
| 409  | `conflict`             |
| 429  | `too_many_requests`    |
| 500  | `internal_error`       |
| 503  | `service_unavailable`  |

## Pagination

List endpoints use offset pagination.

| Param    | Default | Max |
| -------- | ------- | --- |
| `limit`  | 20      | 100 |
| `offset` | 0       | —   |

```json theme={null}
{ "data": [], "pagination": { "limit": 20, "offset": 0, "total": 45 } }
```

## Versioning

The API is versioned in the path (`/v0`). Breaking changes ship under a new version prefix.
