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

# Create an API key

`POST /keys`

Creates the account's one API key and returns it once. While a key is active the answer is 409 key.limit_reached: revoke it first. Only an OAuth session may call it; a request signed with an API key answers 403 auth.oauth_required. Free.

Creates the account's one API key and returns it once. While a key is active the answer is 409 key.limit_reached: revoke it first. Only an OAuth session may call it; a request signed with an API key answers 403 auth.oauth_required. Free.

Cost: Free.

## Request body

- `name` | string | required. A label for the key, for example the project that uses it.

## Response

- `id` | string | required. The id of the key. It is not a secret.
- `name` | string | required. The label of the key.
- `created_at` | string | required. When the key was created, RFC 3339 UTC.
- `key` | string | required. The key, with the prefix `lm_live_`. Send it as `Authorization: Bearer <key>`. It cannot be shown again.
- `instructions` | string | required. What to do with the key now.

## Failures

| Status | Meaning |
| --- | --- |
| `400` | The request shape, a filter key, a value, a cursor or the enrichment mode was rejected. |
| `401` | The credential is missing, unknown or revoked. |
| `403` | The request is signed with an API key. |
| `409` | The account already has its one active API key. |
| `429` | The key passed 300 requests a minute or 2 concurrent requests. |
| `503` | The data is unavailable for a short time. |

## Example

```bash
curl -sS -X POST "https://api.leadmcp.ai/v1/keys" \
  -H "Authorization: Bearer lm_live_YOUR_API_KEY" \
  -H "LeadMCP-Version: 2026-09-19" \
  -H "Content-Type: application/json" \
  -d '{"name":"My project"}'
```

Response `200`:

```json
{
  "ok": true,
  "request_id": "req_01JBQ2W8K9V6M3T0X5Y7Z4A1BC",
  "release": "b_2026_09_15",
  "data": {},
  "quota": {
    "plan": "free",
    "contact_credits_used": 50,
    "month_remaining": 950,
    "today_remaining": 950,
    "binding": "month",
    "resets_at": "9999-12-31T23:59:59.000Z"
  },
  "warnings": []
}
```
