Skip to content

Query API Key Details ​

Endpoint Path ​

http
GET /api/open/token/:id

Quota Calculation ​

Quota fields are internal units. Convert to CNY as follows:

Amount (¥) = quota ÷ quota_per_unit × usd_exchange_rate

Where:

  • quota: from data.remain_quota (remaining) or data.used_quota (used); for monthly limits use data.monthly_quota_limit / data.current_month_used
  • quota_per_unit, usd_exchange_rate, quota_display_type: from Query Conversion Parameters (GET /api/open/status)

If quota_display_type = USD, omit × usd_exchange_rate.

When unlimited_quota = true, token quota is unlimited; do not convert remain_quota as remaining balance.

Request Parameters ​

FieldTypeRequiredDescriptionConstraintsExample
idintYesToken record IDPositive integer5001

Request Example ​

json
GET 'https://neolink.com/backend/api/open/token/5001'
GET 'https://neolink.com/backend/api/open/token/5002'

Return Information ​

FieldTypeRequiredDescriptionRemarks
successboolYesRequest success indicatorFixed value
messagestringYesError message (empty if successful)Fixed value
dataTokenYesSingle token objectSee fields below

Token Object

FieldTypeRequiredDescriptionRemarks
idintYesToken record IDDatabase unique identifier
namestringYesToken nameCustom name
keystringYesKey display valueOnly shows last 4 characters
statusintYesToken status1=Normal; 2=Disabled; 3=Expired; 4=Insufficient quota
created_timeint64YesCreation timeUnix second timestamp
accessed_timeint64NoLast access timeUnix second timestamp; 0 if never accessed
expired_timeint64YesExpiration timeUnix second timestamp; -1=Never expires
remain_quotaint64YesRemaining quotaCurrent available quota; see Quota Calculation above
used_quotaint64YesUsed quotaConsumed quota; see Quota Calculation above
unlimited_quotaboolYesUnlimited quota flagtrue=Unlimited; false=Limited
user_idintYesOwner user IDCreator user ID
enterprise_idintYesEnterprise IDBelonging enterprise
organization_idintYesOrganization IDBelonging department
busi_typeintYesBusiness type1=API; 2=Other
groupstringYesPrimary groupDefault group name
groups[]stringYesGroup arrayAll belonging groups
model_limitsstringYesModel restrictionsComma-separated model list
model_limits_enabledboolYesModel limits enabledtrue=Enabled; false=Disabled
allow_ipsstringYesIP whitelistComma-separated IPs or CIDR
monthly_quota_limitint64YesMonthly quota limitMaximum monthly quota limit
current_monthintYesCurrent monthFormat YYYYMM
current_month_usedint64YesMonth usedCurrent month consumption
cross_group_retryboolYesCross-group retrytrue=Enabled; false=Disabled
created_by_member_idintYesCreator member IDEnterprise creator member ID
member_display_namestringYesCreator display nameReal name or nickname
member_usernamestringYesCreator usernameLogin username
member_mobile_maskedstringYesCreator mobile (masked)Only shows last 4 digits
creator_deletedboolYesCreator deleted flagtrue=Deleted; false=Normal

Response Example ​

json
{
  "success": true,
  "message": "",
  "data": {
    "id": 5001,
    "name": "api-key-prod-1",
    "key": "sk-****a5b0",
    "status": 1,
    "created_time": 1711468800,
    "accessed_time": 1711584000,
    "expired_time": -1,
    "remain_quota": 1000000,
    "used_quota": 500000,
    "unlimited_quota": false
  }
}

Error response:

json
{
  "success": false,
  "message": "Token not found or deleted"
}