Usage event playground
Build a usage event and see exactly what the Usage Lab API would do with it: the validation result, the usage_events row it would write, the HTTP response, and the Stripe meter event it would send.
Runs in your browser; nothing is sent or stored. No signup and no API key. The validation rules are a direct port of the production Worker and are checked against the live API (19/19 cases match). Retries and conflicts are remembered in this tab only, until you reload.
Presets:
Request (equivalent curl)
HTTP response
Press Run.
Ledger row usage_events
Monthly rollup for this customer
Stripe meter event dry-run: not sent
The body Usage Lab builds from the rollup (it pushes the delta since the last export). Stripe export is in dry-run mode, so nothing is sent.
Rules it applies
- One meter per tenant here; the meter is taken from the form.
subscription(orcustomer) is required, up to 200 chars. summeters need a finite numericvalue;countandunique_countdefault it to 1.unique_countneedsunique_value.- Timestamps older than 30 days return
422 event_too_old; more than 5 minutes in the future return422 event_in_future. Leaving it out uses the current time. - Same key + same payload returns
200with"duplicate": true. Same key + different payload returns409 idempotency_conflictand keeps the original.
Ready for real events? Read the API docs or the AI app quickstart, or see the live demo.
Related
- Live end-to-end demo
- API docs
- Quickstart: meter an AI app
- Code examples
- Metering usage for Stripe usage-based billing
- Deduping usage events with idempotency keys
- Usage Lab vs UsageBox: an honest comparison
- Metronome and Orb alternatives for small SaaS teams
- How to meter LLM token usage per customer for billing
- Stripe Billing Meters vs a usage ledger: when you need both