API DocsManagement APIUser Management

Get Current User Information

🔐 PAT required (User permission)

Returns the authenticated user's profile and three independent quota buckets: wallet, promotion, and subscriptions.

Base URL

  • https://api.autorouter.top — Production

Authentication

This endpoint requires a system access token (PAT) + Auto-Api-User. sk-xxx API Keys are not supported.

HeaderDescription
AuthorizationSystem access token. Format: Bearer {system_access_token}. Generate it in Personal Center → Profile → Access Token. The Bearer prefix is optional.
Auto-Api-UserCurrent logged-in user ID. Must match the user that owns the token. Copy it from Personal Center → Profile → User ID.

Endpoints

GET /api/user/self

Get current user information

🔐 PAT required (User permission)

Responses

200: Success

Content-Type: application/json

401: Unauthorized

Response Fields

Top level
FieldTypeDescription
successbooleanWhether the request succeeded
messagestringError message; empty on success
dataobjectUser profile and balance information
data user fields
FieldTypeDescription
idintegerUser ID
usernamestringUsername
display_namestringDisplay name
roleintegerRole: 1 user, 10 admin, 100 root
statusintegerAccount status
emailstringEmail address
groupstringUser group
user_level_idintegerBase membership level ID configured by admins
user_level_namestringBase membership level name
effective_user_level_idintegerEffective membership level ID at runtime
effective_user_level_namestringEffective membership level name at runtime
quotaintegerRemaining wallet quota. Wallet balance only; does not include promotion or subscription quota
quota_amountnumberWallet balance amount
promotion_quotaintegerIndependent promotion quota, tracked separately from wallet quota
promotion_amountnumberIndependent promotion balance
promotion_expires_atintegerPromotion expiration time as a Unix timestamp in seconds; 0 when no promotion is available
total_available_quotaintegerCurrent available quota total, calculated as quota + promotion_quota; does not include subscription quota
used_quotaintegerLifetime used quota. This is cumulative account usage and should not be interpreted as wallet-only consumption
used_quota_amountnumberLifetime used balance
request_countintegerLifetime request count
aff_codestringReferral code
aff_countintegerNumber of referred signups
aff_quotaintegerRedeemable referral reward quota
aff_history_quotaintegerLifetime referral reward quota
inviter_idintegerInviter user ID
settingstringUser settings JSON string
sidebar_modulesstringSidebar module configuration
stripe_customerstringStripe customer ID
permissionsobjectPermission configuration
subscriptionsarrayIndependent subscription quota list; each item summarizes one active subscription (see below)
github_id / discord_id / oidc_id / wechat_id / telegram_id / linux_do_idstringLinked third-party account IDs; empty when not linked
data.subscriptions[] subscription quota
FieldTypeDescription
idintegerSubscription record ID
plan_idintegerSubscription plan ID
amount_totalnumberTotal subscription amount. Returns -1 for unlimited subscriptions
amount_usednumberUsed amount
start_timeintegerSubscription start time (Unix timestamp, seconds)
end_timeintegerSubscription end time (Unix timestamp, seconds)
statusstringSubscription status; see table below
Subscription status values
ValueDescription
activeActive
cancel_pendingCancellation requested; still usable until the current period ends

Quota field relationships

The response exposes three independent quota buckets:

TypeQuota fieldAmount fieldDescription
Walletquotaquota_amountRemaining wallet balance
Promotionpromotion_quotapromotion_amountIndependent promotion credits with promotion_expires_at
Subscriptionsubscriptions[]amount_total / amount_usedIndependent subscription quota list, tracked per subscription
  • total_available_quota currently sums wallet and promotion quota only: quota + promotion_quota. It does not include subscription quota from subscriptions.
  • used_quota represents lifetime account usage, not wallet-only consumption.
  • amount_total = -1 in a subscription item means unlimited quota.

Request Examples

curl -X GET "https://api.autorouter.top/api/user/self" \
  -H "Authorization: Bearer YOUR_SYSTEM_ACCESS_TOKEN" \
  -H "Auto-Api-User: YOUR_USER_ID"

Response Example

{
  "success": true,
  "message": "",
  "data": {
    "id": 1,
    "username": "admin",
    "display_name": "Root User",
    "role": 100,
    "status": 1,
    "email": "",
    "group": "default",
    "user_level_id": 1,
    "user_level_name": "default",
    "effective_user_level_id": 1,
    "effective_user_level_name": "default",
    "quota": 499833937905329,
    "quota_amount": 999667875.810658,
    "promotion_quota": 0,
    "promotion_amount": 0,
    "promotion_expires_at": 0,
    "total_available_quota": 499833937905329,
    "used_quota": 168868338185,
    "used_quota_amount": 337736.67637,
    "request_count": 12922181,
    "aff_code": "zwRf",
    "aff_count": 0,
    "aff_quota": 0,
    "aff_history_quota": 0,
    "inviter_id": 0,
    "github_id": "",
    "discord_id": "",
    "oidc_id": "",
    "wechat_id": "",
    "telegram_id": "",
    "linux_do_id": "",
    "setting": "{\"billing_preference\":\"wallet_first\",\"language\":\"zh\"}",
    "stripe_customer": "",
    "sidebar_modules": "",
    "permissions": {
      "sidebar_settings": false,
      "sidebar_modules": {}
    },
    "subscriptions": [
      {
        "id": 12,
        "plan_id": 3,
        "amount_total": 100,
        "amount_used": 25.5,
        "start_time": 1756617600,
        "end_time": 1759296000,
        "status": "active"
      }
    ]
  }
}

On this page