Skip to main content

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

string
required
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"
string
required
Human-readable name displayed in the dashboard and billing UI.Example: "API Calls", "Team Seats", "Credits"
enum
required
The type of feature. Determines how the feature is tracked and consumed.
boolean
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)
Note: Credit system features must be consumable.
array
Required for credit_system features. Maps metered features to their credit costs.
object
Display names for the feature in billing UI and customer-facing components.
array
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.
string
The unique identifier for this feature.
string
Human-readable name of the feature.
enum
Feature type: "boolean", "metered", or "credit_system".
boolean
Whether the feature is consumable.
boolean
Whether the feature is archived (always false for newly created features).
object
Display names for UI rendering.
array
Credit schema mapping (only for credit_system features).
array
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
Non-Consumable (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
This simplifies pricing by giving customers flexibility in how they use their allocation.

Best Practices

Use lowercase with hyphens for feature IDs (e.g., "api-calls", not "API_CALLS" or "apiCalls").
Feature IDs cannot be changed after creation if the feature is in use by customers. Choose meaningful, stable identifiers.
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

string
Error code identifying the type of error.
string
Human-readable error message.

Common Errors

  • feature_already_exists - A feature with this ID already exists
  • invalid_feature_id - Feature ID contains invalid characters
  • consumable_required - Consumable field is required for metered features
  • credit_schema_required - Credit schema is required for credit_system features
  • invalid_credit_schema - Referenced metered feature does not exist