69a962f1578f
Usage Billing Usage Summary
Total the caller's settled usage over a window.
/history is a ledger with one row per movement, so a total spanning more than one page cannot come from it. This answers the one question the UI asks of the whole ledger at once: how many runs, and what they cost.
Only settled usage counts. void, expiry and chargeback draw the balance down as well, but they reverse a grant rather than report usage.
Query parameters
Product whose usage to total.
Count one kind of work only, for example automation_run. More than one kind settles against the same balance, so a per-run average over all of them mixes runs with chat messages. Omit to total every category.
Start of the window, inclusive. Omit to start at the account's first event. A value with no offset is read as UTC, which is what created_at in /history reports.
End of the window, exclusive. Omit to run to now. A value with no offset is read as UTC.
Response
Successful Response
Example response
{
"currency": "usd",
"usage_count": 412,
"charged_units": 5643900,
"charged_amount": 11287800
}