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.getEvent("event_123");curl -X GET "https://api.priceos.com/v1/usage/event_123" \
-H "x-api-key: PRICEOS_API_KEY"{
"id": "<string>",
"amount": 123,
"occurredAt": 123,
"source": "usage",
"eventKey": "<string>",
"metadata": {}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Usage
Get Usage Event
Get a usage event by ID.
GET
/
v1
/
usage
/
{id}
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.getEvent("event_123");curl -X GET "https://api.priceos.com/v1/usage/event_123" \
-H "x-api-key: PRICEOS_API_KEY"{
"id": "<string>",
"amount": 123,
"occurredAt": 123,
"source": "usage",
"eventKey": "<string>",
"metadata": {}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Response
Usage event
Usage event.