> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.empiriolabs.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.empiriolabs.ai/_mcp/server.

# Authentication

All EmpirioLabs API requests must include a bearer token in the `Authorization` header.

## API key format

API keys use the `sk-empiriolabs-` prefix. You can generate up to 50 API keys per account from the dashboard.

```http
Authorization: Bearer sk-empiriolabs-...
```

## Header format

Include the header on every request:

```bash
curl "https://api.empiriolabs.ai/v1/models" \
  -H "Authorization: Bearer sk-empiriolabs-your_key_here"
```

## Sign in instead of copying a key

* **Your own coding agents:** the [EmpirioLabs AI CLI](/cli) signs in with your browser and starts Claude Code, Codex CLI, Gemini CLI and other agents already connected.
* **Apps you build for other people:** with [Sign in with EmpirioLabs AI](/oauth), your users connect their account through OAuth 2.1 and your app receives an access token of its own, which they can disconnect under **Settings > Connected applications**.
* **MCP clients** such as Claude and ChatGPT connect the same way: see [MCP Server](/mcp).

## Rate limits

Each account starts with default rate limits:

| Limit               | Default       |
| ------------------- | ------------- |
| Requests per minute | 50 RPM        |
| Tokens per minute   | 2,000,000 TPM |

If you need higher limits, email [support@empiriolabs.ai](mailto:support@empiriolabs.ai). See [Limits and API Keys](/rate-limits-api-keys) for full details.

## Recommended practices

* Generate separate API keys for production, staging, and development
* Rotate keys on a regular schedule and immediately after suspected exposure
* Store keys in a secret manager or deployment platform; never in client-side code, public repos, or logs
* Delete unused keys from the dashboard promptly

## Test your credentials

A quick way to verify your key is working:

```bash
curl "https://api.empiriolabs.ai/v1/account/usage?limit=1" \
  -H "Authorization: Bearer $EMPIRIOLABS_API_KEY"
```

A `200` response with your balance confirms the key is valid; `401` means it is missing, mistyped or deleted. The model list at `/v1/models` is public, so it answers without a key and cannot confirm one.

## Common authentication responses

| Status code             | Meaning                                       | What to do                                                                                                    |
| ----------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `401 Unauthorized`      | The token is missing, malformed, or not found | Verify the `Authorization: Bearer sk-empiriolabs-...` header format and that the key exists in your dashboard |
| `402 Payment Required`  | The account has insufficient credits          | Top up credits on the dashboard Billing page                                                                  |
| `429 Too Many Requests` | Rate limit exceeded (50 RPM default)          | Retry with exponential backoff and review your request volume                                                 |

For the complete list of status codes across every endpoint, see [Errors and Status Codes](/errors).