Metered entitlements require Standard Billing (
billingVersion: 1). See
Billing Versions for details on the two billing models.How it works
- Create a metered feature with a billable metric that measures consumption
- Attach the feature to a plan price with an entitlement template defining the grant amount, reset period, and rollover rules
- Customer subscribes → a grant is provisioned automatically for the current period
- Your app sends usage events as the customer consumes
- 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 anentitlementTemplate 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
UseGET /v1/entitlements/{entitlementId} to get a real-time snapshot. For metered entitlements, the response includes live balance and usage data inline.
Gating access
Check the balance before allowing an operation, then send the usage event regardless: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
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
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
- Grants — Add credits mid-cycle via direct creation or paid purchase
- Features and Entitlements — Feature types and automatic provisioning
- Meter Events — Send usage data that powers metered entitlements
- Billable Metrics — Define what you measure