Node.js
import { PriceOS } from "priceos";
import type { MyFeatures } from "./priceos.types";
const priceos = new PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);
const feature = await priceos.features.create({
name: "API Calls",
featureKey: "api_calls",
type: "limit",
tracksUsage: true,
usageResetInterval: "month",
usageResetAnchor: "calendar",
});curl -X POST "https://api.priceos.com/v1/features" \
-H "x-api-key: PRICEOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "API Calls",
"featureKey": "api_calls",
"type": "limit",
"tracksUsage": true,
"usageResetInterval": "month",
"usageResetAnchor": "calendar"
}'{
"id": "feat_123",
"featureKey": "api_calls",
"name": "API Calls",
"description": "Monthly API request limit.",
"type": "limit",
"tracksUsage": true,
"usageResetInterval": "month",
"usageResetAnchor": "calendar",
"isArchived": false,
"archivedAt": null,
"archivedReason": null
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Features
Create Feature
Create a boolean or limit feature for the project.
POST
/
v1
/
features
Node.js
import { PriceOS } from "priceos";
import type { MyFeatures } from "./priceos.types";
const priceos = new PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);
const feature = await priceos.features.create({
name: "API Calls",
featureKey: "api_calls",
type: "limit",
tracksUsage: true,
usageResetInterval: "month",
usageResetAnchor: "calendar",
});curl -X POST "https://api.priceos.com/v1/features" \
-H "x-api-key: PRICEOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "API Calls",
"featureKey": "api_calls",
"type": "limit",
"tracksUsage": true,
"usageResetInterval": "month",
"usageResetAnchor": "calendar"
}'{
"id": "feat_123",
"featureKey": "api_calls",
"name": "API Calls",
"description": "Monthly API request limit.",
"type": "limit",
"tracksUsage": true,
"usageResetInterval": "month",
"usageResetAnchor": "calendar",
"isArchived": false,
"archivedAt": null,
"archivedReason": null
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Headers
API key from your PriceOS dashboard.
Body
application/json
Feature name.
Feature key.
Feature access type.
Available options:
boolean, limit Feature description.
Whether this limit feature tracks usage.
Usage reset interval.
Available options:
never, day, week, month, year Usage reset anchor.
Available options:
billing_period, calendar Response
Feature created
Feature.
Feature ID.
Feature key.
Feature name.
Feature description.
Feature access type.
Available options:
boolean, limit Whether the feature tracks usage.
Usage reset interval.
Available options:
never, day, week, month, year Usage reset anchor.
Available options:
billing_period, calendar Whether the feature is archived.
When the feature was archived.
Why the feature was archived.