Log Query
Interface Modules
Log Query
Paginated log pull by time and type for calls, consumption, top-ups, and more
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:Request parameters
Pagination
integer
default:"1"
Page number; values
≤ 0 are treated as 1integer
default:"30"
Page size; values
≤ 0 are treated as 30; max 1000Filters
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,5Time range
string
Start time,
yyyy-MM-dd HH:mm:ss, inclusivestring
End time,
yyyy-MM-dd HH:mm:ss, inclusiveAccept-Language only affects the language of billingProcessText: zh-CN / omitted → Chinese, en-US → English.Request examples
- curl
- JavaScript
- Python
Success response
quotaDollar is a decimal string. Parse it with Decimal / BigDecimal — avoid binary floating-point types.Envelope fields
Log row (common fields)
Multimedia and other metering fields
Multimedia and other metering fields
Error responses
Integration tips
- Keep credentials on the server; never log full keys in application logs.
- Keep each query within 31 days; page through longer history in segments.
- Derive page count as
ceil(total / pageSize); do not treattotalas a page number. - Check response body
code; HTTP 200 alone does not mean business success. - Parse amount fields as decimal strings; do not recompute with
float/number.
