# Metering and cost

Routed from `skills/SKILL.md`. The authoritative operation list is
[api-reference.md](api-reference.md).

## There is no metering operation family

NOT-SERVED-FAMILY: `bun.metering.*` `bun.cost.*` `bun.usage.*` `bun.billing.*`

Metering is **declarative**: every one of the 55
operation descriptors carries a `metering` block with a `unit` and a `billable`
flag, and cost attribution reads those. There is nothing to call.

The nearest served operations are `bun.subscription.require_active` (gate an
operation on an active subscription) and `bun.audit.query` (redacted usage trail).

## The 13 billable operations

Exactly 13 of 55 operations declare `billable: true`:

| operation | unit |
|---|---|
| `bun.data.create` | `data_write` |
| `bun.data.update` | `data_write` |
| `bun.data.bulk` | `data_write` |
| `bun.data.read` | `data_read` |
| `bun.data.get` | `data_read` |
| `bun.data.list` | `data_read` |
| `bun.data.query` | `data_read` |
| `bun.file.upload` | `file_upload` |
| `bun.file.access` | `file_access` |
| `bun.message.send` | `message_send` |
| `bun.deploy.plan` | `deploy_plan` |
| `bun.deploy.apply` | `deploy_apply` |
| `bun.deploy.rollback` | `deploy_rollback` |

The other 42 declare `billable: false`. Note two deliberate asymmetries that look
like bugs and are not: `bun.data.delete` meters as `data_write` but is **not**
billable, and `bun.file.delete` meters as `file_delete` and is **not** billable —
deleting your own data is not charged.

Forty operations meter in the generic `unit: operation`; the remaining fifteen use
a specific unit as listed above plus `file_delete`.

## Reading it correctly

- The `metering` block is part of the descriptor. Read it from the registry or the
  served OpenAPI document rather than copying the table above into code — the
  table is a snapshot for humans, the descriptor is the source of truth.
- `billable: true` is a declaration of intent, **not** evidence that any invoice
  has ever been produced. No commercial payment provider has been exercised in
  this repository. Payments are also the one provider category whose switch is
  `UNSUPPORTED` — see [switching.md](switching.md).
- Cost attribution reads the live provider registry. Anything that snapshots the
  provider set into a local dict will drift the moment the catalogue changes; that
  exact interaction produced two red tests on a merged tree.
