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

# Authentication

> Use API keys to authenticate Poolside API requests and CLI automation.

## Overview

Authenticate Poolside API requests using Bearer tokens. The same API key format applies to OpenAI-compatible API requests and CLI automation.

<Warning>
  API keys are secrets. Store them securely and never commit them to source control.
</Warning>

## Get an API key

Use an API key created for your Poolside account or provided by your Poolside administrator. For CLI automation, you can use the same API key with `POOLSIDE_API_KEY`.

For more information about CLI authentication, see [Install Poolside Agent CLI](/cli/install#ci-and-automation).

## Use an API key

Use your API key with HTTP Bearer authentication.

The following example uses `curl` to list all available models:

```bash theme={null}
curl --request GET \
  --url https://<api-domain>/openai/v1/models \
  --header 'Accept: application/json, application/problem+json' \
  --header 'Authorization: Bearer <api-key>'
```

To authenticate `pool exec` with an API key, set `POOLSIDE_API_KEY` before the command:

```bash theme={null}
POOLSIDE_API_KEY=<api-key> pool exec -p "What does this codebase do?"
```

## Related resources

* [OpenAI-compatible API examples](/api/openai-api-examples)
* [Automated mode](/cli/automated-mode)
