Skip to content

feat(usage): support GPT-5.6 pricing and cache creation costs#326

Merged
seakee merged 4 commits into
mainfrom
feat/gpt-5-6-pricing
Jul 10, 2026
Merged

feat(usage): support GPT-5.6 pricing and cache creation costs#326
seakee merged 4 commits into
mainfrom
feat/gpt-5-6-pricing

Conversation

@seakee

@seakee seakee commented Jul 10, 2026

Copy link
Copy Markdown
Owner

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

  • Frontend panel
  • Manager Server
  • CPA panel mode
  • Full Docker mode
  • Native packages / release
  • Docs / Wiki
  • CI / build / tooling

Changes

  • Parse cache-creation usage fields and preserve per-request long-context token buckets through analytics and rollups.
  • Apply GPT-5.6 official fallback prices, cache read/write ratios, long-context multipliers, and Priority tier pricing.
  • Keep resolved/upstream models authoritative for billing behavior while retaining requested aliases as price fallbacks.
  • Persist whether individual model-price fields were configured so explicit zero-cost prices remain valid.
  • Extend manual model pricing with cache-read and cache-creation values and align frontend realtime calculations.
  • Make rollup schema upgrades and derived-data rebuilds atomic and retryable.

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

  • CPA panel mode: Realtime event estimates use the same GPT-5.6 behavior and configured-price semantics as Manager Server analytics.
  • Manager Server mode: Startup migration adds pricing metadata and long-context rollup columns, then rebuilds derived rollups from retained usage events.
  • Full Docker / native packages: Migration runs automatically on startup; no configuration changes are required.

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:

  • Revert the feature commits to restore the previous calculation paths. The additive SQLite columns can remain safely because older code ignores them.
  • Derived rollups can be regenerated from retained usage events after rollback if needed.

Verification

  • Type check
  • Lint
  • Tests
  • Build
  • Manual UI check
  • Docs/link check
  • Not applicable, docs-only

Commands / evidence:

npm run type-check
npm run lint
npm run test                         # 86 files, 728 tests
npm run manager-server:test
npm run build
npm --workspace apps/web run build:bundle
npm run check:demo-isolation
git diff --check origin/main..HEAD

Screenshots / Recordings

N/A. The visible change is limited to additional numeric cache-price fields and table columns; no screenshot was captured.

Docs

  • README updated
  • Wiki updated
  • Release notes needed
  • Not needed

Related

N/A

seakee added 4 commits July 10, 2026 21:36
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.
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