Query meter
Query meter for usage.
Path parameters
Query parameters
Client ID Useful to track progress of a query.
Start date-time in RFC 3339 format.
Inclusive.
For example: ?from=2025-01-01T00%3A00%3A00.000Z
End date-time in RFC 3339 format.
Inclusive.
For example: ?to=2025-02-01T00%3A00%3A00.000Z
Aggregation window size.
If not specified, a single usage aggregate will be returned for the entirety of the specified period for each subject and group.
For example: ?windowSize=DAY
The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). If not specified, the UTC timezone will be used.
For example: ?windowTimeZone=UTC
Filtering by multiple subjects.
For example: ?subject=subject-1&subject=subject-2
Filtering by multiple customers.
For example: ?filterCustomerId=customer-1&filterCustomerId=customer-2
Simple filter for group bys with exact match.
For example: ?filterGroupBy[vendor]=openai&filterGroupBy[model]=gpt-4-turbo
⚠️ Deprecated: Use advancedMeterGroupByFilters instead
Optional advanced meter group by filters. You can use this to filter for values of the meter groupBy fields.
If not specified a single aggregate will be returned for each subject and time window. subject is a reserved group by value.
For example: ?groupBy=subject&groupBy=model
Response
The request has succeeded.
Example response
{
"from": "2023-01-01T00:00:00Z",
"to": "2023-01-02T00:00:00Z",
"windowSize": "DAY",
"data": [
{
"value": 12,
"windowStart": "2023-01-01T00:00:00Z",
"windowEnd": "2023-01-02T00:00:00Z",
"subject": "customer-1",
"groupBy": {
"model": "gpt-4-turbo",
"type": "prompt"
}
}
]
}