A cached prompt costs the cached rate
CI / test (push) Successful in 8m45s

cached_per_1k in a price charges the prompt tokens the answer counts as
cached_tokens at their own rate; zero keeps charging them as prompt tokens.
The count reaches the cost and not a column: CostMicros holds what it
changed. Cached beyond the prompt is clamped, an engine's miscount rather
than a refund. BACKLOG L5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-25 17:15:48 +01:00
1 parent 73e1bb6733
commit ed0d1ec0ad
12 files changed
+85 -11

No files matched your search

+4
View File
@@ -277,6 +277,10 @@ type Usage struct {
ServedModel string
PromptTokens int64
CompletionTokens int64
// CachedTokens is how many of PromptTokens the engine read from its
// cache, for the price of those. Not a column: what it changed is in
// CostMicros.
CachedTokens int64
// Images is how many pictures were made, for a request for them.
Images int64
// Meshes is how many 3D models were made.