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

# Authentication

> Learn how to authenticate with the Bit2Connect Public API

## API Key Authentication

The Bit2Connect Public API uses API keys for authentication. You can generate and manage your API keys from your project dashboard.

### Getting Your API Key

1. Log in to your [Bit2Connect Dashboard](https://app.bit2connect.com)
2. Navigate to your project settings
3. Go to the **API Keys** section
4. Click **Generate New API Key**
5. Copy and securely store your API key

### Using Your API Key

Include your API key in the `X-API-KEY` header for all requests to the Public API:

```bash theme={null}
curl -X GET "https://api.bit2connect.com/1.0/links" \
  -H "X-API-KEY: b2co_your_api_key_here"
```

<Warning>
  Keep your API keys secure and never expose them in client-side code or public
  repositories.
</Warning>

### Authentication Method

The public API uses the X-API-KEY header for authentication:

#### API Key Header

```bash theme={null}
X-API-KEY: b2co_your_api_key_here
```

<Note>
  The public API only accepts the X-API-KEY header. Bearer tokens are reserved
  for dashboard authentication and should not be used with the public API.
</Note>

### API Key Format

All Bit2Connect API keys start with the prefix `b2co_` followed by a unique identifier:

```
b2co_1234567890abcdef1234567890abcdef
```

### Error Responses

#### Invalid API Key

```json theme={null}
{
  "success": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid or missing API key"
  }
}
```

#### Rate Limit Exceeded

```json theme={null}
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Please try again later."
  }
}
```

#### Insufficient Permissions

```json theme={null}
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Your API key does not have permission to perform this action"
  }
}
```
