Skip to content

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/self

Rate 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_rate

Where:

  • quota: from data.items[].quota in this API response
  • 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.

Request Parameters ​

FieldTypeRequiredDescriptionConstraintsExample
start_timestampint64NoStart timestamp (seconds)Difference from end_timestamp must not exceed 1 calendar month1711468800
end_timestampint64NoEnd timestamp (seconds)Difference from start_timestamp must not exceed 1 calendar month1711555200
token_namestringNoToken name filterExact matchximi令牌2
model_namestringNoModel name filterFuzzy matchgpt-4o
billing_sourcestringNoFilter consumption logs by billing sourceSingle value or comma-separated values; empty / omitted / -1 = no filter (all sources, including equity types)See enum table below
pintNoPage numberDefault 11
page_sizeintNoPage sizeDefault 10; max 50020

billing_source Enum

ValueMeaningTypical Scenario
0Balance deduction by volumeGeneral API Key cash/balance calls
1Subscription seat equitySubscription package seat calls
2Equity package / Resource packageResource package calls
3FreeFree quota calls

Time Range Rules ​

ScenarioBehavior
Neither start_timestamp nor end_timestamp providedDefault start = now - 86400, end = now (last 24 hours)
Only one of them providedDefault 24-hour rule is not applied
Difference between start and end exceeds 1 calendar monthRequest fails

Request Example ​

json
GET 'https://neolink.com/backend/api/open/log/self?p=1&page_size=20'

Return Information ​

FieldTypeRequiredDescriptionRemarks
successboolYesRequest success indicatorFixed value
messagestringYesError message (empty if successful)Fixed value
dataPageInfoYesPaginated data objectSee table below

PageInfo Object

FieldTypeRequiredDescriptionRemarks
pageintYesCurrent page number
page_sizeintYesItems per page
totalintYesTotal item count
items[]LogItemYesLog listSee table below

LogItem Object

FieldTypeRequiredDescriptionRemarks
request_idstringYesRequest ID
created_atint64YesCreated timeUnix timestamp in seconds
token_namestringYesToken / API Key name
model_namestringYesModel name
quotaintYesConsumed quotaSee Cost Calculation above
prompt_tokensintYesInput token count
completion_tokensintYesOutput token count
cache_tokensint64YesCache hit token count
cache_creation_tokensint64YesCache creation token count
use_timeintYesRequest duration (seconds)
is_streamboolYesWhether streamingtrue=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"
}