Repository navigation
fix(providers): bill cached prompt tokens at the cached rate for the remaining Chat Completions providers - #10284
Open
waleedlatif1 wants to merge 3 commits into
Open
waleedlatif1 wants to merge 3 commits into
waleedlatif1 wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
…remaining Chat Completions providers
…red Chat Completions meter
waleedlatif1
force-pushed
the
fix/compat-cache-billing
branch
from
November 21, 2026 09:35
882f058 to
173b959
Compare
Contributor
[High impact] The PR appears safe to merge; no blocking issues were found. SummaryThe PR moves the remaining Chat Completions providers onto
No new actionable issues were found. Reviews (2) · Last reviewed commit: "test(providers): cover streamed cache hi..." · Reviewed by Greptile |
Collaborator
Author
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prompt_tokensat the input rate, overbilling every cached prompt token on models with acachedInputpricecreateChatCompletionUsageMeter, the same path Z.ai, Kimi, DeepSeek, Groq and xAI use, so cache hits bill at the cached rate and long-context tiers apply per calltokens.inputonly and would leave the cache-read split unbilledType of Change
Testing
cache-billing.test.ts: added Meta, Mistral, Sakana and Fireworks (shared path) rows; all four fail against the pre-fix providers and pass nowsettled-tool-streams.test.ts: every provider now prices each call, so the per-provider cost helper became one constantcacheRead: 0vitest run providers/(2,214 tests), biome,check:test-patterns,check:unused-exports,check:explicit-any, pre-push type-checkChecklist
test-auditauthoring gate)