Skip to content

feat: add new context pricing tiers#1755

Merged
rekram1-node merged 7 commits into
devfrom
correct-context-tracking
May 12, 2026
Merged

feat: add new context pricing tiers#1755
rekram1-node merged 7 commits into
devfrom
correct-context-tracking

Conversation

@rekram1-node
Copy link
Copy Markdown
Collaborator

@rekram1-node rekram1-node commented May 11, 2026

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:

[cost]
input = 5
output = 25
cache_read = 0.5

Additional context-based pricing is authored with [[cost.tiers]]:

[[cost.tiers]]
context = { min = 272_000 }
input = 10
output = 45
cache_read = 1

The context.min value is the request context threshold where that price applies. This allows thresholds like 272_000, 256_000, 200_000, or provider-specific values without encoding them in the field name.

Compatibility

  • Authored TOML should use [[cost.tiers]] for long-context pricing.
  • Authored TOML rejects the old [cost.context_over_200k] field.
  • Generated/API output still includes cost.context_over_200k when a single compatible open-ended context tier can be represented for legacy clients.
  • The generated output also preserves the new cost.tiers data for clients that want the exact threshold.

Notes

  • Existing base cost.input, cost.output, and cache price fields are unchanged.
  • Invocation variants such as fast/slow modes remain under experimental.modes.*; this PR only models automatic context-based price changes within a cost schedule.

@rekram1-node rekram1-node changed the title feat: add new context tiers feat: add new context pricing tiers May 11, 2026
@rekram1-node rekram1-node merged commit 5e344de into dev May 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant