---
title: "Calculate usage metric for customer and timeframe"
method: GET
path: "/usage-metrics/{usageMetricId}/calculate"
tags: ["Usage Metrics"]
---

# Calculate usage metric for customer and timeframe

`GET /usage-metrics/{usageMetricId}/calculate`

Calculate usage metric for customer and timeframe

## Path parameters

- `usageMetricId` string, required

## Query parameters

- `customerAliases` string, required
- `periodStart` string, required
- `periodEnd` string, required
- `customParameters` string

## Headers

- `Authorization` string, required
- `Sequence-Version` '2024-07-30'

## Response `200`

OK

- UsageMetricCalculationResponse
  - `name` string, required
  - `metricType` 'SIMPLE' | 'GROUPED', required
  - `eventType` string, required
  - `aggregationType` 'COUNT' | 'UNIQUE' | 'SUM' | 'CUSTOM', required
  - `eventCount` integer, required
  - `value` number, required
  - `unit` string, nullable
  - `minEventId` string, nullable
  - `maxEventId` string, nullable

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.net/sequencehq/apis/sequence.md) · [All operations](https://skmtc.net/sequencehq/apis/sequence/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sequencehq/sequence/versions/cae64b02699f/schema)
