Get usage summary¶
Summarize the current user’s calls, tokens, costs, and success rate.
GET https://billing.moi.matrixorigin.cn/api/v1/taas/usage-logs/summary
Before you begin¶
Prepare a personal access token. For creation and management, see Manage personal access tokens.
Results are scoped to data accessible to the current user.
Query parameters¶
Replace $MOI_PERSONAL_ACCESS_TOKEN in the example with your personal access token.
curl --get "https://billing.moi.matrixorigin.cn/api/v1/taas/usage-logs/summary" \
-H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
No |
Start time in nonnegative Unix seconds; must not exceed |
|
integer |
No |
End time in nonnegative Unix seconds. |
|
string |
No |
Catalog model object ID. |
|
string |
No |
Model type. |
|
string |
No |
Model name submitted in the inference request. |
|
string |
No |
Call status, such as |
|
string |
No |
Call error category. |
|
string |
No |
Caller IP address. |
|
string |
No |
TaaS local token key ID. |
|
string |
No |
TaaS local key IDs; repeat the parameter or comma-separate values. |
|
string |
Required with |
Credential type: |
|
string |
Required with |
Credential object ID; requires |
|
string |
No |
Billing usage-event ID. |
|
string |
No |
Billing record ID. |
|
string |
No |
Pricing mode. |
|
string |
No |
Settlement method: genesis or |
|
string |
No |
Enterprise plan ID. |
|
string |
No |
Enterprise contract number. |
|
string |
No |
Enterprise plan model ID. |
|
string |
No |
Responses response ID. |
|
string |
No |
Conversation ID. |
|
string |
No |
Usage log IDs; repeat the parameter or comma-separate values. |
|
string |
No |
Alias for ids; values are combined. |
|
string |
No |
Provider ID; results remain scoped to the current user. |
Successful response¶
Returns HTTP 200 with call counts, token usage, and cost totals matching the filters.
{
"total_calls": 2,
"total_input_tokens": 12,
"total_output_tokens": 8,
"cache_read_tokens": 0,
"cache_creation_tokens": 0,
"total_cost": "0.0001",
"total_channel_cost": "0.00005",
"total_channel_tokens": 20,
"success_calls": 2,
"failed_calls": 0,
"success_rate": 1,
"active_users": 1
}
Field |
Type |
Description |
|---|---|---|
|
integer |
Total call count. |
|
integer |
Total input tokens. |
|
integer |
Total output tokens. |
|
integer |
Total cache-read tokens. |
|
integer |
Total cache-creation tokens. |
|
string |
Total call cost as a decimal string. |
|
string |
Total cost of associated upstream requests. |
|
integer |
Input, output, and cache tokens across associated upstream requests. |
|
integer |
Successful call count. |
|
integer |
Non-successful call count. |
|
number |
Successful calls divided by total calls; 0 when there are no calls. |
|
integer |
Number of users with matching calls. |
Error response¶
{
"code": 400,
"message": "credential_type and credential_id must be provided together"
}
Field |
Type |
Description |
|---|---|---|
|
integer |
HTTP error status. |
|
string |
Error description. |