A script-based log is the minimum of accounting; a spreadsheet is the maximum of control. A summary table of spending by tasks, models, and providers shows where quotas and money leak, and turns decisions about upgrades into arithmetic. Below: the table schema and live examples of findings.
The table schema
| Column | What goes in | Why |
|---|---|---|
| Date/time | moment of the request | day and week profile |
| Project/task | label by hand or from the script | who is eating the budget |
| Provider/model | call string | comparing layers |
| Input/Output/Cached | from the usage field | spending structure |
| Iteration # | sequential number within the task | quality of task framing |
| Price (calculated) | from the model price list | money in rubles/dollars |
| Note | whether an edit happened | cost of edits |
Automating data entry — a call wrapper from the material on token accounting; the manual “note” column is the most informative field: edits and their reasons build the statistics of task framing.
Pivots that answer questions
- By project: which project is eating the budget — and whether its tooling is worth that money.
- By model: the share of the free tier against the paid one — progress along the limits pyramid.
- By iterations: tasks with 5+ iterations are candidates for PRD-style framing; the rule: every iteration beyond the second is a signal of a weak brief.
- By time: the day’s peaks — do they coincide with quota windows running out.
- By cache: the share of cached tokens per provider — where cache-friendliness actually works.
Live findings from practice
- “Email classification” ate the most — a giant context on every incoming message turned out to be the cause; the cure is targeted input.
- “Flagship tests” on gateways — a one-off, but several times more expensive than a whole month of routine work: their share is visible at once and justified only by a results table.
- A worker model burning 5 iterations on simple tasks — a signal to change the framing, not the model.
- The night queue (report exports) turned out to be free by definition — the night quota windows were sitting idle.
Accounting infrastructure
Solo — Google Sheets/Excel with manual or script-based export. A team — a shared sheet with an author column plus a summary across everyone; behind a LiteLLM proxy the journal is collected by the server automatically (adding the project to the log is enough). Integration with the quota-reset calendar: a provider “cycle day” column — it ties spending to windows.
Additionally: a month-by-month slice of “cost per completed task” — the metric that replaces every “cheap versus flagship” argument. The formula is in the material on the price of edits.
A practical case: a weekly summary with one script
The solo-accounting case from practice: the journal is kept in a CSV file, and the summary is assembled by a short pandas script. Running it at the end of the week takes seconds, and the output immediately shows which project ate the budget, how many iterations went into edits, and what share of input tokens hit the cache. The script lives in the repository next to the pipeline and hangs on the same scheduler as the night jobs: the summary arrives in the team chat on Monday morning without any manual effort. One month of records is enough for every pivot from the list above, and for a team the same script runs over the shared sheet with the author column. The same summary without pandas is reproduced in ready-made spreadsheets: the usage columns are assembled with formulas, and the pivots with the sheet’s pivot reports.
import pandas as pd
df = pd.read_csv("usage_log.csv")
df["cost"] = df["input"] * df["price_in"] + df["output"] * df["price_out"]
pivot = df.pivot_table(
index="project",
values=["input", "output", "cost", "iteration"],
aggfunc={"input": "sum", "output": "sum", "cost": "sum", "iteration": "max"},
)
print(pivot.sort_values("cost", ascending=False))
print("Edits share:", df["note"].notna().mean().round(2))
print("Cache share:", (df["cached"].sum() / df["input"].sum()).round(2))What the first run gave in a real project: email classification was taking more than a third of the weekly spend at zero edit cost, while small script tasks took a tenth at three iterations on average. After targeted context delivery and rewritten briefs, the classification share dropped to single-digit percentages, the average number of iterations per project fell to one and a half, and the monthly slice of “price per completed task” became flat for the first time. From this follows a working rule: the summary script lives next to the journal, and its output is read before any conversation about upgrading a plan or switching a model. The intervention threshold is simple: any pivot that grows two weeks in a row opens a conversation about framing or routing, not about buying a more expensive subscription. The “cycle day” column has a separate effect: by tying spending to the reset calendar, you will see what share of requests falls on fresh quota windows and how much volume burns away unused at the end of the period.
Frequently asked questions
Isn’t writing to a spreadsheet lazy? The script wrapper writes by itself; by hand — only the edit “note”. Discipline worth a minute a day.
Cache tokens separately? Yes: the cached column shows whether cache-friendliness works — otherwise the accounting lies about efficiency.
A team — what access? A shared sheet with view rights for everyone and edit rights for the journal keeper; a weekly 15-minute review at the retrospective.
Log privacy? The journal holds task labels, not prompt content; the prompts themselves are not stored in the table.
How often should the summary be reviewed? A weekly look at the pivots and a monthly slice of “price per task” are enough: trends are visible even at that frequency. Daily control is needed only after changing a model, provider, or plan — until the spending profile settles and the day’s peaks are matched against quota windows.
Should cached tokens count toward the price? Yes, but at the provider’s rate: cached tokens are usually noticeably cheaper than input ones, and accounting “at full price” overstates spending and hides the effect of cache-friendliness. A separate coefficient in the calculation column is enough — the formula changes once, and after that the script does the counting.
What to do about gaps in the journal? An honest empty row beats guesswork: mark the skipped day and the reason — a wrapper crash, a manual run outside the script, a vacation. Gaps themselves become an analytics column: if there are many, it is the wrapper that gets fixed, not the performer’s discipline. If the gap repeats every week on the same day — the cause is systemic, and you should look for it in the scheduler, not in people.
When can the table be trimmed? Once a project has reached a stable routine on fixed limits, the full schema may be squeezed down to three columns — date, task, price. The full set becomes useful again when changing a model, provider, or plan: restoring it from the old journal is easy, and the “note” column always stays. The trimmed version lives in the same workbook on a separate sheet, so returning to the full schema is a matter of a single link.
A spending table is a dashboard that turns “it seems” into numbers. The schema above is ready for copying; the first week of filling it in will show more than a month of discussions. The methodology is current as of autumn 2026.
