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

# Authentication

> Authenticate API requests with a bearer token.

All API requests require a bearer token in the `Authorization` header.

```
Authorization: Bearer $LIGHTON_API_KEY
```

You can create an API key from the **API Keys** section of the [console](https://console.lighton.ai), or programmatically via [`POST /api/v3/keys`](/api-reference/api-keys/create-api-key). Existing keys can be listed and revoked through the same endpoint family.

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {"Authorization": "Bearer $LIGHTON_API_KEY"}
  response = requests.post(
      "https://api.lighton.ai/api/v3/search",
      headers=headers,
      json={"query": "vacation policy", "max_results": 3},
  )
  ```

  ```bash cURL theme={null}
  curl https://api.lighton.ai/api/v3/search \
    -H "Authorization: Bearer $LIGHTON_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"query": "vacation policy", "max_results": 3}'
  ```
</CodeGroup>

## Error responses

| Status | Meaning                                           |
| ------ | ------------------------------------------------- |
| `401`  | Missing or invalid API key                        |
| `403`  | Key exists but lacks permission for this resource |
| `429`  | Rate limit exceeded                               |
