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

# Authentication

> Learn how to authenticate with the Electron Hub API

The Electron Hub API uses API keys for authentication. You'll need to include your API key in the `Authorization` header of every request.

## Key Types

Electron Hub issues three kinds of API keys, all used the same way (Bearer token):

| Prefix      | Type            | What it's for                                                                                                           |
| ----------- | --------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `ek-`       | **Master key**  | Your main account key — full model catalog, billed against your credits                                                 |
| `ek-proxy-` | **Proxy key**   | Scoped sub-keys you create under your master key, with per-key budgets and model allowlists                             |
| `ek-dev-`   | **DevPass key** | [Coding Plan](/billing/coding-plan) key — flat-rate access to the dedicated `:dev` coding models, never touches credits |

<Note>
  `:dev` models accept only `ek-dev-` keys, and DevPass keys work only on the Coding Plan model list — the key types don't overlap.
</Note>

## Getting Your API Key

1. Visit the [Electron Hub Console](https://app.electronhub.ai)
2. Sign up or log in to your account
3. Navigate to the API Keys section
4. Generate a new API key
5. Copy and securely store your API key

<Warning>
  Keep your API key secure and never share it publicly. Treat it like a password.
</Warning>

## Using Your API Key

Include your API key in the `Authorization` header with the `Bearer` prefix:

```bash theme={null}
curl -X POST "https://api.electronhub.ai/v1/chat/completions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'
```

## Environment Variables

For security, store your API key as an environment variable:

```bash theme={null}
export ELECTRONHUB_API_KEY="your_api_key_here"
```

Then use it in your code:

```python theme={null}
import os
api_key = os.getenv("ELECTRONHUB_API_KEY")
```

## API Key Management

* **Regenerate Keys**: You can regenerate your API key at any time in the console
* **Multiple Keys**: Create separate keys for different environments (development, production)
* **Monitor Usage**: Track your API usage in the console dashboard

## Rate Limiting

API keys are subject to rate limits based on your plan. See our [rate limits guide](/getting-started/rate-limits) for more information.
