v61

latestOpenAPI 3.1.0Apache 2.0raw.githubusercontent.com2026-08-018131,3812.6 MB
Meters

Query meter

Pre-release Endpoint This endpoint is currently in beta and is subject to change.

Query a meter for usage.

Set Accept: application/json (the default) to get a structured JSON response. Set Accept: text/csv to download the same data as a CSV file suitable for spreadsheets. The CSV columns, in order, are:

from, to, [subject,] [customer_id, customer_key, customer_name,] <dimensions...>, value

The subject column is emitted only when subject is in the query's group_by_dimensions. The three customer_* columns are emitted together only when customer_id is in the query's group_by_dimensions.

post/v3/openmeter/meters/{meterId}/query

Path parameters

meterIdstring required

ULID (Universally Unique Lexicographically Sortable Identifier).

Example:01G65Z755AFWAKHE12NY0CQ9FH

Request body

fromstring date-time

The start of the period the usage is queried from.

tostring date-time

The end of the period the usage is queried to.

granularity'PT1M' | 'PT1H' | 'P1D' | 'P1M'

The size of the time buckets to group the usage into. If not specified, the usage is aggregated over the entire period.

time_zonestring

The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). The time zone is used to determine the start and end of the time buckets. If not specified, the UTC timezone will be used.

group_by_dimensionsstring[]

The dimensions to group the results by.

Example request

{
  "from": "2023-01-01T00:00:00Z",
  "to": "2023-01-02T00:00:00Z",
  "granularity": "P1D",
  "time_zone": "UTC"
}

Response

The request has succeeded.

fromstring date-time

The start of the period the usage is queried from.

tostring date-time

The end of the period the usage is queried to.

Example response

{
  "from": "2023-01-01T00:00:00Z",
  "to": "2023-01-02T00:00:00Z",
  "data": [
    {
      "value": "12.3456",
      "from": "2023-01-01T00:00:00Z",
      "to": "2023-01-02T00:00:00Z",
      "dimensions": {
        "customer_id": "01G65Z755AFWAKHE12NY0CQ9FH",
        "model": "gpt-4-turbo",
        "type": "input"
      }
    }
  ]
}