> ## 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.

# 账号 JWT 鉴权

> 使用账号密码取得 JWT，调用 N1 等账号接口。

N1 投资人项目卡当前不使用 `sk-` API Token。调用方需要先使用 BP-Agent 账号登录，取得 JWT `access_token`。

## 登录

`account` 支持用户名、邮箱或手机号：

```bash theme={null}
curl -sS -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "account": "<账号>",
    "password": "<密码>"
  }' \
  "${BP_AGENT_BASE_URL}/api/auth/login"
```

从响应中保存：

* `data.access_token`：调用账号接口时使用的 JWT。
* `data.refresh_token`：访问令牌过期后换取新令牌。
* `data.user`：当前账号、租户与角色信息。

后续请求携带：

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

## 刷新令牌

```bash theme={null}
curl -sS -X POST \
  -H "Content-Type: application/json" \
  -d '{"refresh_token":"<JWT_REFRESH_TOKEN>"}' \
  "${BP_AGENT_BASE_URL}/api/auth/refresh"
```

<Warning>
  JWT 代表一个真实用户账号。不要将账号密码、`access_token` 或 `refresh_token` 写入代码仓库、日志或对接文档。登录接口存在速率限制，调用方应复用有效令牌并在过期时刷新。
</Warning>

<Note>
  JWT 用于 `/api/auth/*`、`/api/acture/*` 和 `/api/investor-products/*` 等账号接口；`sk-` API Token 用于 `/api/open/*`。两种凭证不能互换。
</Note>
