Skip to main content
POST
cURL
Create one metered feature without replacing other catalog items. A feature names an action in your application and sets how many credits one successful use costs. For example, a feature with ID api_call and creditCost: 1 charges one credit per tracked API call.

Define the meter

creditCost must be a positive integer. The feature ID is your stable identifier for Check credits and Record usage. It accepts letters, numbers, underscores, and hyphens, up to 100 characters. name is a display label of at most 120 characters. The API returns the created item with changed: true. Creating another active feature with the same ID returns 409 already_exists. Feature creation is independent of plans and credit packs and does not call Stripe.

Use it from your backend

Call check before your application performs the action, then call track after the action succeeds. A check does not reserve credits; track makes its own balance decision. Give every logical action a unique request_id, and reuse that ID only for a retry of the same action. A repeated track returns idempotent: true without another charge. Update a feature changes the cost of future tracked events. Previously recorded usage keeps its original charge. Archive a feature removes it from active lists and future checks while retaining usage history. See Credits and usage for concurrency and error handling.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
id
string
required
Required string length: 1 - 100
Pattern: ^[a-zA-Z0-9_-]+$
name
string
required
Required string length: 1 - 120
creditCost
integer
required
Required range: x <= 2147483647

Response

Feature created

item
object
required
changed
boolean
required