TLDR:查询当前账户的基本信息。
认证说明:此接口使用系统令牌进行认证,与 Claude API 的 API Key 不同。系统令牌和账户 ID 可在 控制台 的个人设置页面中获取。
GET /api/user/self| 参数 | 必需 | 类型 | 说明 |
|---|---|---|---|
new-api-user | 是 | string | 你的账户 ID |
Authorization | 是 | string | 你的系统令牌 |
{
"success": true,
"data": {
"id": 1,
"username": "user@example.com",
"display_name": "用户名",
"role": "user",
"quota": 1000000,
"used_quota": 50000,
"created_at": 1234567890
}
}| 字段 | 类型 | 说明 |
|---|---|---|
id | number | 账户 ID |
username | string | 用户名/邮箱 |
display_name | string | 显示名称 |
role | string | 用户角色 |
quota | number | 总额度,单位为分(需除以 100 换算为元 ¥,例如 1000000 表示 ¥10,000.00) |
used_quota | number | 已用额度,单位为分(需除以 100 换算为元 ¥) |
created_at | number | 创建时间戳 |
| 状态码 | 说明 |
|---|---|
401 Unauthorized | 认证失败。可能原因:系统令牌无效或已过期、账户 ID 不正确、请求头中缺少 Authorization 或 new-api-user 字段。请检查令牌和账户 ID 是否与控制台中的一致。 |
403 Forbidden | 账户已被禁用或无权限访问此接口。 |
500 Internal Server Error | 服务端内部错误,请稍后重试。 |
{
"success": false,
"message": "Unauthorized: invalid system token"
}