Skip to main content
POST
Create a meter

Authorizations

Authorization
string
header
required

Your account's secret key: Authorization: Bearer sk_test_… or sk_live_…. Server-side only.

Headers

Idempotency-Key
string

A unique key per operation (a UUID works). Retrying with the same key returns the original response.

Path Parameters

productID
string<uuid>
required

Product ID.

Body

application/json
name
string
required

The key you will send in track() (for example, tokens). Cannot be changed later.

displayName
string
required

Name shown on invoices and in the dashboard.

unit
enum<string>
required

token, request or unit.

Available options:
token,
request,
unit
aggregation
enum<string>

sum (default), count, unique_count, max or last.

Available options:
sum,
count,
unique_count,
max,
last
valueProperty
string | null

Event field carrying the numeric value. Required unless aggregation: "count".

Response

Meter created.

A meter: defines how usage events add up to a billable quantity.

id
string<uuid>
productId
string<uuid>
name
string

The key you send in track(). Cannot change after creation.

displayName
string

Name shown on invoices and in the dashboard.

unit
enum<string>

token, request or unit.

Available options:
token,
request,
unit
aggregation
enum<string>

How events aggregate: sum, count, unique_count, max or last.

Available options:
sum,
count,
unique_count,
max,
last
valueProperty
string | null

Event field carrying the numeric value. Unused with count.

status
string