# Usage

> SDK methods for the Usage module, accessed via `soat.usage`. See the [Usage module docs](/docs/modules/usage) for permissions and data model, and each method's REST page for the full request/response schema.

# Usage

SDK methods for the Usage module, accessed via `soat.usage`. See the [Usage module docs](/docs/modules/usage) for permissions and data model, and each method's REST page for the full request/response schema.

### `soat.usage.listUsageEvents()`

List usage events

- Method: `GET`
- Path: `/api/v1/usage/events`

```ts
await soat.usage.listUsageEvents({
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/usage/list-usage-events)

### `soat.usage.getUsageAggregate()`

Get aggregated usage for a project

- Method: `GET`
- Path: `/api/v1/usage/aggregate`

```ts
await soat.usage.getUsageAggregate({
  query: { project_id, /* + optional */ },
});
```

→ [Request & response schema](/docs/api/usage/get-usage-aggregate)

### `soat.usage.listUsageThresholds()`

List usage thresholds

- Method: `GET`
- Path: `/api/v1/usage/thresholds`

```ts
await soat.usage.listUsageThresholds({
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/usage/list-usage-thresholds)

### `soat.usage.createUsageThreshold()`

Create a usage threshold

- Method: `POST`
- Path: `/api/v1/usage/thresholds`

```ts
await soat.usage.createUsageThreshold({
  body: { project_id, metric, window, threshold },
});
```

→ [Request & response schema](/docs/api/usage/create-usage-threshold)

### `soat.usage.deleteUsageThreshold()`

Delete a usage threshold

- Method: `DELETE`
- Path: `/api/v1/usage/thresholds/{threshold_id}`

```ts
await soat.usage.deleteUsageThreshold({
  path: { threshold_id },
});
```

→ [Request & response schema](/docs/api/usage/delete-usage-threshold)

### `soat.usage.getUsageReceipt()`

Get a generation or orchestration-run billing receipt

- Method: `GET`
- Path: `/api/v1/usage/receipt`

```ts
await soat.usage.getUsageReceipt({
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/usage/get-usage-receipt)

### `soat.usage.getPriceBook()`

Get the price book

- Method: `GET`
- Path: `/api/v1/usage/prices`

```ts
await soat.usage.getPriceBook();
```

→ [Request & response schema](/docs/api/usage/get-price-book)

### `soat.usage.upsertPriceBook()`

Upsert price-book rows

- Method: `PUT`
- Path: `/api/v1/usage/prices`

```ts
await soat.usage.upsertPriceBook({
  body: { prices },
});
```

→ [Request & response schema](/docs/api/usage/upsert-price-book)
