{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "#/components/schemas/CreateMeterRequest", "title": "CreateMeterRequest", "description": "Meter create request.", "type": "object", "properties": { "name": { "description": "Display name of the resource.\n\nBetween 1 and 256 characters.", "type": "string", "maxLength": 256, "minLength": 1 }, "description": { "description": "Optional description of the resource.\n\nMaximum 1024 characters.", "type": "string", "maxLength": 1024 }, "labels": { "$ref": "#/components/schemas/Labels" }, "key": { "$ref": "#/components/schemas/ResourceKey" }, "aggregation": { "description": "The aggregation type to use for the meter.", "type": "string", "enum": [ "sum", "count", "unique_count", "avg", "min", "max", "latest" ], "x-speakeasy-unknown-values": "allow" }, "event_type": { "description": "The event type to include in the aggregation.", "type": "string", "example": "prompt", "minLength": 1 }, "events_from": { "description": "The date since the meter should include events.\nUseful to skip old events.\nIf not specified, all historical events are included.", "type": "string", "format": "date-time", "example": "2023-01-01T01:01:01.001Z", "title": "RFC3339 Date-Time" }, "value_property": { "description": "JSONPath expression to extract the value from the ingested event's data property.\n\nThe ingested value for sum, avg, min, and max aggregations is a number or a string that can be parsed to a number.\n\nFor unique_count aggregation, the ingested value must be a string. For count aggregation the value_property is ignored.", "type": "string", "example": "$.tokens", "minLength": 1 }, "dimensions": { "description": "Named JSONPath expressions to extract the group by values from the event data.\n\nKeys must be unique and consist only alphanumeric and underscore characters.", "type": "object", "example": { "type": "$.type" }, "additionalProperties": { "type": "string" } } }, "required": [ "name", "key", "aggregation", "event_type" ] }