Skip to main content
Metered entitlements require Standard Billing (billingVersion: 1). See Billing Versions for details on the two billing models.
Metered entitlements give customers a credit grant when they subscribe. As they consume resources—API calls, compute minutes, storage operations—usage events deplete the grant. At any point, you can query the balance to see how many credits remain and whether the customer still has access. Unlike static entitlements (which grant a fixed configuration value), metered entitlements track real-time consumption against a replenishing credit pool.

How it works

  1. Create a metered feature with a billable metric that measures consumption
  2. Attach the feature to a plan price with an entitlement template defining the grant amount, reset period, and rollover rules
  3. Customer subscribes → a grant is provisioned automatically for the current period
  4. Your app sends usage events as the customer consumes
  5. Call the balance endpoint to check remaining credits and gate access in real time

Setup

Creating a metered feature

Linking to a price (entitlement template)

When creating or updating a price, include an entitlementTemplate to configure how grants are provisioned for subscribers:
cURL
Setting unitPrice: "0" grants customers access without charging for individual events. This is the typical setup when you want to use metered entitlements for quota enforcement rather than per-event billing.

Linking the price to a plan

cURL

Entitlement template reference

Checking the balance

Use GET /v1/entitlements/{entitlementId} to get a real-time snapshot. For metered entitlements, the response includes live balance and usage data inline.
Response example:
Response fields:

Gating access

Check the balance before allowing an operation, then send the usage event regardless:
The grant engine does not block usage events in real time. Always check hasAccess before allowing an operation—do not rely on the event pipeline to enforce limits.

Soft vs. hard limits

Grant lifecycle examples

These examples show how grants behave across billing periods under different configurations.

Example 1 — monthly grant, use-it-or-lose-it

Example 2 — monthly grant with rollover cap

The rollover is applied before the new grant, so the customer starts the period with rollover + issueAfterReset.

Example 3 — daily grants on a monthly subscription

A customer’s subscription renews monthly, but their grant resets daily. Each day they receive a fresh allocation.

Example 4 — soft limit with overage carry-forward

The preserveOverageAtReset flag ensures customers who overconsume one period have a reduced allowance the next period.

Example 5 — minimum rollover floor

When both min and max rollover are set to the same value, customers always carry forward exactly that amount regardless of actual usage:

Rollover and overage reference

At each period reset, the carried-over balance is computed as:
When preserveOverageAtReset is true, any overage accumulated in the previous period is subtracted from the new period’s starting balance after rollover and the new grant are applied.

Next steps