Querying
Monthly usage by metric
get/v2/metrics/usage/monthly
Request
- Base URLhttps://docs.ledgerup.ai (the document declares no server; this is the origin it was published from)
- AuthAPI key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
start_atinteger required
Unix timestamp in seconds.
Example:1767225600
Inclusive lower bound for event occurrence time.
end_atinteger required
Unix timestamp in seconds.
Example:1767225600
Exclusive upper bound for event occurrence time.
aggregation'sum' | 'min' | 'max' | 'avg' | 'latest' | 'count'
Aggregation applied to corrected usage events. latest returns the quantity from the event with the latest occurred_at; ties use accepted_at then event ID. count returns the number of events.
Example:sum
currencystring
Example:usd
Aggregate only events for this currency. Normalized to lowercase.
Response
Namespace usage grouped by UTC calendar month and metric or currency.
Example response
{
"aggregation": "sum",
"data": [
{
"period_start_at": 1767225600,
"data": [
{
"metric_id": "metric_0194f4e3a2b77c6aa91c4f6b4db2a980",
"currency": "usd",
"quantity": "1250.5"
}
]
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.