Usage
SDK methods for the Usage module, accessed via soat.usage. See the Usage module docs for permissions and data model, and each method's REST page for the full request/response schema.
soat.usage.listUsageMeters()
List usage meters
- Method:
GET - Path:
/api/v1/usage/meters
await soat.usage.listUsageMeters({
query: { /* + optional */ },
});
soat.usage.getUsage()
Get aggregated usage for a project
- Method:
GET - Path:
/api/v1/usage
await soat.usage.getUsage({
query: { project_id, group_by, /* + optional */ },
});
soat.usage.listUsageThresholds()
List usage thresholds
- Method:
GET - Path:
/api/v1/usage/thresholds
await soat.usage.listUsageThresholds({
query: { /* + optional */ },
});
soat.usage.createUsageThreshold()
Create a usage threshold
- Method:
POST - Path:
/api/v1/usage/thresholds
await soat.usage.createUsageThreshold({
body: { project_id, metric, window, threshold },
});
soat.usage.deleteUsageThreshold()
Delete a usage threshold
- Method:
DELETE - Path:
/api/v1/usage/thresholds/{threshold_id}
await soat.usage.deleteUsageThreshold({
path: { threshold_id },
});
soat.usage.getUsageReceipt()
Get a generation or run billing receipt
- Method:
GET - Path:
/api/v1/usage/receipt
await soat.usage.getUsageReceipt({
query: { /* + optional */ },
});
soat.usage.getPriceBook()
Get the price book
- Method:
GET - Path:
/api/v1/usage/prices
await soat.usage.getPriceBook();
soat.usage.upsertPriceBook()
Upsert price-book rows
- Method:
PUT - Path:
/api/v1/usage/prices
await soat.usage.upsertPriceBook({
body: { prices },
});