User Logs & Usage Statistics
curl --request GET \
--url https://api.mixroute.ai/api/log/selfimport requests
url = "https://api.mixroute.ai/api/log/self"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.mixroute.ai/api/log/self', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixroute.ai/api/log/self",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mixroute.ai/api/log/self"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mixroute.ai/api/log/self")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/api/log/self")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodySystem 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
/
api
/
log
/
self
User Logs & Usage Statistics
curl --request GET \
--url https://api.mixroute.ai/api/log/selfimport requests
url = "https://api.mixroute.ai/api/log/self"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.mixroute.ai/api/log/self', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixroute.ai/api/log/self",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mixroute.ai/api/log/self"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mixroute.ai/api/log/self")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/api/log/self")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyIntroduction
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:| Header | Description |
|---|---|
Authorization | Bearer <you-api-key>, your system access API key |
New-Api-User | <you-user-id>, your account user ID |
Get User Logs GET /api/log/self
Returns the usage logs for your account, sorted newest first. Pagination parameters control the output.
Request Parameters
For example,/api/log/self?p=1&page_size=20 returns the first page with 20 log entries per page.
Request Example
cURL
curl --request GET \
--url 'https://console.mixroute.ai/api/log/self?p=1&page_size=20' \
--header 'authorization: Bearer <you-api-key>' \
--header 'new-api-user: <you-user-id>'
Response Example
Response
{
"data": {
"page": 1,
"page_size": 20,
"total": 2821,
"items": [
{
"id": 1,
"user_id": 81,
"created_at": 1787215542,
"type": 2,
"content": "",
"username": "<you-user-name>",
"token_name": "<your-token-name>",
"model_name": "deepseek-v4-flash-0731",
"quota": 768,
"prompt_tokens": 23144,
"completion_tokens": 2948,
"use_time": 38,
"is_stream": true,
"channel": 239,
"channel_name": "",
"token_id": 202,
"group": "default",
"ip": "",
"request_id": "202608200845041208627278268d9d63W55TNWu",
"other": "{\"billing_source\":\"wallet\",\"cache_ratio\":0.02,\"cache_tokens\":18432,\"completion_ratio\":2,\"frt\":1245,\"group_ratio\":1,\"model_price\":-1,\"model_ratio\":0.07,\"reasoning_effort\":\"max\",\"request_conversion\":[\"OpenAI Responses\"],\"request_path\":\"/v1/responses\",\"user_group_ratio\":-1}"
}
]
},
"message": "",
"success": true
}
Log Field Reference
| Field | Type | Description |
|---|---|---|
data.page | integer | Current page number |
data.page_size | integer | Number of entries per page |
data.total | integer | Total number of log entries |
data.items[] | array | List of log entries |
data.items[].id | integer | Log ID |
data.items[].user_id | integer | User ID |
data.items[].created_at | integer | Creation time (Unix timestamp in seconds) |
data.items[].type | integer | Record type |
data.items[].content | string | Notes or error message, usually empty |
data.items[].username | string | Username |
data.items[].token_name | string | API Key name used |
data.items[].model_name | string | Model name |
data.items[].quota | integer | Quota consumed for this request (1 USD = 500,000 quota (5 × 10⁵)) |
data.items[].prompt_tokens | integer | Number of input tokens |
data.items[].completion_tokens | integer | Number of output tokens |
data.items[].use_time | integer | Request duration (seconds) |
data.items[].is_stream | boolean | Whether the request was streamed |
data.items[].channel | integer | Channel ID |
data.items[].channel_name | string | Channel name, may be empty |
data.items[].token_id | integer | API Key ID |
data.items[].group | string | Group name |
data.items[].ip | string | Request IP |
data.items[].request_id | string | Request ID |
data.items[].other | string | Billing metadata as a JSON string, see below |
data.items[].other is a JSON string that mainly contains the following billing and request information:
| Field | Description |
|---|---|
billing_source | Billing source, e.g. wallet |
model_price | Model unit price, -1 when not specified |
model_ratio | Model multiplier |
cache_ratio | Cache multiplier |
cache_tokens | Number of cached tokens |
completion_ratio | Output multiplier |
group_ratio | Group multiplier |
user_group_ratio | User group multiplier |
reasoning_effort | Reasoning effort setting |
request_conversion | Request conversion method, e.g. OpenAI Responses |
request_path | Actual request path, e.g. /v1/responses |
frt | Time to first token (milliseconds) |
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
curl --request GET \
--url 'https://console.mixroute.ai/api/log/self/stat' \
--header 'authorization: Bearer <you-api-key>' \
--header 'new-api-user: <you-user-id>'
Response Example
Response
{
"data": {
"quota": 32892251,
"rpm": 0,
"tpm": 0
},
"message": "",
"success": true
}
Field Reference
| Field | Type | Description |
|---|---|---|
data.quota | integer | Cumulative quota consumed |
data.rpm | integer | Requests-per-minute limit status |
data.tpm | integer | Tokens-per-minute limit status |
message | string | Error message, empty on success |
success | boolean | Whether the request succeeded |