Every call as sent, and what the file keeps
An agent sends the whole conversation again with every call, so a run's 40th call repeats its first 39. The store keeps each message and the tool list once, under the SHA-256 of its bytes, and each call as the list of its pieces.
Spend by repository, against the day's budget
Read from repo_budget, the policy's quota view. A gateway in front of the agents reads it before letting a run's next call through.
What happened
Newest first.
Where the input comes from
Each call's input split by source, from the precomputes source_tokens_day and source_cost_day: the system prompt, the tool list, the task, the agent's own earlier messages, or the output of a tool.
Each row shows cost, then input tokens. Replies are what the model wrote. Cost counts cached input at a tenth of the fresh price, so a source that repeats in every call costs less than its tokens suggest.
Runs, the costliest first
From the precomputes run_calls, run_input, run_cached, run_output and run_cost.
| Run and repository | Calls | Cost | Input | Cached | Output |
|---|
Tokens. Cached is the input the provider served from its prompt cache: all of the run's previous call, when that call was sent less than five minutes before.
Rebuild a call from the file
Pick a finished run and one of its calls. The page reads the call back with the trace_requests view, SQL alone, and compares it with the request as the agent sent it, which it builds on its own from the day's runs.
The policy
Two exact streams meter the calls: one event for each call, and one for each source of its input. The store's own tables sit beside them in the same file and go in with the same checkpoints.
Results
Finishing the day at full speed, then rebuilding every call and recounting every cost.
Every call and every cost, checked
The file against the day's runs. The page builds every request as the agent sent it and works out every call's tokens and cost on its own, from the runs and the policy's prices. It never reads the file for that.
The budget alert
What is in the file
Ask the file
The store and the meter are one plain SQLite file. Pick a question or write your own, then press Run (or Ctrl+Enter, ⌘+Enter on a Mac). It reads while the day is paused or finished.