List rated usage records¶
List an account’s rated usage records, applied prices, and net charges.
GET https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/usage-records
Before you begin¶
Prepare a valid personal access token for the account owner.
Call List current accounts to obtain the target account’s ID.
Request example¶
Replace $MOI_PERSONAL_ACCESS_TOKEN and $ACCOUNT_ID in the example with your personal access token and the selected account’s ID.
curl -X GET \
"https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/usage-records?page_size=2" \
-H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"
Path parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target account ID from |
Query parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Inclusive start by record creation time; accepts RFC 3339, |
|
string |
No |
Exclusive end by record creation time. A date-only value expands to midnight after that date. |
|
string |
No |
IANA time zone for date-only values; defaults to UTC. |
|
string |
No |
Filter by posting period in |
|
string |
No |
Filter by meter code. |
|
string |
No |
Filter by billing item code; when combined with |
|
string |
No |
Filter by the workspace of the usage event. |
|
string |
No |
Filter by usage record status; use charged for charged records. Omitted means no status filter. |
|
string |
No |
Filter by account owner type. |
|
string |
No |
Filter by account owner ID. |
|
string |
No |
Case-insensitive search over rated record ID, usage event ID, meter code, or event key. |
|
string |
No |
Alias for q, used only when q is empty. |
|
integer |
No |
Page size, 1–100; omitted, nonpositive, or greater than 100 uses 50. |
|
string |
No |
Next-page token. Omit for the first request; then use |
Successful response¶
Returns HTTP 200 with the rated usage records matching the filters.
{
"items": [
{
"rated_usage_record_id": "rated_record_example",
"usage_event_id": "usage_event_example",
"billing_account_id": "billing_account_example",
"billing_account_owner_id": "owner_example",
"billing_account_display_name": "Example account",
"meter_code": "meter_example",
"billing_item_code": "meter_example",
"billing_item_display_name": "Example usage",
"unit": "token",
"price_item_id": "price_example",
"price_dimension_key": "dimension_example",
"price_snapshot_json": "{}",
"quantity": "1000",
"unit_price_credit": "0.001000000000",
"gross_credit": "1.000000000000",
"discount_credit": "0.100000000000",
"net_credit": "0.900000000000",
"period": "2026-09",
"source_period": "2026-09",
"posting_period": "2026-09",
"status": "charged",
"source_request_ids": [
"request_example"
],
"source_request_count": 1,
"source_period_start": "2026-09-01T00:00:00Z",
"source_period_end": "2026-09-01T00:10:00Z",
"created_at": 1788739200
}
],
"total": 1,
"next_page_token": ""
}
Field |
Type |
Description |
|---|---|---|
|
array of object |
Records returned by this request. |
|
string |
Rated usage record ID. |
|
string |
Source usage event ID. |
|
string |
Billing account ID. |
|
string |
Account owner ID; may be omitted. |
|
string |
Account display name; may be omitted. |
|
string |
Associated Credit reservation ID, when available. |
|
string |
Meter code. |
|
string |
Billing item code. |
|
string |
Billing item display name. |
|
string |
Usage unit. |
|
string |
Applied price item ID; may be omitted. |
|
string |
Price dimension key; may be omitted. |
|
string |
Price snapshot used for rating, encoded as a JSON string; may be omitted. |
|
string |
Usage quantity in the billing item’s unit. |
|
string |
Credit price per usage unit. |
|
string |
Gross charge in Credit. |
|
string |
Discount in Credit. |
|
string |
Net charge in Credit. |
|
string |
Usage period in |
|
string |
Source usage period. |
|
string |
Posting period. |
|
string |
Rated usage record status. |
|
array of string |
Source request IDs; may be omitted. |
|
integer |
Source request count; may be omitted. |
|
string |
Source usage interval start; may be omitted. |
|
string |
Source usage interval end; may be omitted. |
|
integer |
Creation time in Unix seconds. |
|
integer |
Total records matching the filters. |
|
string |
Next-page token; an empty string marks the last page. |
In field paths, [] denotes each array item. For example, items[].rated_usage_record_id refers to the corresponding field in each item.
For the next page, set $NEXT_PAGE_TOKEN to next_page_token from the preceding response and retain the same filters. Stop when the token is empty.
curl -X GET \
"https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/usage-records?page_size=2&page_token=$NEXT_PAGE_TOKEN" \
-H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"
Error response¶
Missing authentication returns HTTP 401; provide a valid personal access token.
{
"code": "unauthenticated",
"message": "missing bearer token",
"error": "missing bearer token"
}
Field |
Type |
Description |
|---|---|---|
|
string |
Error code. |
|
string |
Error message. |
|
string |
Compatibility error message, with the same content as message. |
Select a posting period¶
Select a rated usage record and retain its billing_account_id and posting_period. Use these values to list monthly bill usage line items.