Skip to main content
Creates a new feature in the specified project. Each project can have a maximum of 50 features.

Endpoint

POST /api/v1/projects/{slug}/features

Authentication

Authorization
string
required
Bearer token with your API key. Requires read_write permission.

Path Parameters

slug
string
required
The project’s URL-friendly slug identifier.

Body Parameters

name
string
required
Feature display name.
description
string
Description of the feature.
basePrice
number
required
Base price for this feature. Must be >= 0.
isCountable
boolean
Whether this feature tracks usage or has limits.
featureType
string
Type of feature. One of:
  • "Standart" — simple included/not-included feature
  • "Limits" — feature with a usage limit
  • "Usage Based" — metered usage feature
usageCount
number
Default usage count or limit value. Relevant for "Limits" and "Usage Based" types.
condition
string
Condition label displayed with the count (e.g. "Up to", "Unlimited").
countPrice
number
Price per unit of usage. Relevant for "Usage Based" type.
eventAggregationMethod
string
How usage events are aggregated (e.g. "count", "sum").

Response

Returns the created feature object with status 201 Created.

Example — Standard Feature

curl -X POST https://cuprice.io/api/v1/projects/my-saas-app/features \
  -H "Authorization: Bearer cpk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Priority Support",
    "description": "24/7 priority email and chat support",
    "basePrice": 20,
    "featureType": "Standart",
    "isCountable": false
  }'
{
  "id": 104,
  "name": "Priority Support",
  "description": "24/7 priority email and chat support",
  "basePrice": 20,
  "featureType": "Standart",
  "isCountable": false,
  "countableData": null,
  "createdAt": "2025-10-01T09:00:00.000Z",
  "updatedAt": "2025-10-01T09:00:00.000Z"
}

Example — Usage-Based Feature

curl -X POST https://cuprice.io/api/v1/projects/my-saas-app/features \
  -H "Authorization: Bearer cpk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "API Calls",
    "description": "Monthly API request quota",
    "basePrice": 15,
    "featureType": "Usage Based",
    "isCountable": true,
    "usageCount": 10000,
    "condition": "Up to",
    "countPrice": 0.001,
    "eventAggregationMethod": "count"
  }'
{
  "id": 105,
  "name": "API Calls",
  "description": "Monthly API request quota",
  "basePrice": 15,
  "featureType": "Usage Based",
  "isCountable": true,
  "countableData": {
    "usageCount": 10000,
    "condition": "Up to",
    "countPrice": 0.001,
    "eventAggregationMethod": "count"
  },
  "createdAt": "2025-10-01T09:05:00.000Z",
  "updatedAt": "2025-10-01T09:05:00.000Z"
}

Errors

StatusDescription
400Missing name or basePrice, or basePrice is negative
400Project already has 50 features (maximum reached)
401Invalid or missing API key
403API key does not have read_write permission
404Project with the given slug not found