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

# Authentication

> Learn how to authenticate with the Beam AI public API using your API key

The Beam AI public API uses API key authentication. Include your API key in the `x-api-key` header with every request.

## Base URL

```
https://api.beamstudio.ai
```

## Authentication Header

All API requests require the `x-api-key` header:

```bash theme={null}
x-api-key: your-api-key-here
```

Most endpoints also require a `current-workspace-id` header:

```bash theme={null}
current-workspace-id: your-workspace-id
```

## Example Authenticated Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://api.beamstudio.ai/v2/user/me \
    -H "x-api-key: your-api-key-here" \
    -H "current-workspace-id: your-workspace-id"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.beamstudio.ai/v2/user/me', {
    headers: {
      'x-api-key': 'your-api-key-here',
      'current-workspace-id': 'your-workspace-id'
    }
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.beamstudio.ai/v2/user/me',
      headers={
          'x-api-key': 'your-api-key-here',
          'current-workspace-id': 'your-workspace-id'
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Getting Your API Key

1. Log in to [Beam AI](https://app.beam.ai)
2. Navigate to your workspace settings
3. Go to the **API Keys** section
4. Create a new API key or copy an existing one

<Warning>
  Keep your API key secure. Do not share it publicly or commit it to version control.
</Warning>
