# AGENTS.md

tokenbill prices LLM API usage records and checks them against subscription allowances.

## Layout

- `src/prices.mjs` – price table, USD per million tokens.
- `src/cost.mjs` – turns a usage record into a dollar cost.
- `src/limits.mjs` – rolling 5-hour, weekly and monthly allowance windows.
- `src/format.mjs` – money and token formatting for reports.
- `src/report.mjs` – aggregates usage records into a per-model report.
- `test/` – `node --test` suites, one per module.

## Rules

1. Node 22, ES modules, standard library only. Do not add dependencies.
2. Keep money in floating-point dollars internally; round only in `src/format.mjs`.
3. Every exported function has a JSDoc comment and a test.
4. Run `npm test` before you say a task is done, and report the result.
5. Keep changes minimal; do not reformat unrelated code.
