Follow our Launch Week between July 1 - 5
Logo
Getting Started

Entitlement

Entitlements are used to control access to Features and APIs. Making it possible to implement complex pricing scenarios such as monthly quotas, prepaid billing, and per-customer pricing.

Check out the Get Started guide for a step-by-step guide to get started with OpenMeter Entitlements.

Entitlement Types

Three types of entitlements to control access to features:

TypeDescription
MeteredAllow customers to consume features up to a certain usage limit, e.g., 10 million monthly tokens.
StaticDefine customer-specific configurations as a JSON value. e.g. { "enabledModels": ["gpt-3", "gpt-4"] }
BooleanDescribe access to specific features like SAML SSO without needing config or metering.

Metered

Useful to control access to features with usage limits. Example use-case: allow customers to consume 10 million monthly tokens.

When the subject exceeds the limit, you can block the subject from using the feature or grant additional one-time or recurring usage with Grants.

To create a metered entitlement, you can use one of the OpenMeter SDKs.

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

Check out the Get Started guide to get started or use the Cloud UI:

Go to Dashboard

Static

Define customer-specific configurations as a JSON value. For example, you may only give freemium users access to a subset of AI models. With static entitlements, you can specify which models the customer can use based on their tier.

To create a static entitlement, you can use one of the OpenMeter SDKs.

import { OpenMeter, type Event } from '@openmeter/sdk';
 
// Give access to customer-1 to use GPT-3 and GPT-4 models
const entitlement = await openmeter.subjects.createEntitlement('customer-1', {
  type: 'static',
  featureKey: 'models',
  config: JSON.stringify({ enabledModels: ['gpt-3', 'gpt-4'] }),
});

Check out the Get Started guide to get started or use the Cloud UI:

Go to Dashboard

Boolean

Describe access to specific features like SAML SSO without needing config or metering. Ideal for simple access scenarios.

To create a boolean entitlement, you can use one of the OpenMeter SDKs.

import { OpenMeter, type Event } from '@openmeter/sdk';
 
// Give access to customer-1 to use SAML SSO
const entitlement = await openmeter.subjects.createEntitlement('customer-1', {
  type: 'metered',
  featureKey: 'saml_sso',
});

Check out the Get Started guide to get started or use the Cloud UI:

Go to Dashboard
Last edited on July 2, 2024