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

# Boole AI API Authentication – Keys, Headers, and SDKs

> Learn how to pass API keys in request headers, handle authentication errors, and configure local binary deployments that require no auth.

Boole AI cloud API requests are authenticated with API keys passed in the `Authorization` header. Local binary deployments do not require authentication. Manage your keys at any time from the dashboard under **Settings → API Keys**.

<Warning>
  Never commit API keys to source control. Use environment variables or a secrets manager.
</Warning>

## Pass Your API Key

Include your API key as a Bearer token on every cloud API request:

```
Authorization: Bearer YOUR_API_KEY
```

Here is a complete example using `curl`:

```bash theme={null}
curl https://api.boole.dev/v1/chat/completions \
  -H "Authorization: Bearer $BOOLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "llama-3.3-70b-instruct", "messages": [{"role": "user", "content": "Hello!"}]}'
```

## SDKs

Because the Boole AI API is OpenAI-compatible, you can authenticate using the official OpenAI SDKs by pointing them at the Boole AI base URL.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from openai import OpenAI
    import os

    client = OpenAI(
        base_url="https://api.boole.dev/v1",
        api_key=os.environ["BOOLE_API_KEY"],
    )
    ```
  </Tab>

  <Tab title="Node.js">
    ```javascript theme={null}
    import OpenAI from "openai";

    const client = new OpenAI({
      baseURL: "https://api.boole.dev/v1",
      apiKey: process.env.BOOLE_API_KEY,
    });
    ```
  </Tab>
</Tabs>

## Authentication Errors

| Error              | Meaning                      | Fix                                                     |
| ------------------ | ---------------------------- | ------------------------------------------------------- |
| `401 Unauthorized` | Missing or invalid API key   | Check the key format and confirm it hasn't been revoked |
| `403 Forbidden`    | Key does not have permission | Contact [support@boole.ai](mailto:support@boole.ai)     |

## Local Binary

No API key is required when you run the local binary. However, OpenAI SDKs require a non-empty string for `api_key`. Pass any placeholder value:

```python theme={null}
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="local",
)
```

The local server accepts the header but does not validate it.

## Key Management

Create, rotate, and revoke API keys from **Settings → API Keys** in the dashboard. See the [API Keys](/account/api-keys) page for instructions on scoping keys, setting expiry dates, and auditing usage.
