From a241128e5a70cb75df9b7846f34f725ea84e4eeb Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 21 Aug 2026 22:54:09 +0200 Subject: fix: store per-turn token sums so searched turns price every round A searched turn makes one API call per search round and all of them are billed, but prompt_tokens/completion_tokens held only the last round's counts, so a searched turn under-reported its cost. The columns now hold the sum across rounds; usage_json keeps each round's raw usage block as a JSON array for external consumers to verify against. A single-round turn stores the same numbers as before. --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 416a84c..f53d167 100644 --- a/README.md +++ b/README.md @@ -312,11 +312,12 @@ web pages would compete with messages the user actually wrote. `provider` records which provider served the reply (`local` or a configured provider name), written when the reply finishes so history stays self-describing even if `config.toml` later renames or drops the provider. -`usage_json` keeps every round's raw usage block from the stream as a JSON -array — a searched turn makes one API call per search round, and each round -is billed separately, so all of them are kept verbatim and token details -beyond the two counts (e.g. cached or reasoning tokens on a cloud endpoint) -are recoverable later without re-guessing a field mapping. +`prompt_tokens` and `completion_tokens` hold the turn's totals summed across +every round — a searched turn makes one API call per search round and all of +them are billed, so the last round's counts alone would under-report it. +`usage_json` keeps each round's raw usage block as a JSON array, verbatim, so +token details beyond the two counts (e.g. cached or reasoning tokens on a +cloud endpoint) are recoverable later without re-guessing a field mapping. `reported_cost_usd` is the GUI's hand-entered-price estimate for that one reply (summed across rounds), stored as a sanity check for external consumers — it is approximate and never a source of truth; it stays NULL for -- cgit v1.2.3