Usage keys

Overview

Usage keys help group related usage or credit balances together.

They are useful when multiple products, add-ons, or grants can contribute to the same type of usage.

Example

A customer may receive credits from different sources:

  • 100 credits from a subscription

  • 50 credits from a one-off add-on

  • 20 credits from a manual grant

All of these can contribute to the same usage key, such as:

credits

Why usage keys are useful

Usage keys make it easier to show a simple customer balance in your app.

Instead of showing three separate credit sources, you can show:

170 credits available

When to use usage keys

Use usage keys for:

  • credits

  • tokens

  • scans

  • exports

  • messages

  • AI generations

  • any shared customer balance

Example

final credits = Revenipe.instance.getUsageKey('credits');

Best practices

Use one usage key for one customer-facing balance.

Good examples:

credits

tokens

exports

scans

Next steps

Create products and attach entitlements that contribute to usage keys.