Meters
Meters specify how to aggregate events for billing and analytics purposes. Meters can be configured with multiple aggregation methods and groupings. Multiple meters can be created for the same event type, enabling flexible metering scenarios.
Create meter
Create a meter.
Body
application/json
Body
CreateMeterRequest
Meter create request.
Display name of the resource.
Between 1 and 256 characters.
>= 1 characters<= 256 characters
Optional description of the resource.
Maximum 1024 characters.
<= 1024 characters
Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
Keys must be of length 1-63 characters, and cannot start with “kong”, “konnect”, “mesh”, “kic”, or “_”.
Example:{"env":"test"}
A key is a unique string that is used to identify a resource.
Match pattern:^[a-z0-9]+(?:_[a-z0-9]+)*$
>= 1 characters<= 64 characters
Example:resource_key
The aggregation type to use for the meter.
Allowed values:sumcountunique_countavgminmaxlatest
The event type to include in the aggregation.
>= 1 characters
Example:prompt
The date since the meter should include events.
Useful to skip old events.
If not specified, all historical events are included.
Example:2023-01-01T01:01:01.001Z
JSONPath expression to extract the value from the ingested event’s data property.
The ingested value for sum, avg, min, and max aggregations is a number or a string that can be parsed to a number.
For unique_count aggregation, the ingested value must be a string. For count aggregation the value_property is ignored.
>= 1 characters
Example:$.tokens
Named JSONPath expressions to extract the group by values from the event data.
Keys must be unique and consist only alphanumeric and underscore characters.
Example:{"type":"$.type"}
Response
application/json
Response
Meter created response.
Meter
A meter is a configuration that defines how to match and aggregate events.
ULID (Universally Unique Lexicographically Sortable Identifier).
Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$
Example:01G65Z755AFWAKHE12NY0CQ9FH
Display name of the resource.
Between 1 and 256 characters.
>= 1 characters<= 256 characters
Optional description of the resource.
Maximum 1024 characters.
<= 1024 characters
Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
Keys must be of length 1-63 characters, and cannot start with “kong”, “konnect”, “mesh”, “kic”, or “_”.
Example:{"env":"test"}
An ISO-8601 timestamp representation of entity creation date.
Example:2023-01-01T01:01:01.001Z
An ISO-8601 timestamp representation of entity last update date.
Example:2023-01-01T01:01:01.001Z
An ISO-8601 timestamp representation of entity deletion date.
Example:2023-01-01T01:01:01.001Z
A key is a unique string that is used to identify a resource.
Match pattern:^[a-z0-9]+(?:_[a-z0-9]+)*$
>= 1 characters<= 64 characters
Example:resource_key
The aggregation type to use for the meter.
Allowed values:sumcountunique_countavgminmaxlatest
The event type to include in the aggregation.
>= 1 characters
Example:prompt
The date since the meter should include events.
Useful to skip old events.
If not specified, all historical events are included.
Example:2023-01-01T01:01:01.001Z
JSONPath expression to extract the value from the ingested event’s data property.
The ingested value for sum, avg, min, and max aggregations is a number or a string that can be parsed to a number.
For unique_count aggregation, the ingested value must be a string. For count aggregation the value_property is ignored.
>= 1 characters
Example:$.tokens
Named JSONPath expressions to extract the group by values from the event data.
Keys must be unique and consist only alphanumeric and underscore characters.
Example:{"type":"$.type"}
Authentication
Body
List meters
List meters.
Query Parameters
Determines which page of the collection to retrieve.
Show Child Parameters
Response
application/json
Response
Page paginated response.
MeterPagePaginatedResponse
Page paginated response.
A meter is a configuration that defines how to match and aggregate events.
Example:{"id":"01G65Z755AFWAKHE12NY0CQ9FH","key":"tokens_total","name":"Tokens Total","description":"AI Token Usage","aggregation":"sum","event_type":"prompt","value_property":"$.tokens","dimensions":{"model":"$.model","type":"$.type"},"created_at":"2024-01-01T01:01:01.001Z","updated_at":"2024-01-01T01:01:01.001Z"}
Show Child Parameters
returns the pagination information
Show Child Parameters
Authentication
Query Parameters
Get meter
Get a meter by ID.
Path Parameters
ULID (Universally Unique Lexicographically Sortable Identifier).
Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$
Example:01G65Z755AFWAKHE12NY0CQ9FH
Response
application/json
Response
Meter response.
Meter
A meter is a configuration that defines how to match and aggregate events.
ULID (Universally Unique Lexicographically Sortable Identifier).
Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$
Example:01G65Z755AFWAKHE12NY0CQ9FH
Display name of the resource.
Between 1 and 256 characters.
>= 1 characters<= 256 characters
Optional description of the resource.
Maximum 1024 characters.
<= 1024 characters
Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
Keys must be of length 1-63 characters, and cannot start with “kong”, “konnect”, “mesh”, “kic”, or “_”.
Example:{"env":"test"}
An ISO-8601 timestamp representation of entity creation date.
Example:2023-01-01T01:01:01.001Z
An ISO-8601 timestamp representation of entity last update date.
Example:2023-01-01T01:01:01.001Z
An ISO-8601 timestamp representation of entity deletion date.
Example:2023-01-01T01:01:01.001Z
A key is a unique string that is used to identify a resource.
Match pattern:^[a-z0-9]+(?:_[a-z0-9]+)*$
>= 1 characters<= 64 characters
Example:resource_key
The aggregation type to use for the meter.
Allowed values:sumcountunique_countavgminmaxlatest
The event type to include in the aggregation.
>= 1 characters
Example:prompt
The date since the meter should include events.
Useful to skip old events.
If not specified, all historical events are included.
Example:2023-01-01T01:01:01.001Z
JSONPath expression to extract the value from the ingested event’s data property.
The ingested value for sum, avg, min, and max aggregations is a number or a string that can be parsed to a number.
For unique_count aggregation, the ingested value must be a string. For count aggregation the value_property is ignored.
>= 1 characters
Example:$.tokens
Named JSONPath expressions to extract the group by values from the event data.
Keys must be unique and consist only alphanumeric and underscore characters.
Example:{"type":"$.type"}
Authentication
Path Parameters
Delete meter
Delete a meter.
Path Parameters
ULID (Universally Unique Lexicographically Sortable Identifier).
Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$
Example:01G65Z755AFWAKHE12NY0CQ9FH
Response
Response
Deleted response.