请求头

请求头必填说明
AuthorizationBearer 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": {}
  }
}
字段类型说明
idinteger用户 ID
usernamestring登录用户名
display_namestring显示名
roleinteger角色:1 普通用户 / 10 管理员 / 100 超级管理员
statusinteger状态:1 启用 / 2 封禁
emailstring绑定邮箱
github_id / discord_id / oidc_id / wechat_id / telegram_id / linux_do_idstring各第三方登录绑定标识
groupstring用户分组(决定可用模型与倍率)
quotainteger当前剩余额度(500000 = 1 美元)
used_quotainteger历史已用额度
request_countinteger累计请求次数
aff_codestring本人邀请码
aff_countinteger已邀请人数
aff_quotainteger可用推广额度
aff_history_quotainteger历史累计推广额度
inviter_idinteger邀请人用户 ID(0 表示无)
settingstring用户个性化设置(JSON 字符串)
stripe_customerstringStripe 客户 ID
permissionsobject角色权限信息