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

# Authentication

> Authentication with the Keenable APIs

Every request is authenticated with an API key passed as the `X-API-Key` header. The same key works across the CLI, REST API, and MCP server.

## API keys

Create and revoke keys in the [console](https://keenable.ai/console). Keys are scoped to your workspace, never expire on their own, and can be rotated at any time.

```http theme={null}
X-API-Key: sk-kn_live_<your-key>
```

## Header formatting

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.keenable.ai/v1/search" \
    -H "X-API-Key: <YOUR_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{ "query": "hello" }'
  ```

  ```python Python theme={null}
  requests.post(
      "https://api.keenable.ai/v1/search",
      headers={"X-API-Key": "<YOUR_API_KEY>"},
      json={"query": "hello"},
  )
  ```

  ```typescript TypeScript theme={null}
  await fetch("https://api.keenable.ai/v1/search", {
    method: "POST",
    headers: {
      "X-API-Key": "<YOUR_API_KEY>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ query: "hello" }),
  });
  ```
</CodeGroup>

## Error responses

| Status | Meaning                             |
| ------ | ----------------------------------- |
| `401`  | Missing or invalid API key          |
| `403`  | Key disabled or workspace suspended |
| `429`  | Rate limit exceeded                 |
