---
title: "Create a meter"
method: POST
path: "/v1/meters"
tags: ["Meters"]
---

# Create a meter

`POST /v1/meters`

## Request

- Base URL: `https://api.creem.io`
- URL: `https://api.creem.io/v1/meters`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/creem/apis/creem-api/docs/v1/meters/post.ts> (a function with typed inputs; its response is checked against the schema)

Define how a stream of usage events is aggregated into billable units. The unit label doubles as the display unit and as the credit bucket the meter settles into. A duplicate name within the store is rejected with 409 meter_name_taken.

## Request body

- CreateMeterApiRequestDto
  - `name` string, required: Human-readable meter name, unique within your store
  - `event_name` string, required: The usage event name this meter consumes
  - `aggregation` 'count' | 'sum' | 'average' | 'min' | 'max' | 'unique', required: Aggregation applied to the matching events
  - `aggregation_property` string: Event property the aggregation reduces. Required for every aggregation except "count", which ignores it.
  - `filter` MeterFilterApiRequestDto
    - `conjunction` 'and' | 'or', required: How the clauses combine
    - `clauses` FilterClauseApiRequestDto[], required: Filter clauses. An empty list means the meter counts every event with the given event name.
      - `property` string, required: Event property to test — a key of the event's `properties` bag, unprefixed.
      - `operator` 'equals' | 'not_equals' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'not_contains', required: Comparison operator
      - `value` union, required: Value to compare against. Auto-parsed (number → boolean → string) on both sides before comparison, so "10" and 10 behave the same — which is why a raw number or boolean is accepted here as well as a string.
        - string
        - number
        - boolean
  - `unit_label` string, required: Display unit for the metered quantity. Also names the customer-credits bucket the meter settles into.

## Response `201`

Meter created

- MeterApiResponseDto
  - `id` string, required: Meter ID
  - `store_id` string, required: Store ID
  - `name` string, required: Meter name
  - `event_name` string, required: Usage event name the meter consumes
  - `aggregation` 'count' | 'sum' | 'average' | 'min' | 'max' | 'unique', required: Aggregation applied to matching events
  - `aggregation_property` string, nullable, required: Property the aggregation reduces; null for "count"
  - `filter` MeterFilterApiResponseDto, required
    - `conjunction` 'and' | 'or', required: How the clauses combine
    - `clauses` FilterClauseApiResponseDto[], required: Filter clauses; empty means the meter counts every event
      - `property` string, required: Event property tested
      - `operator` string, required: Comparison operator
      - `value` union, required: Value compared against, as stored after parsing
        - string
        - number
        - boolean
  - `unit_label` string, required: Display unit
  - `status` 'active' | 'archived', required: Whether the meter is active or archived
  - `created_at` string, required: Creation timestamp (ISO 8601)
  - `updated_at` string, required: Last update timestamp (ISO 8601)

## Other responses

- `400`: Bad Request - Invalid input parameters
- `401`: Unauthorized - Invalid or missing API key
- `404`: Not Found - Resource does not exist
- `409`: A meter with this name already exists in the store
- `422`: The meter definition is not satisfiable

## Changes

- **2026-09-15** `071301350724`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/creem/apis/creem-api/changes/v1/meters/post.md)

---

[API](https://skmtc.dev/creem/apis/creem-api.md) - [All operations](https://skmtc.dev/creem/apis/creem-api/llms.txt) - [OpenAPI document](https://skmtc.dev/creem/apis/creem-api/revisions/3f39a8f266c3?raw)
