> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage and budgets

Use the installation's **Usage** settings to inspect recorded usage. The
installation status command reports execution, recorded quantities and coverage.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection installation status <installation-id>
```

## Plans and pricing

Plans and prices are not yet published. [Contact us](https://docs.bijection.com/operate/support.md) about
using Bijection in production.

## Limits

See [Limits](https://docs.bijection.com/operate/limits.md) for installation limits and [Budgets](#budgets)
for app-defined allowances on metered sends.

## Analytics

Bijection serves your app's transactional reads and writes. For periodic
analysis, run [`bijection export`](https://docs.bijection.com/reference/cli/export). To compute derived
tables inside Bijection, use [pipelines](https://docs.bijection.com/transforms/pipelines.md).

## Usage report retention

Hosted installations can retain available sealed usage report details for up to
93 days in encrypted installation storage. Billing records have separate
retention. Enable retention when creating an installation with
`--usage-retention-days 93`, or manage it in installation settings or with the CLI.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection installation set-usage-archive-policy <installation-id> --revision <revision> --once <key> --input - < policy.json
bijection installation usage-archive-policy <installation-id>
```

With active retention consent and a read grant on the installation's metering
scope, read the source cell's archived report pages through native management.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection installation usage archive <project>:<name> --day 2026-11-01
```

Use the previous page's `next_after` as `--after` to continue. The response
contains the reports and their recorded quantities, including installation-level
storage observations where collected.

Disabling retention revokes reads immediately and schedules removal of stored
copies and their keys. The retention status reports pending erasure.

## Budgets

A budget caps what a function, a subtree or a mounted app may reserve per
window in one measure. A receiver's [`meter`](https://docs.bijection.com/models/gateway#options)
prices each operation. A budget is a flow: a `ctx.submit` to a metered
operation by a function the budget covers debits it at admission, in the
submitting transaction, within the current window.

In a multi-tenant app, give each tenant its own account with `for:`:

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { app, budget, label, t } from "@bijectionhq/bijection";

const tenant = label.family(t.string);

export default app({
  tenant,
  agents,
  notify,
  budgets: {
    // Each tenant gets 3,000,000 tokens per 30 days.
    tokens: budget(agents, { measure: "tokens", quota: 3_000_000, every: { days: 30 }, for: tenant }),
    // One account at public, 5,000 messages a day.
    messages: budget(notify, { measure: "messages", quota: 5_000, every: { days: 1 } }),
  },
});
```

A frame at one tenant's member spends from that tenant's account, and one
tenant spending its quota never refuses another. One tenant's spending is
visible only at that tenant's label, so a per-member budget leaks nothing
between tenants.

* `measure` names what the meter counts, `quota` the most units admitted in one
  window per account, and `every` the window, a fixed-length duration (days
  or smaller). Without `every` the quota is for the budget's whole life.
* A submit that does not fit refuses `Limit`, and its message begins with
  `BudgetExhausted` and names the budget. Nothing is sent and no task exists.
* A result in the same window settles the debit to the actual cost the answer
  states, or to nothing if the send was never performed. An `Unknown` outcome
  keeps its debit until the window ends. No debit outlives its window, and
  unspent units wait for the window to end.
* A budget is the point of its own account: `ctx.get(app.budgets.tokens)`
  answers `{ unit, quota, remaining, resetsAt }` for the frame's own account,
  where `resetsAt` is the `Temporal.Instant` the current window ends (null
  without `every`). For a `shared: true` budget, `remaining` is null.
* One send pays exactly one budget: `bijection check` refuses two budgets in
  one measure over one function (`BudgetOverlap`). `bijection.lock` prints each
  budget's terms (`for`, `shared`) and the functions it covers, and each
  mutation's `reserves`.

### Accounts and labels

Each budget is spent from one of three kinds of account:

* **Per member** (`for: family`): each member of that family has its own
  account with the whole quota, and a frame at a member spends from it. A
  frame whose label names no member of the family, or more than one, has no
  account: its metered sends refuse `BudgetNoMember`.
* **At public** (neither `for:` nor `shared:`): one account at public holds
  the quota for the whole app.
* **Shared** (`shared: true`): one host-only counter for the whole
  installation, which no guest reads. The store judges each spend when the
  transaction commits, so concurrent spenders never conflict. Each spend,
  admitted or refused, discloses one bit (fit or full) to the spender and
  records one `sys.disclosures` fact at the commit label. `ctx.try` cannot
  catch its refusal, and a trial reports it as "judged at commit". It cannot
  be combined with `for:` (`CapacitySpansLabels`).

A frame at the account's own label spends from it directly. A frame strictly
above it, such as one tenant's member joined with a secret label, or any
labelled frame of an account at public, cannot touch that account without
revealing its activity there. It spends instead only what was handed to it:

* **Reservations for scheduled work.** Work recorded at one label that runs
  at another (`ctx.submit(work, args, { under })`, a run under a release, or
  that run's `then`) is charged when it is recorded. The recording mutation
  declares the units it reserves per budget:
  `mutation({ reserves: [{ budget: app.budgets.tokens, units: 200 }] }, …)`.
  The submitting commit takes those units from its own account in its own
  window and hands them to that one task. The task's run can spend them until
  the task's deadline. If the submitting label cannot cover the reservation,
  the submit refuses `Limit`.
* **Explicit upward grants**, authored at the granting label.

Nothing is granted automatically when an entry is admitted above an account:
the host commits nothing at public before an entry. `bijection check` warns
when a spender of a budget runs under a label above its account
(`BudgetAboveAccount`). Declare `for:` a label family, `shared: true`, or a
`reserves:` on the recording work.

* Delivering work is never a grant site. Sends at one label conflict only
  with each other, and a send's refusal names only what that label has left
  (`BudgetExhausted: tokens has 120 tokens left at this label`).
* A quota bounds the units admitted per window: a reservation counts in the
  window that recorded it, whenever its run spends it. Idle units at one
  account never serve another unless the budget is `shared: true`.

A cap on stored facts or on a sum is not a budget: write a guard over the
table's maintained `total`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.