Skip to main content
Meter features are the most powerful feature type in Fluxrate. They combine usage tracking with entitlement enforcement, letting you both bill for usage and gate access when limits are hit.

How Meter Features Work

When you create a meter feature, Fluxrate automatically creates:
  1. A Feature (the entitlement definition)
  2. A corresponding Meter (the usage tracking engine)
The meter has a unique meter_token that your backend uses to send usage events.

Creating a Meter Feature

  1. Go to Features in the sidebar
  2. Click Add Feature
  3. Select Meter as the type
  4. Configure the meter settings and click Create

Request Fields

FieldRequiredDescription
nameDisplay name for the feature
lookup_keyUnique identifier (slug) for this feature
meter_nameInternal meter identifier (must be unique per org)
property_nameThe event payload property to read for aggregation
aggregation_typeHow to aggregate: SUM, MAX, UNIQUE_COUNT, LAST
unitDisplay unit (e.g., “calls”, “GB”, “tokens”)
descriptionHuman-readable description

Aggregation Types

SUM

Adds up all values received in the billing period. Best for: API calls, data transferred, messages sent, compute minutes.
// Events
{ "property_name": "1" }  // call 1
{ "property_name": "1" }  // call 2
{ "property_name": "5" }  // bulk operation

// Result: SUM = 7

MAX

Takes the highest single value observed during the period. Best for: Peak concurrent connections, high-water mark measurements.
// Events
{ "property_name": "10" }  // 10 concurrent connections
{ "property_name": "25" }  // peak: 25
{ "property_name": "15" }

// Result: MAX = 25

UNIQUE_COUNT

Counts the number of distinct values of a property. Best for: Monthly active users, unique devices, distinct API consumers.
// Events (counting unique user_ids)
{ "user_id": "user_a" }
{ "user_id": "user_b" }
{ "user_id": "user_a" }  // duplicate - not counted again

// Result: UNIQUE_COUNT = 2
For UNIQUE_COUNT meters, send the value to count as the metadata.user_id field. The SDK endpoint handles this mapping automatically.

LAST

Takes the most recent value received. Best for: Current storage usage, current seat count (snapshot billing).
// Events received over time
{ "property_name": "50" }  // at 10:00
{ "property_name": "75" }  // at 14:00
{ "property_name": "60" }  // at 18:00

// Result: LAST = 60

Usage Filters

Meter features support filters to segment events. For example, track API calls only from specific regions or versions:
curl -X POST https://api.fluxrate.co/api/v1/features \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=<token>" \
  -d '{
    "name": "Premium API Calls",
    "lookup_key": "premium_api_calls",
    "type": "meter",
    "meter_name": "premium_api_calls",
    "property_name": "call_count",
    "aggregation_type": "SUM",
    "filters": [
      {
        "key": "tier",
        "values": ["premium", "enterprise"]
      }
    ]
  }'

Filter Rules

  • Maximum 5 filters per meter
  • Each filter supports up to 15 values
  • Values are matched exactly (strings)
  • Filter keys cannot be added or removed after creation — only values can be updated

Setting Entitlement Limits

When attaching a meter feature to a plan, configure the usage limit:
# Unlimited usage
{
  "feature_id": "<feature_id>",
  "is_enabled": true,
  "is_unlimited": true
}

# Limited usage
{
  "feature_id": "<feature_id>",
  "is_enabled": true,
  "usage_limit": 10000,
  "usage_reset_period": "month",
  "is_soft_limit": false
}
OptionDescription
is_unlimited: trueNo usage cap — just track and bill
usage_limitMaximum units allowed in usage_reset_period
usage_reset_periodWhen the counter resets: day, week, month, year
is_soft_limittrue = warn but don’t block; false = hard block at limit
Use soft limits in SaaS products where you want to upsell users who exceed their plan, rather than hard-blocking them.