Logo

Control Usage with EntitlementsManage feature access, balances, and usage limits effortlessly

Peter Marton
Peter Marton@slashdotpeter
cover

Managing different usage limits between free and premium plans? Need to restrict advanced features to enterprise customers? OpenMeter has got you covered! Our new Entitlements feature allows you to manage customer feature access, balances, and usage limits effortlessly.

How Entitlements Help?

Implementing usage quotas based on your pricing can be challenging. With OpenMeter, you can now easily assign features to customers with specific usage limits or static configurations. This enables you to implement complex pricing scenarios such as monthly quotas, prepaid billing, and per-customer pricing.

Don't just list usage limits on your marketing page—enforce them within your application to control the cost of expensive resources like LLMs. Entitlements are available in both our open-source platform and OpenMeter Cloud.

Who is this for?

OpenMeter Entitlements are perfect for companies that would like to:

  • Enforce usage limits like monthly token allowances.
  • Sell plans with various feature sets.
  • Offer custom quotes and per-customer pricing.

Flexible Entitlement Types

We are launching OpenMeter Entitlements with three different types.

  1. Metered Entitlement Allow customers to consume features up to a certain usage limit, e.g., 10 million monthly tokens.
  2. Static Entitlement Define customer-specific configurations as a JSON value. For example, you may only give freemium users access to a subset of AI models.
  3. Boolean Entitlement Describe access to specific features like SAML SSO without the need for config or metering. Ideal for simple access scenarios.

Entitlements Demo

Learn how to use Entitlements in this quick video:

Example: Granting 10 Million Monthly Tokens

Let's see how you can provide access to 10 million monthly tokens for customers. You can also start with Entitlements by following the Get Started guide or using the Cloud Dashboard.

1. Create your first feature

Create a feature you want to add to customer access, such as AI Tokens, API Requests, etc.

import { OpenMeter, type Event } from '@openmeter/sdk';
 
// Create feature GPT Tokens
const feature = await openmeter.features.create({
  key: 'ai_tokens',
  name: 'AI Tokens',
  meterSlug: 'tokens_total',
});

Or go to the OpenMeter Dashboard to create a new feature.

2. Assign access to a customer

Create an entitlement to define access and allowances of a feature for a customer.

// Give access to monthly 10 million tokens to customer-1
const customer = 'customer-1';
const entitlement = await openmeter.subjects.createEntitlement(customer, {
  type: 'metered',
  featureKey: 'ai_tokens',
  issueAfterReset: 10000000, // 10 Million tokens
  usagePeriod: {
    interval: 'MONTH',
  },
  isSoftLimit: false,
});

Or go to the OpenMeter Dashboard to create a new entitlement.

3. Check Access

Check if your customer has access to consume that feature.

// Get the entitlement's current value
const value = await openmeter.subjects.getEntitlementValue(
  'customer-1',
  'gpt_tokens',
);
const { hasAccess, balance, usage, overage } = value;
 
if (!hasAccess) {
  return reply.status(402).send('purchase additional tokens');
}

Optional: Grant Additional Tokens

Need to grant additional usage for a period? Whether the customer buys a top-up, you're extending a trial, or handling a support request, the OpenMeter Dashboard makes it easy.

Happy coding! 🚀

Start leveraging the power of Entitlements today and ensure your customers get the right access while you manage your resources efficiently.