Gemini starter module
Usage metering
Records model usage for customer limits, spending caps, and connected billing.
- Files
- 3
- Lines
- 170
- Languages
- TypeScript
Included files
This page lists paths and purposes, not source contents.
FilePurposeLanguageLines
src/usage/billable-rollup.ts
Turns raw usage rows into the numbers a billing job or dashboard needs.
TypeScript
68 lines
src/usage/record-billable-usage.ts
Claims each Gemini request once and records its full token usage through the app adapter.
TypeScript
77 lines
src/usage/spending-cap.ts
Blocks a Gemini request when the app account does not have enough allowance.
TypeScript
25 lines