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

# 认证

> 使用一把 OmniaKey API key 认证 OpenAI、Anthropic、Gemini 三套协议请求。

每个 API 请求都需要一把来自
[API Keys dashboard](https://omniakey.com/dashboard/tokens) 的 OmniaKey key。

## Bearer token

通用认证方式：

```bash theme={null}
Authorization: Bearer your-omniakey-api-key
```

## SDK 习惯

| SDK 或协议       | 认证形式                                            |
| ------------- | ----------------------------------------------- |
| OpenAI SDK    | `api_key` / `Authorization: Bearer`             |
| Anthropic SDK | `api_key` / `x-api-key`                         |
| Gemini SDK    | `api_key` / `x-goog-api-key` / `?key=` query 参数 |

自定义集成优先使用 `Authorization: Bearer`。这个形式可以稳定用于所有已文档化端点。

## 常见错误

| 状态码   | 含义                     | 处理                      |
| ----- | ---------------------- | ----------------------- |
| `401` | key 缺失、失效或错误           | 在 dashboard 重新创建/轮换 key |
| `403` | 账户余额不足或 API key cap 不够 | 充值或提高 key cap           |
