# API Keys

> Manage API keys for authenticating with the Lev API.

Source: https://www.lev.com/docs/build/api-keys

Last updated: March 2026

---
## Overview

API keys are managed via the Lev web app or the `/api-keys` REST endpoints. Keys are tied to the authenticated user's account and inherit their permissions.

- Keys are prefixed with `lev_sk_` for identification
- The full key value is only shown once at creation — store it immediately
- Revoked keys take effect immediately
- Each account has a maximum number of allowed keys based on its API tier

**Tier ceilings**

| Tier | Max API keys |
|------|--------------|
| Free | 2 |
| Standard | 10 |
| Enterprise | 50 |

The current count and ceiling for your account are returned under `platform.api_keys` in the [scoped `GET /me` response](/build/account#current-user) — `{ current_count, max_allowed }`. A `POST /api-keys` request that would exceed the ceiling returns `422 validation_error`.

## Creating Keys via the Lev Web App

The fastest way to create an API key is through the Lev settings page at [app.lev.com](https://app.lev.com).

  You must be a **workspace admin** to manage API keys. The feature must be enabled for your account.

### Create a key

Sign in at [app.lev.com](https://app.lev.com).

Click your name at the bottom of the sidebar, then click **Settings**.

Select the **API Keys** tab.

Click the **Create key** button.

Enter a descriptive label (for example, "Production Sync" or "CI Pipeline") and click **Create**.

Click the copy icon next to the key. Store it somewhere secure, then click **Done**.

  The full API key is only displayed once at creation time. If you lose it, you'll need to revoke the key and create a new one.

### Revoke a key

Go to **Settings → API Keys**.

Find the key in the list and click the **trash icon**.

Click **Revoke key**. Revocation is instant.

## Create Key (API)

### `POST /api/external/v2/api-keys`

Create a new API key for the authenticated user

#### Request Body

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `label` | `string` | Yes | Human-readable label for the key (1–255 characters) |

Response: `201`

## List Keys (API)

### `GET /api/external/v2/api-keys`

List all API keys for the authenticated user

#### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | `integer` | No | Results per page (1–200, default 50) |
| `offset` | `integer` | No | Number of results to skip (default 0) |

Response: `200`

## Revoke Key (API)

### `DELETE /api/external/v2/api-keys/{key_id}`

Permanently revoke an API key

#### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `key_id` | `integer` | Yes | The ID of the API key to revoke |

Response: `200`