Capture optional provider reported costs

This commit is contained in:
2026-11-22 18:25:32 +00:00
parent 6ed0e037c4
commit cd0e1f5d39
5 changed files with 66 additions and 2 deletions

View File

@@ -170,6 +170,9 @@ come from `usage.prompt_tokens_details.cache_write_tokens`; vLLM uses
its top-level `usage.cache_write_tokens` mapping. Missing, null, malformed,
fractional, or unrepresentable new details remain unknown without invalidating
otherwise usable content. Existing common count decoding remains strict.
OpenRouter's `usage.cost` is an optional USD amount; malformed or non-finite
amounts are ignored without invalidating content. The generic and vLLM
providers do not interpret that field.
Each common token field retains whether the provider reported a
non-null integer, including zero. Omitted and `null` fields are unknown for