Usage-Based Licensing

Usage-based licensing, also called metered or consumption-based licensing, charges customers for what they consume instead of, or in addition to, how long they hold a license or how many seats they use. Cryptlex implements it with meter attributes, which track and enforce usage counts on each license.

How it works

A meter attribute moves through the same lifecycle on every license:

  1. Define the meter attribute on the license, with its Allowed Uses limit. Require it on every license by adding it to the license template's required meter attributes. Set Allowed Uses to -1 to track usage without enforcing a cap.
  2. Report usage at runtime. Each time the metered action happens in your app, increment the count, by 1 or in bulk, using the meter attribute functions in your SDK. You can also decrement or reset it to match your billing logic.
  3. Aggregate. Each activation's uses roll up into the license's Total Uses, so every machine draws from one shared pool. Gross Uses records the lifetime total.
  4. Enforce. When Total Uses reaches Allowed Uses, further increments fail with a limit-reached error code and the operation can be blocked, while the license itself stays genuine.
  5. Report and reset. Metering is a real-time call to the Cryptlex server, so Total Uses stays current. For offline node-locked and hosted floating scenarios, buffer counts locally and apply them in bulk when the connection returns; on-premise floating licenses meter through LexFloatServer, which works offline. If you bill per cycle, reset Total Uses at the start of each period; Gross Uses keeps climbing.

See Meter Attributes for the exact SDK functions and error codes for each license type.

Common pricing shapes

  • Credits or tokens: sell a bundle of credits or tokens as the license's allowed uses; each operation consumes them, and the customer buys a top-up when they run out.
  • Pay per use with periodic billing: combine meter attributes with a license subscription; read the total uses each billing cycle to invoice the customer, then reset the count. The gross uses property keeps the lifetime total across resets.
  • Fair-use caps: keep a time-based subscription but put usage ceilings on expensive operations.

Next steps

OIDC SSOFeature-Based Licensing
Last updated: