Query Enterprise Account Usage
Endpoint Path
http
GET /api/open/data/enterpriseQuota 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 | Example |
|---|---|---|---|---|---|
| start_timestamp | int64 | No | Start time (seconds) | With end_timestamp; default last 7 days | 1711468800 |
| end_timestamp | int64 | No | End time (seconds) | With start_timestamp; default current time | 1712073600 |
| enterprise_id | int | Yes | Enterprise ID | Optional; if provided, query specific enterprise | 1001 |
| organization_id | int | No | Department ID | Optional; if provided, query specific department | 1001 |
| member_id | int | No | Member ID | Pass when querying self | 234 |
Request Example
json
GET 'https://neolink.com/backend/api/open/data/enterprise?start_timestamp=1711468800&end_timestamp=1712073600&enterprise_id=1001'
GET 'https://neolink.com/backend/api/open/data/enterprise?enterprise_id=1001&member_id=234'Return Information
| Field | Type | Required | Description | Remarks |
|---|---|---|---|---|
| success | bool | Yes | Request success indicator | Fixed value |
| message | string | Yes | Error message (empty if successful) | Fixed value |
| data | QuotaStats | Yes | Quota statistics object | See fields below |
QuotaStats Object
| Field | Type | Required | Description | Remarks |
|---|---|---|---|---|
| enterprise_id | int | Yes | Enterprise ID | Enterprise identifier |
| enterprise_name | string | Yes | Enterprise name | Enterprise display name |
| total_quota | int64 | Yes | Total quota | Total granted quota for enterprise |
| used_quota | int64 | Yes | Used quota | Consumed quota amount |
| remaining_quota | int64 | Yes | Remaining quota | Available quota remaining |
| quota_utilization | float | Yes | Utilization rate | Percentage of quota used |
| token_count | int | Yes | Token count | Number of active tokens |
| monthly_quota_limit | int64 | Yes | Monthly limit | Maximum monthly quota |
| current_month_used | int64 | Yes | Month used | Current month consumption |
Response Example
json
{
"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,
"enterprise_id": 1001,
"organization_id": 2001,
"member_id": 101,
"token_id": 0
}
]
}