Skip to main content
GET
/
api
/
user
/
self
Get Account Info
curl --request GET \
  --url https://api.example.com/api/user/self

Overview

Retrieve the current authenticated user’s account information, including username, balance, and usage statistics.

Response Format

{
  "success": true,
  "message": "",
  "data": {
    "id": 1,
    "username": "user123",
    "display_name": "John Doe",
    "email": "user@example.com",
    "role": 1,
    "status": 1,
    "quota": 500000,
    "used_quota": 123456,
    "request_count": 2048,
    "group": "default",
    "inviter_id": 0,
    "aff_code": "abc123",
    "aff_count": 5,
    "aff_quota": 10000
  }
}

Field Descriptions

FieldTypeDescription
quotaintCurrent balance (internal quota units)
used_quotaintTotal used quota
request_countintTotal request count
groupstringUser group (affects pricing multiplier)
roleintRole: 1=regular user, 10=admin, 100=super admin
aff_codestringReferral code
aff_countintNumber of referrals
aff_quotaintReferral reward quota

Quota Conversion

The conversion between internal quota units and USD:
1 USD = 500,000 quota units
i.e. 1 quota unit ≈ $0.000002

Code Examples

import requests

headers = {
    "Authorization": "Bearer your_access_token",
    "New-Api-User": "1",
    "User-Agent": "Mozilla/5.0"
}

response = requests.get(
    "https://crazyrouter.com/api/user/self",
    headers=headers
)

user = response.json()["data"]
balance_usd = user["quota"] / 500000
used_usd = user["used_quota"] / 500000

print(f"User: {user['username']}")
print(f"Balance: ${balance_usd:.2f}")
print(f"Used: ${used_usd:.2f}")
print(f"Requests: {user['request_count']}")
You can also query balance via API Key using GET /api/user/self, which returns the information of the user who owns the Key.