Skip to content
Oclavex is in private preview, open to existing MonetizeIt users. New users who would like to evaluate Oclavex before the public launch can request access at info@revenusion.com.

Metering, quotas & credits

Metering is how you count what a customer consumes, enforce limits, and — for usage-based plans — price that consumption against prepaid credit.

Session your app reports what's consumed Monitored asset accumulates usage, counted per period Quota tiers Normal → OverUsage, policy when crossed Credit balance prepaid value, drawn down count → cap → price lifecycle & overage signals → webhooks → your billing provider

A monitored asset is one meter: the name usage is reported under, how it accumulates, and optionally its limits. Everything a product meters lives in the one list on its Monitoring tab.

The asset’s type sets how readings accumulate, stated as what the application reports:

Type The application reports
Incremental (CumulativeCounter) each delta — 10, then 10 again, means 20
Running total (TotalCounter) the cumulative figure — 10, then 20, means 20. Reset-aware
Gauge the current value — 10, then 20, means 20
Up/down (UpDownCounter) signed changes

Getting this wrong is a billing error, not a display one: report running totals against an incremental meter and 10, 20, 30 accumulates as 10, 30, 60, so quota limits are crossed too early. The technical names are counterintuitive, so the portal labels them by what the application reports.

You do not define meters by hand. A Metered feature defines its meter when you save it — named after the feature code, typed from the aggregation you declared on the feature, so the two can never disagree. The meter joins the Monitoring list when you create it from the feature’s Usage tracking column, with no quota and no balance until you add them.

A catalog entry alone is a definition, not something this version offers. The New feature dialog closes that gap in the same click: its Also add to switch, naming the version, is on by default, so the feature is defined and offered at once. Turn it off to define a feature a later version will pick up, and add it from Features when it does.

Features to meters are n:1 — several features may report into one accumulator. To share a meter, choose an existing one when creating the feature; only meters that accumulate the same way are offered, because two features reporting into one accumulator must agree on how it accumulates.

When you create the feature, the metric name is prefilled and editable. Two reasons it is yours to set: a feature code is permanent and may not be a legal metric name, and several features can legitimately meter into one asset. Whatever you save is written onto the feature’s catalog entry at the same moment, so the feature and its asset always agree on the name that joins them — and naming an asset that already exists links this feature to it rather than making a second meter for the same thing. Once a feature has a metric name, changing it belongs on Feature catalog, where the rest of its definition is authored.

Consumption is measured per period (minute / hour / day / week / month / year) against quota tiers. Leave the period empty for an allowance that is spent once and never resets; any other word is rejected, rather than quietly behaving like that.

A plan can set its own period for its quota tiers. When the plan is applied to a customer, the customer’s meter takes the plan’s period. A plan that keeps the product’s period uses the period on the product’s meter, or a month when the feature has no product meter. A shorter period takes effect at once; a longer one waits for the current window to end. You set it per plan in Build plans & add-ons.

Resets decides where each window starts, separately from how long it is:

  • At the calendar boundary (the default) — an hourly window rolls at the top of the next clock hour in UTC. A first report at 10:47 gets thirteen minutes.
  • One period after first use — the window starts at the report that opens it, so an hourly quota gives a full hour from that moment. Each customer’s clock runs on their own first use, which is what “N per hour of use” usually means.

Either way the window is fixed and has one boundary: consuming more inside it does not extend it. Changing this on a live meter moves each customer’s open window to whichever boundary comes first: a tighter setting takes effect straight away, a looser one waits for the current window to end.

Each tier carries a quota level — None, Normal, Warning, Critical, OverUsage — and an enforcement policy for usage in that tier. Only Deny and SuspendUsage refuse a commit. Every other policy lets it through and is reported to your application in the usage status. AllowWithGrace and RateLimit are advisory: the tier holds no grace amount, timer or rate, so what they mean is up to the application.

Policy Kind What happens
None signal Allowed, except in an OverUsage tier, where it acts as Deny
NotifyOnly signal Allowed; the status tells the application to notify the user
AllowWithOverage signal Allowed past the limit; the overage is tracked, and charged to a credit balance when the tier names one
AllowWithGrace advisory Allowed; marks a band the application is expected to honor, for example by warning the user
RateLimit advisory Allowed; the application is expected to slow itself down. The server does not throttle the meter
Deny blocking The commit is refused, status in the response body
SuspendUsage blocking The commit is refused, as with Deny

The tier’s level decides which policy applies:

  • In a None or Normal tier, no policy applies, and the status reports None.
  • In a Warning tier nothing is refused. AllowWithGrace and RateLimit apply as configured; every other policy is reported as NotifyOnly.
  • In a Critical tier, Deny, SuspendUsage, AllowWithGrace and RateLimit apply as configured; None, NotifyOnly and AllowWithOverage are reported as RateLimit.
  • In an OverUsage tier every policy applies as configured, and None acts as Deny.

Only a commit can be refused. Usage your application reports, or uploads after working offline, is recorded whatever the policy, because it has already happened.

The tiers come from the plan in effect for the customer’s entitlement.

Separately from raw counters, a credit balance is a prepaid account — a starting amount in a currency and unit you choose (credits, tokens…), drawn down as usage is consumed. Quota tiers can price that consumption (a base cost plus a per-unit rate), so metered use turns into credits spent — the basis for prepaid and usage-based pricing. Balances allow overage when you permit it, and can be topped up, withdrawn from, or suspended.

An AllowWithOverage tier at the OverUsage level can name the credit balance that funds it, together with what a unit costs there. The server then prices only the units of each call that fall inside the overage tier, and draws that from the balance before the meter moves:

  • A six-second video render at 25 of 30 included seconds is one second of overage, so it costs one credit — and it still runs with three credits in the pool.
  • In a whole-unit tier that starts right after the tier below, such as 1,001–1,500 above 0–1,000, the first unit is priced too: at one credit per image, image 1,001 costs one credit and 500 images past 1,000 cost 500 credits.
  • If the balance cannot cover it, the commit is refused and neither the meter nor the balance moves. The refusal comes back the way every metered refusal does — a Deny status in the response body — with a reason (NoCredit, SpendingDisabled, BalanceExpired, BalanceSuspended) so you can tell “out of credits” from “over the plan limit”, and the price so you can say how much is missing.
  • A commit that goes through reports creditsCharged and fundedUnits, so your app can tell someone “five seconds included, one credit from your balance” without working the arithmetic out itself.

Usage that arrives late is priced the same way. An application that keeps metering while it is offline uploads its readings when it reconnects, and those readings pass through the same tiers and draw on the same balance — what a call costs does not depend on when it arrived. The one thing an upload cannot do is be refused: the work already happened, so the meter moves either way. If the balance covers a reading’s price it is charged; otherwise none of it is, and the whole price stands as overage nobody has paid for yet.

An overage tier that names no balance keeps the plain signal behavior: allowed past the limit, recorded, and left to your app.

Oclavex does the credit accounting — how much value a customer has bought and used — and hands charging to your billing provider (e.g. Stripe), feeding it the usage, overage and lifecycle signals through webhooks so it can issue the invoice or capture the payment. For usage billed per period, the MeteredUsage.PeriodClosed event reports what an asset counted in each finished window, with an identifier your billing system can use to bill a delivered or replayed event once.

With the Stripe connector registered, customers can buy credits from inside your app:

  1. In Stripe, create a one-time Price for each bundle you sell — say 500 credits for $10 — and give it two metadata keys: oclavex_credits (the amount, 500) and oclavex_credit_metric (the balance it lands on, the metric name of the credit balance). Add its lookup key to the connector’s allowed prices.
  2. Your app starts a checkout for that lookup key with the customer’s license session, the same call that sells a plan, and sends the customer to the page it returns.
  3. When Stripe confirms the payment, Oclavex adds the credits to that customer’s balance. A payment that settles later, such as a bank debit, is credited when it settles.

Each purchase is credited exactly once, however often Stripe repeats its notification. A top-up does not need a subscription and does not touch one; a customer on a paid plan buys credits the same way. The amount is fixed by the Price, so a customer picks a bundle rather than typing a number.

The consumer credit-grant call lets a signed-up customer add credits to their own balance without paying. It exists for demos, so it is off: it works only on licenses issued from an offer with consumersMayGrantCredits turned on, and answers 403 on every other license: license.forbidden_by_policy, or license.no_permission for a license made from no offer or a try license. Leave it off wherever you sell credits.

  • Counts → consumption reported by a session.
  • Capped by → the plan’s tiers.
  • Priced into → credits, feeding your billing.