Skip to content

fix(pricing): support GPT-5.5 tiered pricing#482

Open
IvGolovach wants to merge 2 commits intojunhoyeo:mainfrom
IvGolovach:codex/gpt-5-5-pricing-support-current-main
Open

fix(pricing): support GPT-5.5 tiered pricing#482
IvGolovach wants to merge 2 commits intojunhoyeo:mainfrom
IvGolovach:codex/gpt-5-5-pricing-support-current-main

Conversation

@IvGolovach
Copy link
Copy Markdown
Contributor

@IvGolovach IvGolovach commented Apr 28, 2026

Summary

  • Add support for GPT-5.5 pricing data that uses model-specific long-context tier fields, including above-272k token prices.
  • Preserve GPT-5.x model names in Wrapped output, including GPT-5.5, GPT-5.5 Pro, and GPT-5.5 XHigh variants.
  • Add regression coverage for GPT-5.5 lookup, tier suffix matching, tiered cost calculation, LiteLLM field deserialization, and provider inference.

Why

LiteLLM pricing metadata is not limited to the existing above-200k shape. Newer OpenAI model entries can expose additional above-threshold fields such as above-272k token prices. Without reading those fields, Tokscale can undercount long-context GPT-5.5 usage and display GPT-5.5-family models less precisely in Wrapped summaries.

Changes

  • Extend LiteLLM ModelPricing deserialization with 128k, 256k, and 272k input/output tier fields, plus 272k cache-read pricing.
  • Generalize tiered cost calculation so each token bucket uses the correct ordered threshold instead of assuming a single 200k breakpoint.
  • Keep existing 200k tier behavior while allowing models with different tier thresholds to price correctly.
  • Add GPT-5.5 lookup coverage and provider inference coverage.
  • Add Wrapped display formatting for GPT-5.x model names without collapsing minor versions.
  • Include a narrow clippy cleanup in the Antigravity macOS path lookup so this branch passes the repository's strict lint job on current main.

Validation

  • bash scripts/check-version-coherence.sh
    • Version coherence OK: 2.0.27
  • cargo test --workspace -- --quiet
    • 1131 passed; 0 failed; 2 ignored
  • cargo test --workspace --all-features -- --quiet
    • 1131 passed; 0 failed; 2 ignored
  • cargo fmt --all --check
  • /opt/homebrew/Cellar/rust/1.94.0/bin/cargo-clippy clippy --workspace --all-features -- -D warnings
  • git diff --check origin/main...HEAD

Branch Notes

  • Base: junhoyeo/tokscale@main (edc8ed1fca49ec4a6936e4d4e15ca45dfd442b8e at validation time)
  • Head: IvGolovach:codex/gpt-5-5-pricing-support-current-main
  • Branch status at validation time: 2 commits ahead, 0 commits behind origin/main

Risk

Low. The pricing change keeps the existing base-price and above-200k paths intact, adds support for additional LiteLLM fields, and covers the new behavior with focused unit tests.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
tokscale Ignored Ignored Preview Apr 28, 2026 3:33pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

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