# Balances and usage

Source: https://docs.orbytelabs.com/cli/usage

Read customer credits, check access, and track events.

## Read a balance [#read-a-balance]

```npm
npx orbytelabs balance customer_123
```

The output uses displayed credits. A zero balance is a successful read.

## Check access [#check-access]

```npm
npx orbytelabs check requests --identity customer_123 --minimum-balance 0.01
```

`--minimum-balance` is optional and uses displayed credits. Without it, a check
requires a positive matching balance. An allowed check exits 0; a denied check
exits 1. Checks reserve no funds.

## Track usage [#track-usage]

```npm
npx orbytelabs track requests --identity customer_123 --idempotency-key request_123
```

For a feature using `sum("tokens")`, pass its measured quantity:

```npm
npx orbytelabs track tokens --identity customer_123 --payload '{"tokens":1200}' \
  --idempotency-key generation_123
```

Reuse the same key and unchanged input to retry an event without charging twice.
The CLI generates and prints a key if omitted. For distinct features, pass the
identity fields with `--payload` to both `check` and `track`.

See [checking and tracking](/checking-and-tracking) for the billing rules.