Skip to content
EN

获取用户信息(余额

方法: GET路径: /api/user/self

token 需要在 个人中心生成 系统令牌 进行调用 非令牌页的API令牌

请求参数

Header 参数

text
New-API-User
string
在个人中心查看
必需
示例:
{{用户ID}}

请求示例代码

Shell

bash
curl --location --request GET '/api/user/self' \
--header 'New-API-User: {{用户ID}}' \
--header 'Authorization: Bearer <token>'

返回响应

🟢 200 成功

内容类型: application/json

响应结构

text
object

示例

json
{
    "data": {
        "id": 1,
        "username": "xx",
        "password": "",
        "display_name": "xx",
        "status": 1,
        "email": "xx",
        "github_id": "xx",
        "wechat_id": "",
        "telegram_id": "",
        "verification_code": "",
        "access_token": "xxx",
        "quota": 1000000,   // 用户余额,除以 50w(500000)等于网站额度
        "used_quota": 1000000,
        "request_count": 1,
        "group": "default",
        "aff_code": "xx",
        "aff_count": 2,
        "aff_quota": 3500000,
        "aff_history_quota": 5000000,
        "inviter_id": 0,
        "exclusive_price": "",
        "allow_models": "",
        "fixed_quota": 0,
        "fixed_quota_expire_at": 0,
        "agent_user_id": 0,
        "order_num": 1,
        "task_limits": "",
        "last_login_time": 1747745912,
        "last_login_ip": "210.61.187.236"
    },
    "message": "",
    "success": true
}