User Logs & Usage Statistics
System API
User Logs & Usage Statistics
Query usage logs, dashboard insights and billing information via the /api/log/self and /api/log/self/stat endpoints.
GET
User Logs & Usage Statistics
Introduction
The MixRoute Console provides two endpoints to query usage and billing information for your account, covering the following needs:- View Usage Logs
- View Dashboard insights (Model Analytics, Request Count, Token Statistics, etc.)
- View billing information (which models an API Key used, the corresponding input/output tokens, and each model’s usage share)
- Understand actual consumption by model
Authentication
All requests must include two headers:Get User Logs GET /api/log/self
Returns the usage logs for your account, sorted newest first. Pagination parameters control the output.
Request Parameters
integer
Page number, starting from 1.
integer
Number of log entries per page.
/api/log/self?p=1&page_size=20 returns the first page with 20 log entries per page.
Request Example
cURL
Response Example
Response
Log Field Reference
data.items[].other is a JSON string that mainly contains the following billing and request information:
Get Total Usage Statistics GET /api/log/self/stat
Returns the cumulative spending and rate-limit status for your account. This endpoint has no request parameters.
Request Example
cURL
Response Example
Response