feat: add new context pricing tiers#1755
Merged
Merged
Conversation
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
Adds authored context pricing tiers so model configs can express long-context pricing at provider-specific thresholds instead of being tied to the legacy 200k field.
New Authored Format
Base pricing remains on
[cost]and continues to mean USD per 1M tokens:Additional context-based pricing is authored with
[[cost.tiers]]:The
context.minvalue is the request context threshold where that price applies. This allows thresholds like272_000,256_000,200_000, or provider-specific values without encoding them in the field name.Compatibility
[[cost.tiers]]for long-context pricing.[cost.context_over_200k]field.cost.context_over_200kwhen a single compatible open-ended context tier can be represented for legacy clients.cost.tiersdata for clients that want the exact threshold.Notes
cost.input,cost.output, and cache price fields are unchanged.experimental.modes.*; this PR only models automatic context-based price changes within a cost schedule.