feat(admin): show prompt-cache hit rate per model

The usage model table and the model panel now show the prompt-cache hit rate. The Cost avoided card shows the prompt-cache saving as a separate line. The mock admin API fixtures carry the new fields.
This commit is contained in:
2026-11-26 01:15:54 +00:00
parent fd8ca1e95a
commit c14ce25ce0
31 changed files with 2416 additions and 586 deletions
+4
View File
@@ -561,6 +561,10 @@ export interface AdminUsageModelEntry {
/** Cache hits/savings for this model today — present only when `detail=1` AND AdminFeaturesView.cacheStats is on (admin.go). cacheSavedMicroUsd is micro-USD, same unit as costMicroUsd. */
cacheHits?: number
cacheSavedMicroUsd?: number
/** Provider prompt-cache usage — `detail=1` only (admin.go). Read/write are input-token counts; saved is micro-USD vs full input price. */
promptCacheReadTokens?: number
promptCacheWriteTokens?: number
promptCacheSavedMicroUsd?: number
/** Count of 402 (unpriced-refusal) responses for this model today — `detail=1` only (admin.go). */
r402?: number
/** This model's billing price source — `detail=1` only (admin.go). */