Skip to main content

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 */ },
});

Request & response schema

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 */ },
});

Request & response schema

soat.usage.listUsageThresholds()

List usage thresholds

  • Method: GET
  • Path: /api/v1/usage/thresholds
await soat.usage.listUsageThresholds({
query: { /* + optional */ },
});

Request & response schema

soat.usage.createUsageThreshold()

Create a usage threshold

  • Method: POST
  • Path: /api/v1/usage/thresholds
await soat.usage.createUsageThreshold({
body: { project_id, metric, window, threshold },
});

Request & response schema

soat.usage.deleteUsageThreshold()

Delete a usage threshold

  • Method: DELETE
  • Path: /api/v1/usage/thresholds/{threshold_id}
await soat.usage.deleteUsageThreshold({
path: { threshold_id },
});

Request & response schema

soat.usage.getUsageReceipt()

Get a generation or run billing receipt

  • Method: GET
  • Path: /api/v1/usage/receipt
await soat.usage.getUsageReceipt({
query: { /* + optional */ },
});

Request & response schema

soat.usage.getPriceBook()

Get the price book

  • Method: GET
  • Path: /api/v1/usage/prices
await soat.usage.getPriceBook();

Request & response schema

soat.usage.upsertPriceBook()

Upsert price-book rows

  • Method: PUT
  • Path: /api/v1/usage/prices
await soat.usage.upsertPriceBook({
body: { prices },
});

Request & response schema