Skip to main content
GET
Log Query

Overview

Fetch business logs visible to the current credential. Covers consumption, top-up, error, refund, admin, and test-credit records — useful for reconciliation, troubleshooting, and usage analytics.

Max 31 days per request

The span between startTime and endTime must not exceed 31 days. Time format is always yyyy-MM-dd HH:mm:ss.

Pagination defaults

Defaults: page=1, pageSize=30. pageSize max is 1000.

Endpoint

Authentication

Both header formats are accepted:
Never put a full key in URLs, frontend code, logs, or support tickets.

Request parameters

Pagination

integer
default:"1"
Page number; values ≤ 0 are treated as 1
integer
default:"30"
Page size; values ≤ 0 are treated as 30; max 1000

Filters

string
API Key name. Only effective with system access token auth (fuzzy match); ignored when authenticating with an API Key
string
Model name, exact match; comma-separated for multiple models
string
Request ID, exact match
string
Log types, comma-separated, e.g. 2,5

Time range

string
Start time, yyyy-MM-dd HH:mm:ss, inclusive
string
End time, yyyy-MM-dd HH:mm:ss, inclusive
Accept-Language only affects the language of billingProcessText: zh-CN / omitted → Chinese, en-US → English.

Request examples

Success response

quotaDollar is a decimal string. Parse it with Decimal / BigDecimal — avoid binary floating-point types.

Envelope fields

Log row (common fields)

Error responses

Integration tips

  1. Keep credentials on the server; never log full keys in application logs.
  2. Keep each query within 31 days; page through longer history in segments.
  3. Derive page count as ceil(total / pageSize); do not treat total as a page number.
  4. Check response body code; HTTP 200 alone does not mean business success.
  5. Parse amount fields as decimal strings; do not recompute with float / number.