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

# Authenticate requests to the Darkbloom API

> Create and manage API keys for the Darkbloom inference API. Keys start with eigeninference- and are passed as Authorization: Bearer tokens on every request.

Every request to the Darkbloom API requires an API key. You pass the key in the `Authorization` header as a Bearer token. Keys are prefixed with `eigeninference-` so they are easy to identify and rotate if they appear in logs or source control.

## Getting an API key

<Steps>
  <Step title="Sign up at darkbloom.dev">
    Create an account at [darkbloom.dev](https://darkbloom.dev). Darkbloom uses Privy for authentication — you can sign in with email or a connected wallet.
  </Step>

  <Step title="Open the console">
    Navigate to **Settings → API Keys** in the console dashboard.
  </Step>

  <Step title="Create a key">
    Click **New API Key**. Copy the key immediately — it is shown only once. The key will look like:

    ```
    eigeninference-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    ```
  </Step>

  <Step title="Add credits">
    API calls are metered. Add credits from the **Billing** section before sending inference requests. Requests return `403` when your balance reaches zero.
  </Step>
</Steps>

<Warning>
  Store your API key in an environment variable or secrets manager. Never commit it to source control or expose it in client-side code.
</Warning>

## Sending the key

Include the key in the `Authorization` header on every request:

```
Authorization: Bearer eigeninference-your-key-here
```

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.darkbloom.dev/v1/models \
    -H "Authorization: Bearer eigeninference-your-key-here"
  ```

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

  client = OpenAI(
      base_url="https://api.darkbloom.dev/v1",
      api_key="eigeninference-your-key-here",
  )
  ```

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

  const client = new OpenAI({
    baseURL: "https://api.darkbloom.dev/v1",
    apiKey: "eigeninference-your-key-here",
  });
  ```
</CodeGroup>

<Tip>
  Use the `OPENAI_API_KEY` and `OPENAI_BASE_URL` environment variables when working with the OpenAI SDK. Many tools and scripts already read from these variables automatically.

  ```bash theme={null}
  export OPENAI_BASE_URL="https://api.darkbloom.dev/v1"
  export OPENAI_API_KEY="eigeninference-your-key-here"
  ```
</Tip>

## Key management

You can create and revoke keys programmatically. Key creation and revocation require an active Privy session (interactive login) — API keys cannot be used to create or revoke other API keys.

### Create a key

```bash theme={null}
POST /v1/auth/keys
```

### Revoke a key

```bash theme={null}
DELETE /v1/auth/keys
```

Pass the key you want to revoke in the request body as `{"key": "eigeninference-..."}`.

## Authentication errors

<ResponseField name="401 Unauthorized" type="error">
  The `Authorization` header is missing or the key is invalid. Check that you are passing the full key value including the `eigeninference-` prefix.
</ResponseField>

<ResponseField name="403 Forbidden" type="error">
  Your account has insufficient balance to complete the request. Add credits in the console under **Billing → Add Credits**.
</ResponseField>
