Search...
Menu

Profile

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:

•You need a system access token with the "Profile · View" permission. See the "Authentication" chapter for how to authenticate.
•If the token lacks this permission, HTTP 403 is returned.

1. View profile

Get the basic information and quota usage of the currently logged-in account.

Request

•Method: GET
•Path: /api/user/self

No 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
This API does not return the login password or the system access token.

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

•Method: GET
•Path: /api/user/self/groups

No query parameters and no request body.

Response

Example success response:

Group names, ratios, and descriptions are determined by system configuration. The following is only a format example; the actual content depends on what the API returns.
{
  "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.

Last modified: 2026-11-17