請求頭
| 請求頭 | 必填 | 說明 |
|---|---|---|
Authorization | ✓ | Bearer YOUR_ACCESS_TOKEN,帳號訪問令牌(控制台登入態,非 sk- API Key) |
GET /api/user/self
取得當前登入帳號的資料、額度(餘額)與推廣資訊。帳號可用額度在 data.quota,已用額度在 data.used_quota(均為 quota 整數,500000 quota = 1 美元)。
curl "https://bearlab.ai/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 | 角色權限資訊 |