feat(usage): support GPT-5.6 pricing and cache creation costs#326
Merged
Conversation
Add long-context token columns to usage rollups and persist explicit model-price configuration flags. Run schema changes, rollup resets, and checkpoint cleanup atomically so failed upgrades can retry without stale pricing data. Cover rollback, retry, and legacy zero-price migration behavior with SQLite regression tests.
Track whether prompt, completion, cache-read, and cache-creation prices were explicitly provided across API, SQLite, and sync sources. This distinguishes missing values from valid zero-cost pricing while remaining compatible with existing positive price records. Persist the configuration metadata through manual saves and synchronized LiteLLM or OpenRouter prices.
Parse cache-creation usage, preserve per-request long-context token buckets, and propagate them through analytics and rollup repositories. Apply GPT-5.6 family prices, long-context multipliers, and Priority processing while keeping resolved models authoritative over requested aliases. Add regression coverage for official fallbacks, explicit zero prices, cache ratios, aggregation, and service-tier behavior.
Align realtime cost estimates with backend GPT-5.6 cache creation, long-context, resolved-model, and Priority pricing behavior. Extend manual model pricing with cache-read and cache-creation values while preserving explicit zero-cost configuration. Update localized labels and add frontend regression coverage for official fallbacks and alias behavior.
This was referenced Jul 12, 2026
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
Add GPT-5.6 Sol, Terra, and Luna pricing support across Manager Server analytics and frontend realtime estimates.
Account for cache creation, long-context pricing, and Priority processing while preserving configured prices and resolved-model billing behavior.
Scope
Changes
User Impact
GPT-5.6 usage now reports more accurate estimated costs, including cache creation, long contexts, and Priority processing. Users can also configure cache-read and cache-creation prices explicitly, including zero-cost values.
Compatibility / Runtime Notes
Data / Security Notes
The migration clears only derived account-history and dashboard rollups and resets their checkpoints so they can be rebuilt from
usage_events. Raw usage events and security-sensitive configuration are not removed or exposed.Risk / Rollback
Risk level: Medium
Rollback notes:
Verification
Commands / evidence:
Screenshots / Recordings
N/A. The visible change is limited to additional numeric cache-price fields and table columns; no screenshot was captured.
Docs
Related
N/A