mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 12:28:22 +00:00
The generic provider's _native_pricing parses Venice's bespoke model_spec schema but read only pricing.input/output.usd, dropping cache_input.usd (e.g. deepseek-v4-1-flash: $0.0075/1M cache reads vs $0.375/1M input). With input_cache_read left at 0, billing's fallback priced cache reads at the FULL input rate — a ~50x overcharge on cache hits compared to what the upstream charges. cache_input.usd is now coerced with the same rules as the token rates; a malformed/negative cache rate is treated as absent (never carried), mirroring the OpenRouter rung's drop-don't-carry behaviour. Adds regression tests: cache rate carried through, and malformed cache rates (-, Infinity, non-numeric) dropped while the model still resolves.