Skip to main content
POST
Preview an unsaved meter definition

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
event_name
string
required

The usage event name the candidate meter would consume

Example:

"image.generated"

aggregation
enum<string>
required

Aggregation to dry-run

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

"count"

aggregation_property
string

Event property the aggregation reduces. Required for every aggregation except "count".

Example:

"tokens"

filter
object

Optional filter to dry-run alongside the aggregation

unit_label
string
default:units

Display unit for the preview. Cosmetic (nothing is persisted); defaults to "units".

Example:

"images"

Response

Preview of the candidate definition

matched_events
number
required

Events the meter would count over the preview window

Example:

137

units
string
required

Aggregated units over the whole window, as a string for BigInt safety

Example:

"4820"

distinct_customers
number
required

Distinct customers among the matching events

Example:

12

daily
object[]
required

The last 7 UTC days (today included), oldest first and zero-filled