Node.js
import { PriceOS } from "priceos";
import type { MyFeatures } from "./priceos.types";
const priceos = new PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);
const result = await priceos.usage.set({
customerId: "customer_123",
featureKey: "api_calls",
used: 1200,
eventKey: "set_usage_customer_123_api_calls_2026_02_18",
});curl -X POST "https://api.priceos.com/v1/usage/set" \
-H "x-api-key: PRICEOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customerId": "customer_123",
"featureKey": "api_calls",
"used": 1200,
"eventKey": "set_usage_customer_123_api_calls_2026_02_18"
}'{
"applied": true,
"used": 123,
"adjustment": 123,
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Usage
Set Usage
Set absolute usage for the current period by recording an adjustment event.
POST
/
v1
/
usage
/
set
Node.js
import { PriceOS } from "priceos";
import type { MyFeatures } from "./priceos.types";
const priceos = new PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);
const result = await priceos.usage.set({
customerId: "customer_123",
featureKey: "api_calls",
used: 1200,
eventKey: "set_usage_customer_123_api_calls_2026_02_18",
});curl -X POST "https://api.priceos.com/v1/usage/set" \
-H "x-api-key: PRICEOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customerId": "customer_123",
"featureKey": "api_calls",
"used": 1200,
"eventKey": "set_usage_customer_123_api_calls_2026_02_18"
}'{
"applied": true,
"used": 123,
"adjustment": 123,
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Body
application/json
Response
Usage set
Usage set result.