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

# 认证

> 每个客户端请求都需携带 Bearer 令牌。

在每个请求中将 API 密钥作为 Bearer 令牌发送：

```bash theme={null}
curl "$BASE/v1/async/task/$TASK_ID" \
  -H "Authorization: Bearer $API_KEY"
```

缺少密钥或密钥错误时返回 `401`：

```json theme={null}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid API key",
    "timestamp": "2026-07-09T04:12:00.000Z"
  }
}
```

## 需要认证的端点

| 端点 | 认证 |
| - | - |
| `POST /v1/async/task` | Bearer |
| `POST /v1/async/task/batch` | Bearer |
| `GET /v1/async/task/{id}` | Bearer |
| `GET /stats` | Bearer |
| `GET /capacity` | Bearer |
| `GET /health` | 无（存活探针） |
| `GET /ready` | 无（就绪探针） |

## 获取密钥

密钥在接入时发放。如需申请访问，请通过 [querying.ai](https://querying.ai) 联系我们。
