fix(storage,api): usage cost as per-turn delta of the sdk running total, backfill
This commit is contained in:
@@ -6,9 +6,10 @@ write goes through ``core/conversations``; the frontend only shapes JSON.
|
||||
bus as SSE with the same keepalive the markdown frontend uses, so a proxy
|
||||
never sees a silent socket.
|
||||
|
||||
Usage figures come from the ``usage`` table (one row per turn, API-price
|
||||
``cost_usd`` and per-model ``model_usage`` from the SDK's
|
||||
``ResultMessage``); subscription quotas come from ``rate_limits``
|
||||
Usage figures come from the ``usage`` table (one row per turn; API-price
|
||||
``cost_usd`` and per-model ``model_usage`` are per-turn deltas of the SDK's
|
||||
cumulative ``ResultMessage`` counters, see ``storage.append_usage``);
|
||||
subscription quotas come from ``rate_limits``
|
||||
(``RateLimitEvent``). The quota covers the whole subscription, so
|
||||
``/api/limits`` puts the gateway's own spend for the window next to it
|
||||
for calibration by eye.
|
||||
|
||||
Reference in New Issue
Block a user