Commit Graph
5 Commits
Author SHA1 Message Date
lukaszraczylo cf1ae262d6 refactor(pricing): share one prompt token split 2026-11-26 01:55:17 +00:00
lukaszraczylo ee758d5d09 perf(limits): write prompt-cache counters for the model scope only 2026-11-26 01:55:06 +00:00
lukaszraczylo 2e687e90d9 fix(admin): read prompt-cache counters for returned rows only 2026-11-26 01:54:23 +00:00
lukaszraczylo fd8ca1e95a fix(admin): keep the legacy usage models shape for prompt-cache fields
The three prompt-cache fields are now optional pointers. Only the detail
view sets them, so the default response stays the same as before.
2026-11-26 01:08:48 +00:00
lukaszraczylo d661166eab feat(metrics): count prompt-cache tokens and savings per model
The gateway now counts cache-read, cache-write and uncached prompt tokens
per provider and model as a Prometheus counter. It also writes the read,
write and saved micro-USD totals to the Redis counters.

The admin usage models detail view returns the three totals per model.
Response-cache hits do not count, and free models save nothing.
2026-11-26 01:03:50 +00:00