← AI Foundation

Cost accounting

ai-foundation · workzone

The platform meters every model call — who spent what, on what, and how much — to show spend and hold the budget. Accounting is end-to-end: one monetary aggregate by model, plus token attribution to people from the journals. Money is counted by model and by company; by person — for now, in tokens.

AI calls indexing · search
chat · agents
──▶ every call is metered
Accounting — two paths model_usage · aggregate
journals · attribution
──▶ the screen reads it
AI usage total · by person
by model · limits
model_usage — the platform’s full spend, in money journals — token attribution to a person
What we count and from where → AI usage

The screen shows four views; each has its own source, unit, and scope. One accounting circuit, four projections.

ViewSourceUnitScope
Company total model_usage · SUM over the period tokens + $ all functions
By employee journals: messages · agent_runs tokens chat + agents
By model model_usage · by model · function $ (input / output) all functions
Limits platform_settings tokens · $ caps + alert
Why two sources

Spend is written to two places not out of duplication, but because they answer different questions.

model_usage aggregate
  • accrues requests · input · output · cost by model · function · day
  • catches impersonal spend too — indexing and RAG search
  • the basis for “company total” and “by model”, in money
journals attribution

They overlap on chat and agents, but the aggregate is broader: it catches indexing and search, which can’t be attributed to a person. So “company total” ≠ the sum over people. Money per person requires splitting the input/output price across each message and run — that’s v2.

Periods and budget

The week, month, and year panorama is one and the same table under a different window.

v1 / v2 boundary
v1 Tokens everywhere; money by model and by company; the monthly budget alert; weekly token caps (agents — blocking, chat — informational).
v2 Budgets by org structure — caps and alerts not as two poles (whole company + person), but a full-fledged system of allocating tokens to teams and departments, by hierarchy. Money per person; trends, charts, and export; blocking chat over the cap; a daily user_usage aggregate as load grows.