---
title: "Get usage by meter"
method: POST
path: "/events/usage/meter"
tags: ["Events"]
---

# Get usage by meter

`POST /events/usage/meter`

Use when showing usage for a specific meter (e.g. dashboard or overage check). Supports time range, filters, and grouping by customer or subscription.

## Request body

- GetUsageByMeterRequest
  - `billing_anchor` string, date-time — BillingAnchor enables custom monthly billing periods for meter usage aggregation. Usage guidelines: - Only effective when WindowSize = "MONTH" - For other window sizes (DAY, HOUR, WEEK), this field is ignored - When nil, uses standard calendar months (1st to 1st) - When provided, creates custom monthly periods (e.g., 5th to 5th) Common use cases: - Subscription billing periods that don't align with calendar months - Customer-specific billing cycles (e.g., signed up on 15th) - Multi-tenant systems with different billing anchor dates Example: If BillingAnchor = "2024-03-05T14:30:45Z" and WindowSize = "MONTH": - March period: 2024-03-05 14:30:45 to 2024-04-05 14:30:45 - April period: 2024-04-05 14:30:45 to 2024-05-05 14:30:45
  - `bucket_size` 'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH'
  - `customer_id` string
  - `end_time` string, date-time
  - `external_customer_id` string
  - `filters` object
  - `meter_id` string, required
  - `start_time` string, date-time
  - `timezone` string
  - `window_size` 'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH'

## Response `200`

OK

- GetUsageResponse
  - `event_name` string
  - `results` UsageResult[]
    - `value` number
    - `window_size` string
  - `type` 'COUNT' | 'SUM' | 'AVG' | 'COUNT_UNIQUE' | 'LATEST' | 'SUM_WITH_MULTIPLIER' | 'MAX' | 'WEIGHTED_SUM'
  - `value` number

## Other responses

- `400` — Invalid request
- `404` — Resource not found
- `500` — Server error

---

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