Query Personal Call Logs
Returns consumption logs for the current logged-in user in personal mode (
enterprise_id=0).
Endpoint Path
http
GET /api/open/log/selfRate Limit
This endpoint uses an independent rate limit strategy OpenLogRateLimit: max 5 requests per user per minute, independent of other Open rate limits.
Cost Calculation
Final cost (CNY) is calculated as:
Final cost (¥) = quota ÷ quota_per_unit × usd_exchange_rateWhere:
quota: fromdata.items[].quotain this API responsequota_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 timestamp (seconds) | Difference from end_timestamp must not exceed 1 calendar month | 1711468800 |
| end_timestamp | int64 | No | End timestamp (seconds) | Difference from start_timestamp must not exceed 1 calendar month | 1711555200 |
| token_name | string | No | Token name filter | Exact match | ximi令牌2 |
| model_name | string | No | Model name filter | Fuzzy match | gpt-4o |
| billing_source | string | No | Filter consumption logs by billing source | Single value or comma-separated values; empty / omitted / -1 = no filter (all sources, including equity types) | See enum table below |
| p | int | No | Page number | Default 1 | 1 |
| page_size | int | No | Page size | Default 10; max 500 | 20 |
billing_source Enum
| Value | Meaning | Typical Scenario |
|---|---|---|
| 0 | Balance deduction by volume | General API Key cash/balance calls |
| 1 | Subscription seat equity | Subscription package seat calls |
| 2 | Equity package / Resource package | Resource package calls |
| 3 | Free | Free quota calls |
Time Range Rules
| Scenario | Behavior |
|---|---|
| Neither start_timestamp nor end_timestamp provided | Default start = now - 86400, end = now (last 24 hours) |
| Only one of them provided | Default 24-hour rule is not applied |
| Difference between start and end exceeds 1 calendar month | Request fails |
Request Example
json
GET 'https://neolink.com/backend/api/open/log/self?p=1&page_size=20'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 | PageInfo | Yes | Paginated data object | See table below |
PageInfo Object
| Field | Type | Required | Description | Remarks |
|---|---|---|---|---|
| page | int | Yes | Current page number | |
| page_size | int | Yes | Items per page | |
| total | int | Yes | Total item count | |
| items | []LogItem | Yes | Log list | See table below |
LogItem Object
| Field | Type | Required | Description | Remarks |
|---|---|---|---|---|
| request_id | string | Yes | Request ID | |
| created_at | int64 | Yes | Created time | Unix timestamp in seconds |
| token_name | string | Yes | Token / API Key name | |
| model_name | string | Yes | Model name | |
| quota | int | Yes | Consumed quota | See Cost Calculation above |
| prompt_tokens | int | Yes | Input token count | |
| completion_tokens | int | Yes | Output token count | |
| cache_tokens | int64 | Yes | Cache hit token count | |
| cache_creation_tokens | int64 | Yes | Cache creation token count | |
| use_time | int | Yes | Request duration (seconds) | |
| is_stream | bool | Yes | Whether streaming | true=streaming; false=non-streaming |
Response Example
json
Success
{
"success": true,
"message": "",
"data": {
"page": 1,
"page_size": 20,
"total": 1,
"items": [
{
"request_id": "req_abc123",
"created_at": 1747818790,
"token_name": "ximi令牌2",
"model_name": "gemini-1.5-pro",
"quota": 442680,
"prompt_tokens": 166833,
"completion_tokens": 226,
"cache_tokens": 0,
"cache_creation_tokens": 0,
"use_time": 1,
"is_stream": false
}
]
}
}
Empty list
{
"success": true,
"message": "",
"data": {
"page": 1,
"page_size": 20,
"total": 0,
"items": []
}
}
Failure (not logged in / rate limited, etc.)
{
"success": false,
"message": "Unauthorized: not logged in and no access token provided"
}