> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fluxrate.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Features

> Arbitrary text or numeric entitlement values for plan-specific limits and capabilities.

Custom features let you define **plan-specific values** that don't fit neatly into on/off flags or metered usage. They're perfect for expressing numeric or text limits that your app reads and enforces.

## Use Cases

* **Seat limits**: "Max 5 team members"
* **Retention**: "90-day data retention"
* **Storage quotas**: "10 GB storage"
* **Support tier**: "Priority support"
* **Custom rate limits**: "500 requests/minute"

## Creating a Custom Feature

```bash theme={null}
curl -X POST https://api.fluxrate.co/api/v1/features \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=<token>" \
  -d '{
    "name": "Max Team Members",
    "lookup_key": "max_team_members",
    "description": "Maximum number of team members allowed",
    "type": "custom"
  }'
```

## Attaching with a Value

When attaching a custom feature to a plan, set `static_value` to the plan-specific entitlement:

```bash theme={null}
# Starter plan: 3 team members
curl -X POST https://api.fluxrate.co/api/v1/plans/<starter_plan_id>/features \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=<token>" \
  -d '{
    "feature_id": "<feature_id>",
    "is_enabled": true,
    "static_value": "3"
  }'

# Pro plan: 25 team members
curl -X POST https://api.fluxrate.co/api/v1/plans/<pro_plan_id>/features \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=<token>" \
  -d '{
    "feature_id": "<feature_id>",
    "is_enabled": true,
    "static_value": "25"
  }'

# Enterprise plan: unlimited
curl -X POST https://api.fluxrate.co/api/v1/plans/<enterprise_plan_id>/features \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=<token>" \
  -d '{
    "feature_id": "<feature_id>",
    "is_enabled": true,
    "static_value": "unlimited"
  }'
```

## Reading the Value in Your App

Fetch the customer's subscription features to read the `static_value`, then enforce it in your application logic:

```python theme={null}
# Example: enforce seat limit before adding a team member
subscription = get_customer_subscription(customer_id)
max_seats_feature = next(
    f for f in subscription.plan.features 
    if f.lookup_key == "max_team_members"
)

max_seats = int(max_seats_feature.static_value)
current_seats = get_current_seat_count(customer_id)

if current_seats >= max_seats:
    raise Exception("Seat limit reached. Please upgrade your plan.")
```

<Note>
  Custom features store `static_value` as a string. Parse it to the appropriate type (integer, float, boolean) in your application.
</Note>
