Overview
Create a new feature to track usage, control access, or manage unified credit systems. Features are the building blocks of your pricing model and determine what customers can access and consume.Endpoint
Request Body
The unique identifier for this feature. Used in
/check and /track API calls. Must match the pattern ^[a-z0-9-_]+$.Example: "api-calls", "seats", "credits"Human-readable name displayed in the dashboard and billing UI.Example:
"API Calls", "Team Seats", "Credits"The type of feature. Determines how the feature is tracked and consumed.
Whether this feature is consumable. Required for
metered features.true- Usage resets periodically (e.g., monthly API calls, credits)false- Allocated persistently (e.g., seats, workspaces, storage slots)
Required for
credit_system features. Maps metered features to their credit costs.Display names for the feature in billing UI and customer-facing components.
Event names that trigger this feature’s balance. Allows multiple features to respond to a single event.Example:
["api.request", "api.call"]Response
Returns the created feature object.The unique identifier for this feature.
Human-readable name of the feature.
Feature type:
"boolean", "metered", or "credit_system".Whether the feature is consumable.
Whether the feature is archived (always
false for newly created features).Display names for UI rendering.
Credit schema mapping (only for credit_system features).
Event names that trigger this feature.
Examples
Metered Feature (Consumable)
Request
Response
Metered Feature (Non-Consumable)
Request
Response
Boolean Feature
Request
Response
Credit System Feature
Request
Response
Feature Types Explained
Boolean Features
Boolean features provide simple on/off access control. Use them for:- Premium feature flags (e.g., “Advanced Analytics”, “Custom Branding”)
- Access tiers (e.g., “API Access”, “Premium Support”)
- Binary capabilities that don’t track usage
Metered Features
Metered features track quantifiable usage or allocations. Configure as: Consumable (consumable: true) - Usage resets periodically:
- API calls per month
- Messages sent
- Credits consumed
- Compute hours
consumable: false) - Persistent allocations:
- Team seats
- Workspaces
- Projects
- Storage slots
Credit Systems
Credit systems unify multiple metered features under a single credit pool. Customers spend credits on different actions at different rates:- 1 credit per API call
- 10 credits per image generation
- 5 credits per video render
Best Practices
Credit system features require you to create the underlying metered features first. Create
"api-calls" and "image-generations" before creating the credit system that references them.Error Responses
Error code identifying the type of error.
Human-readable error message.
Common Errors
feature_already_exists- A feature with this ID already existsinvalid_feature_id- Feature ID contains invalid charactersconsumable_required- Consumable field is required for metered featurescredit_schema_required- Credit schema is required for credit_system featuresinvalid_credit_schema- Referenced metered feature does not exist