A meter defines how raw usage events are aggregated into a billable quantity. Each meter listens for events with a givenDocumentation Index
Fetch the complete documentation index at: https://docs.borga.is/llms.txt
Use this file to discover all available pages before exploring further.
event_name and applies an aggregation function to produce a usage total that Borga uses when generating invoices.
Aggregate types
| Type | Description |
|---|---|
count | Counts the number of matching events. No aggregate_property needed. |
sum | Sums the numeric value of aggregate_property across all matching events. |
max | Returns the maximum value of aggregate_property across all matching events. |
min | Returns the minimum value of aggregate_property across all matching events. |
avg | Returns the average value of aggregate_property across all matching events. |
unique | Counts the number of distinct values of aggregate_property across all matching events. |
Create a meter
POST /v1/meters
Creates a new meter. Once created, the meter begins aggregating events that match its event_name.
Request parameters
Display name for the meter. Maximum 200 characters. Shown in the dashboard.
The name of the usage events this meter aggregates. Must match the
event_name field on ingested events exactly. Maximum 200 characters.The aggregation function to apply. One of
count, sum, max, min, avg, unique.The key in the event
metadata whose value is aggregated. Required for all aggregate_type values except count.An optional filter object. Only events whose
metadata matches all key-value pairs in this object are included in the aggregation.Human-readable label for the unit of measurement (e.g.
"API calls", "GB"). Displayed on invoices. Maximum 100 characters.Multiply the aggregated value by this number before billing. Minimum value is
1. Useful for converting raw event values to billing units (e.g. bytes to gigabytes).Response fields
Unique identifier for the meter (e.g.
mtr_xxx).Display name of the meter.
The event name this meter listens for.
The aggregation function applied to matching events.
The metadata key being aggregated.
null for count meters.Human-readable unit label shown on invoices.
Multiplier applied to the aggregated value before billing.
Whether this meter has been archived. Archived meters no longer aggregate new events.
List meters
GET /v1/meters
Returns a paginated list of meters.
Query parameters
Cursor for pagination. Pass the
id of the last meter from the previous page to retrieve the next page.Maximum number of meters to return per page.
When
true, include archived meters in the results. Defaults to false.Retrieve a meter
GET /v1/meters/{id}
Retrieves the details of an existing meter.
Path parameters
The ID of the meter to retrieve.
Archive a meter
DELETE /v1/meters/{id}
Archives a meter. Archived meters no longer aggregate new events and will not generate billable usage. The meter’s historical data is preserved and still accessible.
Path parameters
The ID of the meter to archive.
Get meter quantities
GET /v1/meters/{id}/quantities
Returns the aggregated usage total for a specific customer and time range.
Path parameters
The ID of the meter to query.
Query parameters
ID of the customer whose usage to retrieve.
Start of the time range to aggregate, as an ISO 8601 timestamp (e.g.
2026-04-01T00:00:00Z).End of the time range to aggregate, as an ISO 8601 timestamp (e.g.
2026-04-30T23:59:59Z).Response fields
ID of the meter.
ID of the customer.
Start of the queried period as an ISO 8601 timestamp.
End of the queried period as an ISO 8601 timestamp.
The aggregated usage value for the customer over the requested period, after applying
unit_multiplier.