gemini_token_usage
Track cumulative token usage and estimated USD cost for Gemini generations. Call before and after a workflow or generation to measure spend, with optional reset for bracketing.
Instructions
Token usage for this session so far — what every generation has cost in tokens, added up. Call it before and after a workflow and subtract to get that workflow's cost; call it after a single generation for that call's. Reports tokens AND an estimated USD cost, priced per call against each call's own model and stamped with the date its rates were read (override with GEMINI_RATE_CARD). Note there is no account-balance endpoint to query — Google Cloud is post-paid and its billing data lags by hours — so this is the accurate way to attribute spend to a call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reset | No | Zero the running total after reporting it, so the next call measures from here. Use it to bracket a workflow without arithmetic. |