Fix: Centralize Codex priority pricing#2175
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 7:56 PM ET / 23:56 UTC. Summary Reproducibility: yes. at the source-contract level: the PR multiplies Standard USD prices while the official documentation distinguishes ChatGPT credit consumption from API token billing. A high-confidence real-session reproduction is still missing. Review metrics: 3 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Define separate, documented accounting semantics for signed-in ChatGPT Fast credit estimates and API-key Priority token costs, preserve existing explicit rates until that boundary is approved, and validate the chosen path with a redacted real-session trace plus the displayed CodexBar result. Do we have a high-confidence way to reproduce the issue? Yes at the source-contract level: the PR multiplies Standard USD prices while the official documentation distinguishes ChatGPT credit consumption from API token billing. A high-confidence real-session reproduction is still missing. Is this the best way to solve the issue? Unclear. Centralizing the calculation and invalidating caches are maintainable choices, but one multiplier helper is not the best solution unless maintainers confirm that credit-derived and API-priced usage should share the same displayed USD semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a1fad485d668. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (4 earlier review cycles)
|
|
@clawsweeper 2x is incorrect, as far as I know it's 2.5x for GPT-5.5 and newer models. Do you have a source for the 2x cost aside from the error in code? |
|
@clawsweeper re-review The PR description now includes the explicit Codex Fast-mode contract (2x for GPT-5.4; 2.5x for GPT-5.5 and newer), authoritative Codex-specific sources, models.dev-first arithmetic, and end-to-end scanner proof. The prior 2x finding used API Priority Processing pricing; this change accounts for Codex Fast mode. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Correction to my prior comment: the API-rate-versus-credit-accounting distinction I asserted was unsupported and has been removed from the PR description. The intended contract is simply 2x for GPT-5.4 and 2.5x for GPT-5.5 and newer. Please evaluate the implementation and proof against that stated requirement. |
|
Could you provide an authoritative source for these priority-pricing multipliers—ideally an official pricing page, documentation, or a stable product contract that maps the rates to each model? Until that source is available, CodexBar should keep the existing explicit per-model rates. The previously asserted API-rate versus credit-accounting distinction was retracted, so it cannot support changing the pricing model on its own. Keeping this PR open for sourcing. |
|
5.5 was already inherently incorrect; OAI had that info available from launch to be 2.5x cost in priority mode. Latest docs reflect 5.6 is 2.5x as well, and was deducted using common sense beforehand since Sol follows 5.5's pricing. PR description updated with multiple sources. |
Summary
Multiplier contract and sources
The Codex Speed documentation directly states: GPT-5.6 and GPT-5.5 consume at 2.5x the Standard rate, while GPT-5.4 consumes at 2x.
The GPT-5.6 value was initially deduced from its continuation of GPT-5.5 pricing: GPT-5.5 is $5 input / $30 output per million tokens, and GPT-5.6 Sol is also $5 input / $30 output per million tokens. The current Codex Speed documentation now directly confirms that deduction by explicitly assigning GPT-5.6 the same 2.5x multiplier as GPT-5.5.
Behavior proof
models.dev-first calculation
The focused pricing fixture supplies a models.dev Standard total of
$0.000815for GPT-5.6 Sol. The helper returns:This proves the multiplier is applied after models.dev resolution rather than to stale bundled rates.
End-to-end scanner calculation
A redacted deterministic Codex Priority trace with 100 input tokens (20 cached) and 10 output tokens is scanned through
CostUsageScanner.loadDailyReport. With the injected models.dev GPT-5.5 rates:The scanner test exercises the session JSONL + Priority trace metadata join, models.dev price resolution, model breakdown, daily aggregation, and cache-writing path. Separate tests cover bundled legacy fallback, cached Priority surcharge reuse, cache invalidation, GPT-5.6 cache-write pricing, and the 272K long-context guard.
Validation
swift test --filter CostUsagePricingTests- 46 passedswift test --filter CostUsageScannerPriorityTests- 17 passedmake check- passedSDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.5.sdk make test- 638 selections passed across 54 groups