# Usage and cost

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> What the hours, the final days and the estimated cost in a usage report count, and what the estimate leaves out.


Ringleader records what each workstation and each cloud Edge VM used, per UTC day, and `rl usage`
reads those records. This page explains what the hours count, when a day's numbers stop changing,
what the estimated cost prices and what it leaves out, and how prices and exchange rates are chosen.
The [Usage report](https://docs-stg.ringleader.dev/reference/cli/commands/usage/) page has the flags, the columns and the examples.

## Hour buckets

Ringleader reads each workstation's phase and counts its time in one of three buckets:

| Bucket | Workstation phases | What you use |
|--------|--------------------|--------------|
| Running | `Running`, `Reconfiguring` | The virtual machine and its disk. |
| Stopped | `Stopped` | The disk. |
| Not charged | `Pending`, `Provisioning`, `PostInstall`, `Starting`, `Stopping`, `Failed`, `Terminating` | Nothing you are charged for. |

[Workstation phases](https://docs-stg.ringleader.dev/workstations/basics/#workstation-phases)
shows how a workstation moves between the main phases. Days and months are UTC: a day starts at
00:00 UTC, and a month is a UTC calendar month.

An Edge VM counts as Running while its VM runs, and as Not charged while the Edge exists and its VM
does not run. It has no Stopped hours. Only an Edge whose VM Ringleader builds in your cloud account
is counted. An [Edge for local workstations](https://docs-stg.ringleader.dev/security/outbound/edge-management/#edges-for-local-workstations)
is not.

The buckets follow the phase Ringleader records, not the power state your cloud reports, so they
can differ from your cloud bill in these cases:

- A machine can still be up in a Not charged phase. A `Failed` workstation can have a live machine,
  `Terminating` keeps the machine until it is deleted, and an Azure VM that is off but still holds
  its hardware stays in `Stopping`.
- `Stopped` does not prove the disk still exists.
- A workstation that stops without Ringleader asking, such as one shut down from inside, counts in
  its old phase until Ringleader next checks it.
- An Edge VM that stops outside Ringleader counts as Running until Ringleader next
  [checks the cloud](https://docs-stg.ringleader.dev/reference/resources/edge/#cloud-checks), and for as long as those
  checks fail.

In CSV and JSON, the Not charged hours come as seconds per phase, so you can count them another
way. Two more columns appear there: `notRunning` is an Edge VM that exists and is not running, and
`unknown` is time in a phase Ringleader could not read. The table counts both as Not charged.

A workstation that was deleted still shows its usage for the days it existed.

### Node-bound workstations

A [node-bound workstation](https://docs-stg.ringleader.dev/workstations/basics/#node-bound-workstations) runs on a person's
own computer, and that computer reports its hours. Those hours appear under their own heading,
`Reported by devices`, with only the three hour columns. They are the device's own report, not
something Ringleader measured, and they are never added to the table above them. A workstation that
lives only on a device that is not logged in, or in the `local` namespace, is not recorded at all.

## Final days

A day closes 5 days after it ends: day D is closed once the UTC date is D plus 6 days or later.
October 1 closes on October 7, UTC. Until then, Ringleader can still add hours to it, for example
when it records a phase change late because the control plane was unreachable. After a day closes,
Ringleader copies that day's token and byte counts into it. Once the copy is done the day is final,
and its numbers never change. Until the copy, a day's token and byte columns show `0`.

Without `--include-open`, `rl usage` shows final days only, and its second line says the last
final day. With `--include-open` it also shows the days that are not final, adds a `STATE` column,
and marks each of those rows `open`:

```bash
rl usage --include-open --by day
```

Ringleader never changes a closed day. When it learns about time that belongs to a closed day,
such as after the control plane could not record a phase change, it adds an adjustment row to the
day it learned it. The row's name ends with `(adjusts <day>)`, naming the closed day it corrects,
and the CSV puts that day in the `adjustedDay` column. An adjustment is never merged into another
row. Token and byte counts that reach Ringleader after their day's copy are not added to any day.

## Estimate exclusions

Every amount is an estimate at list price. Your cloud's bill and your model vendor's invoice are the
record of what you pay. The estimate does not include these charges:

- discounts, such as GCP's sustained-use and committed-use discounts, and contract prices or credits;
- taxes and support;
- network egress, Cloud NAT and logging;
- some model calls Ringleader did not count, and the higher rates of long-context and priority
  tiers, as [Model token pricing](#model-token-pricing) says.

The estimate prices what your cloud bills for, the machine and the disk, so it reads each phase
differently from the Running, Stopped and Not charged buckets:

| Workstation phases | Machine and external IP | Disk |
|--------------------|-------------------------|------|
| `Running`, `Reconfiguring`, `PostInstall`, `Starting`, `Stopping`, `Terminating` | Priced | Priced |
| `Stopped`, `Provisioning`, `Failed` | Not priced | Priced |
| `Pending`, and time in a phase Ringleader could not read | Not priced | Not priced |

An Edge VM's machine and external IP are priced while its VM runs, and its boot disk for as long as
the Edge exists. A `Failed` workstation whose machine is still up costs more than the estimate shows,
and a `Stopped` workstation whose disk was deleted costs less.

## Priced resources by cloud

On GCP, the estimate prices these resources:

- Machine time for workstations and Edge VMs, from the machine type's vCPUs and memory. The
  shared-core types `e2-micro`, `e2-small` and `e2-medium` are priced at the fraction of a vCPU GCP
  bills them for.
- Root disks and Edge boot disks of type `pd-standard`, `pd-balanced`, `pd-ssd` and
  `hyperdisk-balanced`. A Hyperdisk Balanced disk also pays for the IOPS and throughput GCP gives a
  disk of its size by default.
- Standard external IP addresses.
- Bytes in Storage buckets, at the Cloud Storage Standard price for the bucket's location.

AWS and Azure are not priced yet. Their workstations, Edge VMs and buckets appear in the list of what
was not priced, with the reason `AWS pricing is not built yet` or `Azure pricing is not built yet`.

## Model token pricing

`--cost` prices the model tokens Ringleader counted, the ones in the token columns of
[Table columns](https://docs-stg.ringleader.dev/reference/cli/commands/usage/#table-columns). Each counted call records what paid for it, and that
decides the column its tokens go to:

- Tokens an API key paid for go to `TOKENS`, which is part of `TOTAL`.
- Tokens a subscription paid for, such as an agent signed in with a Claude or ChatGPT account, go to
  `SUBSCRIPTION`. A subscription is a flat fee, so this amount is what the calls would have cost at
  list price, not what you paid. It is not in `TOTAL`.

An agent session also reports the tokens it used. If Ringleader counted none of a session's calls,
and none of its workstation's calls on the day the session ended, `--cost` prices the session's
report into `REPORTED`. A reported amount is never added to `TOTAL`, to `SUBSCRIPTION` or to the
tokens Ringleader counted.

A report goes to the row its session belongs to: the session's workstation, owner, namespace or
organization, or the day or month the session ended. With `--by label`, it goes to the row of the
label value its workstation had on the day the session ended. When a report, or tokens Ringleader
counted, fit no row, the table prints their amounts on their own line, which starts
`Token cost no group could hold`. Those amounts are in no row's `TOTAL`.

Ringleader prices tokens with a table of Anthropic and OpenAI list prices that comes with each
release. The line above the table says `model prices as of` and the day that table last changed. A
model the table does not have is listed as not priced until a release adds it, and then its earlier
days are priced too. When a release changes a model's price, the new price applies from about the
day your control plane starts running that release, and earlier days keep the old price.

After `Your cloud bill is the record.`, the line names the cases where the token estimate is low:

- Some models charge more for a long prompt or a priority call. The estimate uses the model's base
  rate for every call.
- A cache write lasts 5 minutes or 1 hour with Anthropic, and 30 minutes or 12 hours with OpenAI.
  When Ringleader has no record of a write's lifetime, it prices the write at its model's rate for
  the shorter lifetime. Anthropic charges more for a 1-hour write, and OpenAI charges more for a
  12-hour write on some models.
- A call Ringleader did not count is priced nowhere when Ringleader counted other calls from the
  same session, or from the same workstation on the same day.
- Tokens from Edge batches that reach Ringleader after their day's copy are in no amount and in no
  list.
- Ringleader can delete some of a session's per-model token counts while it still keeps the
  session's record. The deleted tokens are then in no amount and in no list.

## Daily prices and exchange rates

Ringleader reads GCP's public price list once a day and keeps every price with the UTC day it first
saw it. Each day of your window is priced at the price that held on that day. If a price
changed on October 20, a report for October prices October 1 to 19 at the old price and October 20
to 31 at the new one. The line above the table names the days the prices it used took effect. A day
before the first price Ringleader stored for an item takes the earliest price it has, and `--json`
lists those days in `costBasis.earliestPriceDays`.

With `--currency`, each day converts at that day's rate from the European Central Bank's daily
reference rates. On a weekend or a holiday the bank publishes no rate, so the day converts at the
latest rate before it. The line above the table then also says `exchange rates as of` and names the
days of the rates it used. It names at most six price days and six rate days, followed by
`and <n> more`, and `--json` lists all of them. A day before the first stored rate converts at the
earliest one, listed in `costBasis.earliestRateDays`. If the control plane holds no rate for the
currency you name, `rl usage` exits 1 and names the currency.

A final day's quantities never change, but its cost can change in these cases:

- Ringleader reads a machine type's vCPUs, memory or GPU count for the first time, or reads changed
  ones. Every day that used the type is priced again with them.
- Every Storage object that names a bucket is deleted. The bucket's bytes are then unpriced, final
  days included, with the reason `bucket location unknown`.
- The price list starts to carry an item it had no price for. Earlier days of that item take the new
  price, because it is the earliest one.
- A Ringleader release adds a model to its model price table. Earlier days of that model's tokens
  take its first price, so the `TOKENS`, `SUBSCRIPTION` or `REPORTED` amount that listed them as not
  priced goes up.

## Comparison with your bill

The estimate uses UTC days, like the rest of Ringleader's usage reports. GCP's billing reports use US Pacific days,
which start 7 or 8 hours after a UTC day does. So one day of the estimate covers parts of two days on
the bill, and a single day can differ from the bill's day for that date. A whole month's estimate
comes within a few percent of the bill's month, apart from the charges the estimate leaves out.

## Open days and cut answers

With `--include-open`, the amounts on a row marked `open` can still change, because its quantities,
exchange rates and machine shapes can. The table then says
`Amounts on rows marked open are provisional and can still change.` If the answer reached its limit
of groups, the table says `Some amounts are incomplete` and still shows every quantity it read.

## Next steps

- [Usage report](https://docs-stg.ringleader.dev/reference/cli/commands/usage/): the flags, the columns, the CSV and JSON formats and examples of `rl usage`.
- [Edge bytes and workstation bytes](https://docs-stg.ringleader.dev/reference/cli/commands/usage/#edge-bytes-and-workstation-bytes): the two byte counts in a usage report.
- [Workstation phases](https://docs-stg.ringleader.dev/workstations/basics/#workstation-phases): how a workstation moves between the phases the hours count.

