请求头
| 请求头 | 必填 | 说明 |
|---|---|---|
Authorization | ✓ | Bearer YOUR_ACCESS_TOKEN,账号访问令牌(控制台登录态,非 sk- API Key) |
接口:GET /api/user/self 获取当前登录账号的资料、额度(余额)与推广信息。账号可用额度在 data.quota,已用额度在 data.used_quota(均为 quota 整数,500000 quota = 1 美元)。
curl "https://top.qingyuntop.ai/dashboard//api/user/self" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Response
{
"success": true,
"message": "",
"data": {
"id": 42,
"username": "alice",
"display_name": "Alice",
"role": 1,
"status": 1,
"email": "alice@example.com",
"github_id": "",
"discord_id": "",
"oidc_id": "",
"wechat_id": "",
"telegram_id": "",
"linux_do_id": "",
"group": "default",
"quota": 55636,
"used_quota": 444364,
"request_count": 128,
"aff_code": "ABCDEF",
"aff_count": 3,
"aff_quota": 0,
"aff_history_quota": 1500000,
"inviter_id": 0,
"setting": "{}",
"stripe_customer": "",
"sidebar_modules": "",
"permissions": {}
}
}| 字段 | 类型 | 说明 |
|---|---|---|
id | integer | 用户 ID |
username | string | 登录用户名 |
display_name | string | 显示名 |
role | integer | 角色:1 普通用户 / 10 管理员 / 100 超级管理员 |
status | integer | 状态:1 启用 / 2 封禁 |
email | string | 绑定邮箱 |
github_id / discord_id / oidc_id / wechat_id / telegram_id / linux_do_id | string | 各第三方登录绑定标识 |
group | string | 用户分组(决定可用模型与倍率) |
quota | integer | 当前剩余额度(500000 = 1 美元) |
used_quota | integer | 历史已用额度 |
request_count | integer | 累计请求次数 |
aff_code | string | 本人邀请码 |
aff_count | integer | 已邀请人数 |
aff_quota | integer | 可用推广额度 |
aff_history_quota | integer | 历史累计推广额度 |
inviter_id | integer | 邀请人用户 ID(0 表示无) |
setting | string | 用户个性化设置(JSON 字符串) |
stripe_customer | string | Stripe 客户 ID |
permissions | object | 角色权限信息 |