> ## 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.

# Managing Boole AI API Keys: Create, Rotate, Revoke

> Create, rotate, and revoke API keys to authenticate requests to the Boole AI cloud API. Manage multiple keys per environment or team.

Boole AI uses API keys to authenticate every request to the cloud API. Each request must include a valid API key in the `Authorization` header. You can create multiple keys per account — useful for separating environments or teams — and revoke individual keys at any time without affecting the others.

## Getting Your API Key

<Steps>
  <Step title="Sign in to your account">
    Go to [booleinference.com](https://booleinference.com) and sign in.
  </Step>

  <Step title="Open API Keys settings">
    Navigate to **Settings → API Keys**.
  </Step>

  <Step title="Create a new key">
    Click **Create new key** and give it a descriptive name (for example, `production-backend` or `dev-local`).
  </Step>

  <Step title="Copy the key immediately">
    Copy the key and store it somewhere safe. **It is shown only once** — if you lose it, you must revoke it and create a new one.
  </Step>
</Steps>

## Using Your API Key

Pass your API key in the `Authorization` header on every request:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

Store the key in an environment variable rather than hard-coding it in your source files:

```bash theme={null}
export BOOLE_API_KEY="your-key-here"
```

Then read it from your application at runtime:

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

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

    response = client.chat.completions.create(
        model="meta-llama/Llama-3.3-70B-Instruct",
        messages=[{"role": "user", "content": "Hello!"}],
    )
    print(response.choices[0].message.content)
    ```
  </Tab>

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

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

    const response = await client.chat.completions.create({
      model: "meta-llama/Llama-3.3-70B-Instruct",
      messages: [{ role: "user", content: "Hello!" }],
    });
    console.log(response.choices[0].message.content);
    ```
  </Tab>
</Tabs>

## Key Security

Follow these practices to keep your API keys secure:

* **Use environment variables or a secrets manager** — never commit keys to source control or paste them into configuration files that get checked in.
* **Create a separate key per environment** — maintain distinct keys for development, staging, and production so you can rotate or revoke one without impacting the others.
* **Rotate keys regularly** — create the new key first, update your application to use it, then revoke the old key so you avoid any downtime.
* **Revoke compromised keys immediately** — use the dashboard to invalidate a key the moment you suspect it has been exposed.

<Warning>
  If you suspect a key has been compromised, revoke it immediately from **Settings → API Keys** and generate a replacement. For urgent security issues, contact [security@boole.ai](mailto:security@boole.ai).
</Warning>

## Multiple Keys

Your account supports up to **10 API keys** at a time. Use multiple keys to isolate access by environment, service, or team member. Each key can be revoked independently, so a leak in one environment never forces you to rotate credentials everywhere.

<Tip>
  Name your keys clearly — for example, `ci-pipeline`, `mobile-app-prod`, or `data-pipeline` — so you can identify which key belongs to which system at a glance.
</Tip>

## Revoking a Key

<Steps>
  <Step title="Open API Keys settings">
    Go to **Settings → API Keys**.
  </Step>

  <Step title="Revoke the key">
    Click **Revoke** next to the key you want to remove.
  </Step>

  <Step title="Confirm revocation">
    Confirm the action. The key stops working **immediately** — any in-flight requests using it will fail.
  </Step>
</Steps>

<Note>
  API keys are only required for the **cloud API**. The local binary runs entirely on your own hardware and does not require any authentication.
</Note>
