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

# 鉴权

> 使用租户 API Token 调用 BP-Agent Open API。

租户管理员在 BP-Agent 管理界面创建 API Token。Token 以 `sk-` 开头，完整值只应保存在调用方的密钥管理系统中。

每个请求都需要携带：

```http theme={null}
Authorization: Bearer <BP_AGENT_API_TOKEN>
```

示例：

```bash theme={null}
curl -sS \
  -H "Authorization: Bearer ${BP_AGENT_API_TOKEN}" \
  "${BP_AGENT_BASE_URL}/api/open/runs?limit=10&offset=0"
```

## 失败响应

缺少、失效或过期的 Token 会返回 HTTP `401`：

```json theme={null}
{
  "code": 1001,
  "message": "缺少授权头",
  "detail": {
    "error_code": "OPEN_API_TOKEN_INVALID",
    "retryable": false,
    "client_action": "FIX_CONFIGURATION"
  },
  "timestamp": null
}
```

<Warning>
  不要把 Token 写进代码仓库、截图、工单或对接文档。测试与生产 Token 不可混用。
</Warning>
