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

# Authentication

> Learn how to authenticate your Gurubase API requests

<Frame>
  <img src="https://mintcdn.com/gurubase/1KgbSST6n33uTAt6/images/gurubase-api-keys.jpg?fit=max&auto=format&n=1KgbSST6n33uTAt6&q=85&s=35f08d86676998c4f911931aeee5b0e6" alt="Gurubase API Keys" width="2164" height="477" data-path="images/gurubase-api-keys.jpg" />
</Frame>

All API endpoints require authentication using an API key. You can obtain your API key from [Gurubase Cloud](https://app.gurubase.io/api-keys) or Gurubase Self-Hosted (Enterprise plan only - contact us at [contact@gurubase.io](mailto:contact@gurubase.io) for access).

## API Key Authentication

Include your API key in the `x-api-key` header with all requests:

```bash theme={null}
curl --location 'https://api.gurubase.io/api/v1/<guru_slug>/answer' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "question": "What is Gurubase?"
}'
```

<Note>
  Keep your API key secure and never share it publicly. If you believe your API key has been compromised, you can delete it and generate a new one from the dashboard.
</Note>
