Meters

Get meter

Get a meter by ID or slug.

get/api/v1/meters/{meterIdOrSlug}

Path parameters

meterIdOrSlugstring required

Response

The request has succeeded.

aggregation'SUM' | 'COUNT' | 'UNIQUE_COUNT' | 'AVG' | 'MIN' | 'MAX' | 'LATEST' required

The aggregation type to use for the meter.

annotationsAnnotations

Set of key-value pairs managed by the system. Cannot be modified by user.

createdAtstring date-time required

Timestamp of when the resource was created.

deletedAtstring date-time

Timestamp of when the resource was permanently deleted.

descriptionstring

Optional description of the resource. Maximum 1024 characters.

eventFromstring date-time

The date since the meter should include events. Useful to skip old events. If not specified, all historical events are included.

eventTypestring required

The event type to aggregate.

groupByobject

Named JSONPath expressions to extract the group by values from the event data.

Keys must be unique and consist only alphanumeric and underscore characters.

idstring required

A unique identifier for the resource.

metadataMetadata

Set of key-value pairs. Metadata can be used to store additional information about a resource.

namestring

Human-readable name for the resource. Between 1 and 256 characters. Defaults to the slug if not specified.

slugstring required

A unique, human-readable identifier for the meter. Must consist only alphanumeric and underscore characters.

updatedAtstring date-time required

Timestamp of when the resource was last updated.

valuePropertystring

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 valueProperty is ignored.

Example response

{
  "aggregation": "SUM",
  "createdAt": "2024-01-01T01:01:01.001Z",
  "description": "AI Token Usage",
  "eventType": "prompt",
  "groupBy": {
    "model": "$.model",
    "type": "$.type"
  },
  "id": "01G65Z755AFWAKHE12NY0CQ9FH",
  "name": "Tokens Total",
  "slug": "tokens_total",
  "updatedAt": "2024-01-01T01:01:01.001Z",
  "valueProperty": "$.tokens"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.