Skip to content
Hardcount
Run it locally
Pre-1.0 · one maintainer · Stripe and cards only · no SDKs (client libraries) yet · no production users yet. Docs describe v0.9.1 (29 Oct 2026) · What’s new →

Create meter

POST
/v1/meters
curl --request POST \
--url http://localhost:8080/v1/meters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "event_name": "example", "name": "example", "unit": "unit", "aggregation": "sum" }'
Idempotency-Key
string

Makes the call safe to retry. Send a unique value (a UUID works) and the same value on every retry. For 24 hours, a repeat with the same key, method, path and body gets the first response again, with an Idempotent-Replayed: true header, instead of running again. The error cases are in docs/api-surface.md. The usage routes do not take it: each usage event carries its own idempotency_key.

Media typeapplication/json
object
event_name
required

The event_name usage events will send for this meter. Letters, digits, - and _; at most 100 characters.

string
name
required
string
unit
string
default: unit
aggregation

How the meter rolls its events into one quantity per billing period. Fixed once the meter has a usage event.

string
default: sum
Allowed values: sum count max last

Meter created

Media typeapplication/json
object
id
required
string
tenant_id
string
event_name
required

The event_name usage events send for this meter.

string
name
required
string
unit
required
string
aggregation
required

How the meter rolls its events into one quantity per billing period. Every price of the meter bills under it. last is the latest event by timestamp, then by id. Fixed once the meter has a usage event (see has_usage).

string
Allowed values: sum count max last
has_usage

Whether the meter has usage events. Once it has, its aggregation cannot change. Held usage for its event_name does not count until it is released. Returned when you create, get or update one meter; the meter list leaves it out. A create or update that succeeded leaves it out if it could not be read.

boolean
created_at
required
string format: date-time
updated_at
required
string format: date-time

Example

{
"aggregation": "sum"
}