Skip to main content
POST
Create a meter

Authorizations

x-api-key
string
header
required

API key for authentication. You can find your API key in the Creem dashboard under Settings > API Keys.

Body

application/json
name
string
required

Human-readable meter name, unique within your store

Example:

"Image generations"

event_name
string
required

The usage event name this meter consumes

Example:

"image.generated"

aggregation
enum<string>
required

Aggregation applied to the matching events

Available options:
count,
sum,
average,
min,
max,
unique
Example:

"sum"

unit_label
string
required

Display unit for the metered quantity. Also names the customer-credits bucket the meter settles into.

Example:

"images"

aggregation_property
string

Event property the aggregation reduces. Required for every aggregation except "count", which ignores it.

Example:

"tokens"

filter
object

Optional filter narrowing which events the meter counts. Omitted means "count every event with this event name".

Response

Meter created

id
string
required

Meter ID

Example:

"mtr_abc123"

store_id
string
required

Store ID

Example:

"sto_abc123"

name
string
required

Meter name

Example:

"Image generations"

event_name
string
required

Usage event name the meter consumes

Example:

"image.generated"

aggregation
enum<string>
required

Aggregation applied to matching events

Available options:
count,
sum,
average,
min,
max,
unique
Example:

"sum"

aggregation_property
string | null
required

Property the aggregation reduces; null for "count"

Example:

"tokens"

filter
object
required

The meter filter; always present (empty clauses = match all)

unit_label
string
required

Display unit

Example:

"images"

status
enum<string>
required

Whether the meter is active or archived

Available options:
active,
archived
Example:

"active"

created_at
string
required

Creation timestamp (ISO 8601)

updated_at
string
required

Last update timestamp (ISO 8601)