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

# Authentication

> How to authenticate your API requests

## API Key Authentication

All API requests must include your API key in the `api_key` header.

```bash theme={null}
api_key: YOUR_api_key
```

## Getting your API Key

1. Sign up or log in at [app.dataforb2b.ai](https://app.dataforb2b.ai)
2. Navigate to **Settings** > **API Keys**
3. Click **Generate new key**
4. Copy and securely store your API key

<Warning>
  Your API key grants access to your account and credits. Keep it secure and never share it publicly or commit it to version control.
</Warning>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.dataforb2b.ai/search/people \
    -H "api_key: sk_live_abc123..." \
    -H "Content-Type: application/json" \
    -d '{"count": 10}'
  ```

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

  headers = {
      "api_key": "sk_live_abc123...",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api.dataforb2b.ai/search/people",
      headers=headers,
      json={"count": 10}
  )
  ```

  ```javascript JavaScript theme={null}
  const headers = {
    'api_key': 'sk_live_abc123...',
    'Content-Type': 'application/json'
  };

  const response = await fetch('https://api.dataforb2b.ai/search/people', {
    method: 'POST',
    headers,
    body: JSON.stringify({ count: 10 })
  });
  ```
</CodeGroup>

## Authentication Errors

| Status Code | Error          | Description                                       |
| ----------- | -------------- | ------------------------------------------------- |
| 401         | `unauthorized` | Missing or invalid API key                        |
| 403         | `forbidden`    | API key doesn't have permission for this resource |
