Know what every account has used, while it is still using it.
API calls per key this minute, seats active this month, billable units last month: Aggrelis keeps each total live per key, workspace and account, in each customer's own time zone. Ask before you serve a request, or be told as an account nears its plan.
watching
watching
watching
The questions this answers
Typical questions, each with the window it usually looks at. Thresholds are starting points you set yourself.
- Warn before the limit
How much of this month's plan has the account used, counted from midnight where the customer is? Warn at 80 %, stop or upsell at 100 %.
calendar month, customer's time zone - Throttle one key
How many calls did this API key make in the last minute, and in the last hour? Slow down the noisy integration, not the whole account.
rolling 1 minute and 1 hour - Count active seats
How many different people used the product this month, against the number of seats the account pays for?
calendar month, distinct users - Bill exact units
How many billable units did each account use last month, per priced item, exact to the decimal you set? The total for the invoice, with nothing rounded away.
previous calendar month, per SKU - Limits at every level
One call counts for the key, its workspace and the company at once, so a limit can sit per key, per workspace or per contract.
key → workspace → company - Track prepaid credit
How many units has the account used since its last top-up? Warn before the credit runs out, not after.
since the last top-up
An account nears its monthly quota
Acme's plan includes 1,000,000 API calls a month, counted from midnight in Acme's own time zone across all its keys. Your gateway asks before serving each call: a single key over its rate is slowed down, and once Acme passes 80 % of its plan the owner gets a warning, well before anything is blocked.
- Send each API call as an event, with the key that made it
- Define the totals once: calls per key, rolled up to the workspace and the account, and the plan quota as an attribute of the account
- Ask the usage question at the gateway while the call waits, or let a trigger ask as usage events arrive
- Act on the answer: slow the key at its rate, warn the owner at 80 %, stop or upsell at 100 %
{
"id": "call_01JC7Q4T9X",
"type": "api_call",
"ts": "2026-11-02T09:41:07Z",
"attrs": {
"key_id": "key_42",
"endpoint": "/v1/search",
"status": 200
}
}{
"name": "usage_check",
"spec": {
"entity": "account",
"context": [
"api_key"
],
"features": {
"keyCallsThisMinute": {
"state": "calls_per_key",
"window": {
"rolling": "1m"
}
},
"callsThisMonth": {
"state": "api_calls",
"window": {
"calendar": "month",
"tz": "subject.timezone",
"defaultTz": "UTC"
}
}
},
"derived": [
{
"name": "quotaUsedPct",
"expr": "double(callsThisMonth) * 100.0 / double(entity.monthlyQuota)"
}
],
"reasons": [
{
"name": "key_rate_limited",
"when": "keyCallsThisMinute >= 600"
},
{
"name": "near_monthly_quota",
"when": "quotaUsedPct >= 80.0"
},
{
"name": "over_monthly_quota",
"when": "quotaUsedPct >= 100.0"
}
]
}
}{
"entity": {
"type": "account",
"id": "acme"
},
"values": {
"keyCallsThisMinute": 37,
"callsThisMonth": 812450,
"quotaUsedPct": 81.245
},
"reasons": [
"near_monthly_quota"
],
"degraded": [],
"skipped": [],
"profileVersion": "usage_check@v4"
}The parts of Aggrelis behind it
Nothing built for one industry: the same building blocks, configured for this job.
- In the customer's time zone
This month starts at midnight where the customer is, from a time zone kept on the account, with a fallback. Last month is a window too.
- Roll-ups to the company
One call counts for the key, its workspace and the account, so every level has its own live total from the same event.
- Exact units
Metered quantities are kept as exact decimals, never through floating point, so the total you bill is the total that was counted.
- Ask before you serve
The gateway asks while the call waits and gets the answer in the same request. A value that could not be computed is reported, never 0.
- Triggers and webhooks
A trigger asks the question as usage events arrive and pushes the answer to your billing or messaging tools, signed and retried.
- Change a plan without a release
Adjust a threshold or add a window in the workspace, try it on real data first, and roll back if needed.
Your first live numbers, configured not coded
Tell us what you would count first, and we'll help you set it up.