Meters
Preview an unsaved meter definition
Changed onDry-run a candidate meter definition against your real usage over the last 7 whole UTC days (today included, future-dated events excluded) WITHOUT creating anything: matched events, aggregated units, distinct customers, and a zero-filled per-day series, oldest first. Useful for checking a definition before committing to it. The scan is capped defensively and runs newest-first, so a very high-volume store gets the most recent slice of the window rather than an unbounded scan — the recent days stay complete and the oldest day of the series degrades.
post/v1/meters/preview
Request
- Base URLhttps://api.creem.io
- AuthAPI key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"event_name": "image.generated",
"aggregation": "count",
"aggregation_property": "tokens",
"filter": {
"conjunction": "and",
"clauses": [
{
"property": "tier",
"operator": "equals"
}
]
},
"unit_label": "images"
}Response
Preview of the candidate definition
Example response
{
"matched_events": 137,
"units": "4820",
"distinct_customers": 12,
"daily": [
{
"date": "2026-08-16",
"event_count": 42,
"value": "1280"
}
]
}Changes
- info
endpoint added
- info