Skip to main content
Follow the steps below to create a feature in Flexprice:
  1. In the main navigation menu, open Product catalog → Features.
  2. At the top-right, click New feature.
  3. Fill in the feature details:
    • Name: Enter a unique and descriptive name for the feature (e.g., “Premium API Access”).
    • Type: Select the type of feature:
      • Metered: Tracks quantifiable usage (e.g., number of API calls)
      • Boolean: Indicates a simple on/off state (e.g., access to a premium dashboard)
      • Static: Represents fixed attributes or entitlements (e.g., priority support)
      • Config: Delivers a custom JSON configuration to your application through the customer’s entitlements (e.g., feature flags, rate limits, tenant settings)
    • Optional details: Expand it to set a Lookup key, Description, and Tag.
  4. Click Create feature.

How to create a Boolean feature

Select Boolean as Type which indicates a simple on/off state (e.g., access to a premium dashboard).
Create feature form with Boolean selected

How to create a Static feature

Select Static as feature type which represents fixed attributes or entitlements (e.g., priority support)
Create feature form with Static selected

How to create a Config feature

A Config feature lets you attach a JSON object to an entitlement as a config_value. Flexprice stores and delivers this payload through plans and subscriptions, giving your application full control over how the configuration is applied.
1

Select Config as the feature type

In the Create feature form, choose Config as the Type.
The config_value is set at the entitlement level, not on the feature itself. You define it when attaching this feature to a plan.
2

Add the feature to a plan

Open the target plan and, in the Entitlements card, click Add entitlement. Choose the Config feature you created.A Configuration (JSON) field appears. Enter a valid JSON object as the config_value. The form blocks submission if the value is not a valid JSON object.
Add entitlement dialog with a Config feature and its JSON configuration
3

Save and verify

Click Create entitlement to save. The plan’s Entitlements card shows Configured in the Included column for the Config feature. To see or change the stored JSON, open the entitlement’s ⋯ menu and select Edit.
Plan Entitlements card with a Config feature marked Configured
The config_value is available on the customer’s entitlements as soon as they subscribe to a plan that includes this feature. Use the Get Customer Entitlements endpoint to retrieve it.

How to create a Metered feature

  1. Select Metered as Type which tracks quantifiable usage (e.g., number of API calls).
  2. Optionally set the singular and plural unit names under Units, for example: “token” and “tokens”. A reporting unit and conversion rate show usage in a different unit on reports.
Create feature form with Metered selected and the Units card

Define Event Details

Event and Aggregation cards with an event name, a model filter, and a Sum aggregation

Event Name

For example, suppose you want to track how many tokens users consume while calling your AI model:
  • Event Name: tokens_total
    • This is the unique identifier you’ll use to send events that match the metric
    • Must be unique across your Flexprice account to avoid confusion with other metrics

Filters (Optional)

Once a feature exists, its filters can only grow: an update can add new properties or values, but can’t remove or change existing ones. Decide up front if you’ll need them for billing or reporting. Filters let you narrow down which events get counted or summed in this metric. You do not have to add filters if you want to aggregate all events of a given type. However, filters become crucial if you need more granular control, such as billing for only certain AI models or distinguishing usage by environment. Example: If your system supports multiple AI models (gpt 3, llama3.2, gpt 4), and you only want to track usage from GPT models for specialized billing, you can add a filter:
  • Property: model
  • Values: gpt 3, gpt 4 (comma-separated)
This means Flexprice will only aggregate token usage events where model is either gpt 3 or gpt 4.

Define Aggregation

The aggregation settings tell Flexprice how to measure your events. They are in the Aggregation card, shown in the screenshot above.

Function

Choose one of these aggregation functions (see Aggregation Overview for detailed explanations):
  • COUNT: Counts the total number of matching events, regardless of any numeric value in the event data
  • SUM: Adds a numeric property (like tokens, price, etc.) across all matching events
  • AVERAGE: Calculates the mean value of a specified property across all matching events
  • COUNT UNIQUE: Counts only the unique values of a specified event property
  • LATEST: Returns the most recent value of a specified property based on event timestamp
  • SUM WITH MULTIPLIER: Sums a property and applies a configurable multiplier for rate conversions
  • MAX: Returns the maximum value of a specified property (supports bucketed calculations)
  • WEIGHTED SUM: Time-weighted sum for capacity-based billing where values are prorated by duration
The dashboard offers every function except AVERAGE, which you set through the API as AVG.

Field

  • The property that Flexprice aggregates, set in Event field. Required for all aggregation functions except COUNT
  • For numeric aggregations (SUM, AVERAGE, SUM WITH MULTIPLIER, MAX, WEIGHTED SUM): specify a numeric property (e.g., tokens, gb, response_time)
  • For COUNT UNIQUE: specify any property whose distinct values you want to count (e.g., user_id, session_id)
  • For LATEST: specify the property whose most recent value you want to track (e.g., tier_level, status)
  • For COUNT: no field required (counts event occurrences only)

Usage Reset

  • Cumulative: The meter never resets. Usage keeps accumulating across billing cycles, providing a running total. This is useful for features like storage.
  • Periodic: Usage resets at each billing period (e.g., monthly). This is ideal for most subscription-based models where usage resets for every billing period
The dashboard creates metered features with Periodic usage reset. For Cumulative, create the feature through the API with the meter’s reset_usage set to NEVER. Example Configuration:
  • Aggregation = SUM
  • Aggregation Value = tokens
  • Aggregation Type = Periodic (if you invoice monthly and want usage to reset each month)