IV. Profile
The APIs in this chapter query the current account's profile, available groups, and available models. All are GET requests with no request body.
Permission requirements:
1. View profile
Get the basic information and quota usage of the currently logged-in account.
Request
GET/api/user/selfNo query parameters and no request body.
Response
Example success response:
{
"success": true,
"message": "",
"data": {
"id": 12345,
"username": "example_user",
"display_name": "example_user",
"has_password": true,
"email": "user@example.com",
"github_id": "",
"discord_id": "",
"oidc_id": "",
"wechat_id": "",
"telegram_id": "",
"linux_do_id": "",
"group": "default",
"quota": 5000000,
"used_quota": 10000000,
"request_count": 128
}
}
Field descriptions:
| Field | Type | Notes |
|---|---|---|
id |
int | User ID |
username |
string | Username |
display_name |
string | Display name |
has_password |
boolean | Whether a login password is set for the account |
email |
string | Linked email |
github_id / discord_id / oidc_id / wechat_id / telegram_id / linux_do_id |
string | Third-party account binding info; empty if none is linked |
group |
string | Current user group |
quota |
int | Remaining quota (in quota units). Dollar equivalent = quota / 500000 (default ratio; see the console for the exact value) |
used_quota |
int | Used quota (in quota units) |
request_count |
int | Total number of requests |
Example
curl -sS "https://ailink.nativex.com/api/user/self" \
-H "Authorization: Bearer <your-system-access-token>"
2. View available groups
Get the groups your current account can use, along with the billing ratio of each group. The group you select when creating an API key must be in this list.
Request
GET/api/user/self/groupsNo query parameters and no request body.
Response
Example success response:
{
"success": true,
"message": "",
"data": {
"default": {
"ratio": 1,
"desc": "Default group"
},
"auto": {
"ratio": "自动",
"desc": "Automatically select an available group"
}
}
}
Field descriptions:
| Field | Type | Notes |
|---|---|---|
data |
object | Keys are group names; values are the details of each group |
data.<group-name>.ratio |
number / string | Billing ratio when the current account uses this group; the auto group always returns the string 自动 |
data.<group-name>.desc |
string | Group description |
Example
curl -sS "https://ailink.nativex.com/api/user/self/groups" \
-H "Authorization: Bearer <your-system-access-token>"
3. View available models
To get the available models, use the GET /api/user/models API. See the "Model List" chapter for the request method and response format. It also requires only the "Profile · View" permission.