Query Personal Account Usage
Endpoint Path
http
GET /api/open/data/selfRate Limit
This endpoint follows Authentication Overview · Rate Limits: default max 10 requests per user per minute (shared with most other Open query APIs). Exceeding the limit returns HTTP 429.
Quota Calculation
quota is an internal unit. Convert to CNY as follows:
Amount (¥) = quota ÷ quota_per_unit × usd_exchange_rateWhere:
quota: fromdata[].quotareturned by this endpointquota_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.
Request Parameters
| Field | Type | Required | Description | Constraints | Remarks |
|---|---|---|---|---|---|
| start_timestamp | int64 | No | Start timestamp (seconds) | Used with end_timestamp | Example: 1711468800 |
| end_timestamp | int64 | No | End timestamp (seconds) | Used with start_timestamp | Example: 1712073600 |
Time Range Rules
| Scenario | Behavior |
|---|---|
| Neither side passed, or either side is 0 / missing | Both ends reset to the last 7 days (end=now, start=now-7d) |
| Both sides passed and valid | Query the given range |
| Span exceeds 31 days | Returns error: time span cannot exceed 31 days |
Request Example
json
GET 'https://neolink.com/backend/api/open/data/self?start_timestamp=1711468800&end_timestamp=1712073600'Return Information
| Field | Type | Required | Description | Remarks |
|---|---|---|---|---|
| success | bool | Yes | Whether the request succeeded | - |
| message | string | Yes | Error message (empty on success) | Translated per X-Accept-Language |
| data | []QuotaDataItem | Yes | Quota statistics array | Aggregated by time + model; see table below |
QuotaDataItem Object (data array element)
| Field | Type | Required | Description | Remarks |
|---|---|---|---|---|
| id | int | Yes | Quota data record ID | - |
| user_id | int | Yes | User ID | - |
| username | string | Yes | Username | - |
| model_name | string | Yes | Model code | Converted model code (not raw model name) |
| created_at | int64 | Yes | Statistics timestamp (seconds) | Hour precision; Unix timestamp |
| token_used | int | Yes | Tokens consumed for this model in the period | - |
| count | int | Yes | Call count for this model in the period | - |
| quota | int | Yes | Quota consumed for this model in the period | Internal quota units; see Quota Calculation above |
| token_id | int | Yes | Associated Token ID | 0 = not associated (e.g. direct user account) |
Response Example
json
Success response
{
"success": true,
"message": "",
"data": [
{
"id": 1,
"user_id": 100,
"username": "john_doe",
"model_name": "gpt-4",
"created_at": 1711497600,
"token_used": 12500,
"quota": 62500,
"count": 25,
"token_id": 0
},
{
"id": 2,
"user_id": 100,
"username": "john_doe",
"model_name": "gpt-3.5-turbo",
"created_at": 1711497600,
"token_used": 50000,
"quota": 25000,
"count": 100,
"token_id": 0
}
]
}
Error response
{
"success": false,
"message": "Time span cannot exceed 31 days"
}