import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.billing.listUsage({
filterProducts: [
"si_aslft06m",
"si_on0fybnq",
],
filterPlan: "plan.name",
filterProject: "proj_r0MK4O4kDa95w",
});
console.log(result);
}
run();{
"data": {
"id": "",
"type": "billing_usage",
"attributes": {
"project": {
"id": "proj_r0MK4O4kDa95w",
"slug": "fantastic-iron-clock",
"name": "Fantastic Iron Clock"
},
"period": {
"start": "2025-12-24T15:56:32+00:00",
"end": "2026-01-24T15:56:32+00:00"
},
"available_credit_balance": 123,
"amount": 0,
"price": 0,
"products": [],
"threshold": 10000
}
},
"meta": {}
}Returns the billing usage of a project
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.billing.listUsage({
filterProducts: [
"si_aslft06m",
"si_on0fybnq",
],
filterPlan: "plan.name",
filterProject: "proj_r0MK4O4kDa95w",
});
console.log(result);
}
run();{
"data": {
"id": "",
"type": "billing_usage",
"attributes": {
"project": {
"id": "proj_r0MK4O4kDa95w",
"slug": "fantastic-iron-clock",
"name": "Fantastic Iron Clock"
},
"period": {
"start": "2025-12-24T15:56:32+00:00",
"end": "2026-01-24T15:56:32+00:00"
},
"available_credit_balance": 123,
"amount": 0,
"price": 0,
"products": [],
"threshold": 10000
}
},
"meta": {}
}Allows to filter the billing usage for specific products. It accepts an array of product ids.
Accepts a plan name and allows to filter the usage for that plan.
Success
Show child attributes
Was this page helpful?