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>"
}Body
application/json
Response
Feature created
Feature.