Get request log details¶
Get one model call’s result, body previews, and body archive references.
GET https://billing.moi.matrixorigin.cn/api/v1/taas/usage-logs/{id}
Before you begin¶
Prepare a personal access token. For creation and management, see Manage personal access tokens.
Select a call from List request logs.
Results are scoped to data accessible to the current user.
Request example¶
Replace $MOI_PERSONAL_ACCESS_TOKEN and $USAGE_LOG_ID with your personal access token and the selected request log’s ID.
curl --get "https://billing.moi.matrixorigin.cn/api/v1/taas/usage-logs/$USAGE_LOG_ID" \
-H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"
Path parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The selected request log’s ID, from |
Successful response¶
Returns HTTP 200 with the selected request log’s details and body archive references.
{
"id": "usage_example",
"user_id": "user_example",
"model_id": "model_example",
"model_name": "example-chat-model",
"requested_model": "example-chat-model",
"called_at": 1788710400,
"input_tokens": 12,
"output_tokens": 8,
"cache_read_tokens": 0,
"cache_creation_tokens": 0,
"cost": "0.0001",
"status": "success",
"latency_ms": 120,
"request_body_ref_id": "body_request_example",
"response_body_ref_id": "body_response_example",
"request_body_sha256": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"response_body_sha256": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"request_body_bytes": 2,
"response_body_bytes": 2,
"created_at": 1788710400,
"credential": {
"type": "personal_access_token",
"id": "credential_example"
},
"request_body": "{}",
"response_body": "{}",
"body_refs": [
{
"id": "body_request_example",
"usage_log_id": "usage_example",
"scope": "user_request",
"preview_body": "{}",
"full_sha256": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"status": "complete",
"preview_bytes": 2,
"full_bytes": 2,
"created_at": 1788710400,
"completed_at": 1788710401
}
]
}
Field |
Type |
Description |
|---|---|---|
|
string |
Usage log ID. |
|
string |
TaaS local key ID, for calls using that credential type. |
|
string |
TaaS local key name. |
|
string |
Calling user ID. |
|
string |
Calling user name, when available. |
|
string |
Catalog model object ID. |
|
string |
Actual model name. |
|
string |
Model name submitted in the request. |
|
string |
Caller IP. |
|
integer |
Call time, Unix seconds. |
|
integer |
Input tokens. |
|
integer |
Output tokens. |
|
integer |
Cache-read tokens. |
|
integer |
Cache-creation tokens. |
|
string |
Call cost as a decimal string. |
|
string |
Call result status. |
|
string |
Call error category, when present. |
|
string |
Call error description, when present. |
|
integer |
Call |
|
string |
Archive reference ID for the request body. Returned when populated. |
|
string |
Archive reference ID for the response body. Returned when populated. |
|
string |
SHA-256 of the full request body. Returned when populated. |
|
string |
SHA-256 of the full response body. Returned when populated. |
|
string |
Request tracing ID. Returned when populated. |
|
string |
Key-hash prefix. Returned when populated. |
|
string |
Billing meter code. Returned when populated. |
|
string |
Call pricing mode. Returned when populated. |
|
string |
Enterprise plan ID. Returned when populated. |
|
string |
Enterprise plan name. Returned when populated. |
|
string |
Enterprise contract number. Returned when populated. |
|
string |
Enterprise plan model ID. Returned when populated. |
|
string |
Serialized pricing snapshot. Returned when populated. |
|
string |
Settlement method. Returned when populated. |
|
string |
Usage reporting status. Returned when populated. |
|
string |
Usage reporting group ID. Returned when populated. |
|
string |
Idempotency key for the billing usage event. Returned when populated. |
|
string |
Billing usage-event ID. Returned when populated. |
|
string |
Billing record ID. Returned when populated. |
|
string |
Billing account ID. Returned when populated. |
|
string |
Credit amount rated for this call. Returned when populated. |
|
string |
Credit balance recorded from the reporting result. Returned when populated. |
|
string |
Available credit recorded from the reporting result. Returned when populated. |
|
string |
Latest billing usage-reporting error. Returned when populated. |
|
integer |
Full request body size in bytes. |
|
integer |
Full response body size in bytes. |
|
integer |
Billing reporting time, Unix seconds, when present. |
|
integer |
Billing reporting attempts. |
|
integer |
Log creation time, Unix seconds. |
|
object |
Credential identity for this call, when recorded. |
|
string |
Credential type: |
|
string |
Credential object ID. |
|
string |
Service account ID; returned for service-account credentials. |
|
string |
Request body preview; may be truncated. |
|
string |
Response body preview; may be truncated. |
|
array of object |
Associated body archive references. |
|
string |
Body archive reference ID. |
|
string |
Owning usage log ID. |
|
string |
Associated upstream request log ID. |
|
string |
Owning user ID. |
|
string |
Associated TaaS local key ID. |
|
string |
Request tracing ID. |
|
string |
Body object ID. |
|
string |
Request or response stage for the body. |
|
string |
Body media type, when present. |
|
string |
Body preview. |
|
string |
SHA-256 of the complete body. |
|
string |
Archive status. |
|
string |
Archive error, when present. |
|
boolean |
Legacy archive marker, when present. |
|
integer |
Preview size in bytes. |
|
integer |
Full body size in bytes. |
|
integer |
Archive creation time, Unix seconds. |
|
integer |
Archive completion time, Unix seconds, when complete. |
In field paths, [] denotes each array item.
Next steps¶
Use the log’s id to List upstream request attempts. To retrieve a complete body, use a body reference from the same log to Download a request or response body.