Claude starter module
Usage metering
Records input, output, and cached tokens for customer limits and connected billing.
- Files
- 3
- Lines
- 162
- Languages
- TypeScript
Included files
This page lists paths and purposes, not source contents.
FilePurposeLanguageLines
src/usage/billable-rollup.ts
Summarizes raw model usage into account totals that a billing layer can consume.
TypeScript
57 lines
src/usage/record-billable-usage.ts
Claims each Anthropic request once and records its full token usage through the app adapter.
TypeScript
80 lines
src/usage/spending-cap.ts
Blocks an Anthropic request when the app account does not have enough allowance.
TypeScript
25 lines