---
title: "Query meter usage"
method: POST
path: "/meter-usage/query"
tags: ["MeterUsage"]
---

# Query meter usage

`POST /meter-usage/query`

Query aggregated usage from meter_usage table for a single meter with optional time-window bucketing

## Request body

- MeterUsageQueryRequest
  - `aggregation_type` 'COUNT' | 'SUM' | 'AVG' | 'COUNT_UNIQUE' | 'LATEST' | 'SUM_WITH_MULTIPLIER' | 'MAX' | 'WEIGHTED_SUM', required
  - `billing_anchor` string, date-time
  - `end_time` string, date-time, required
  - `external_customer_id` string, required
  - `meter_id` string, required
  - `start_time` string, date-time, required
  - `window_size` 'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'MONTH'

## Response `200`

OK

- MeterUsageQueryResponse
  - `aggregation_type` 'COUNT' | 'SUM' | 'AVG' | 'COUNT_UNIQUE' | 'LATEST' | 'SUM_WITH_MULTIPLIER' | 'MAX' | 'WEIGHTED_SUM'
  - `event_count` integer
  - `meter_id` string
  - `points` MeterUsagePoint[]
    - `event_count` integer
    - `timestamp` string
    - `value` string
  - `total_value` string

## Other responses

- `400` — Invalid request
- `500` — Server error

## Changes

- **2026-04-11** `c63b5f36b99e` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/flexprice/apis/flexprice-api/changes/meter-usage/query/post.md)

---

[API](https://skmtc.dev/flexprice/apis/flexprice-api.md) · [All operations](https://skmtc.dev/flexprice/apis/flexprice-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/flexprice/flexprice-api/revisions/5cfd03c5fc75/schema)
