Skip to content

Add GPT-5.6 Sol/Terra/Luna Codex pricing#2023

Merged
steipete merged 7 commits into
steipete:mainfrom
0xSMW:codex/gpt-5.6-sol-terra-luna-pricing
Jul 10, 2026
Merged

Add GPT-5.6 Sol/Terra/Luna Codex pricing#2023
steipete merged 7 commits into
steipete:mainfrom
0xSMW:codex/gpt-5.6-sol-terra-luna-pricing

Conversation

@0xSMW

@0xSMW 0xSMW commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add bundled local-cost pricing for the three released GPT-5.6 tiers and map the unsuffixed public alias to the default tier.
  • Cover the complete published surface used by CodexBar: standard short-context, >272K long-context, cache-read, cache-write, output, and Priority/Fast pricing.
  • Preserve OpenAI's boundary that Priority excludes long-context requests: traced >272K rows stay attributed to the Priority bucket but use the published Standard long-context base cost, with no invented combined rate.
  • Keep models.dev authoritative when it supplies values. Fill bundled short-context omissions only, and use the bundled long-context tuple only when the catalog has no context block at all.
  • Fingerprint every effective pricing input. A changed catalog now invalidates unchanged Pi session caches and reparses every message, while a fetched-time-only change remains cache-stable.
  • Preserve contributor credit and document the user-visible fix in the changelog. Thanks @0xSMW!

Published rates (per 1M tokens)

Tier Input Cached Cache write Output Long input Long cached Long write Long output Priority input Priority cached Priority write Priority output
Sol $5 $0.50 $6.25 $30 $10 $1 $12.50 $45 $10 $1 $12.50 $60
Terra $2.50 $0.25 $3.125 $15 $5 $0.50 $6.25 $22.50 $5 $0.50 $6.25 $30
Luna $1 $0.10 $1.25 $6 $2 $0.20 $2.50 $9 $2 $0.20 $2.50 $12

Source: OpenAI pricing and the released model cards.

Verification

  • Rebased exact head 615276b8 on current main (5bee0172)
  • Focused pricing, scanner, models.dev, and unknown-model suites: 112 tests passed
  • make check
  • Full make test: all 595 selections and 50 groups passed; one slow unrelated group exceeded its batch budget and all 12 selections passed on automatic isolated retry
  • Independent exact-head review and range-diff review: clean
  • Signed debug package: exact commit prefix embedded, Developer ID signature verified, packaged CLI reports CodexBar 0.41.1
  • Exact packaged behavior proof with isolated synthetic Pi JSONL and no credentials, Keychain, browser state, or provider requests
    • 272,000 prompt tokens: $0.59625
    • 272,001 prompt tokens: $1.185005
    • rate-only catalog change repriced an unchanged Pi file from $1.781255 to $3.56251 and changed the pricing key
    • fetched-time-only change kept cost, pricing key, and scan timestamp stable

The changed behavior is local cost calculation, so the packaged CLI is the closest deterministic live surface; no provider or menu interaction is required.

Notes

  • Native Codex session events currently expose input, cached-input, and output counts. Cache-write billing applies wherever a source, such as Pi, supplies write counts.
  • Public Model Identifier Gate: PASS. Production names are released canonical identifiers; dated test variants are explicitly fictitious.
  • No dependencies added or updated.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1733c703cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift Outdated
Comment thread Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift Outdated
Comment thread Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift Outdated
Comment thread Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift
@0xSMW 0xSMW force-pushed the codex/gpt-5.6-sol-terra-luna-pricing branch from 69bdf55 to e20f9a8 Compare July 10, 2026 03:22
@0xSMW

0xSMW commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Review feedback addressed (e20f9a8)

All four Codex review threads were verified against OpenAI pricing / GPT-5.6 Sol model card and fixed:

Thread Verdict Fix
Cache-write 1.25× Correct — Pi folded writes into input at 1× Optional cache-write rates on CodexPricing; codexCostUSD(…, cacheWriteInputTokens:); Pi passes writes separately
Long-context >272K Correct — 2× in / 1.5× out full request thresholdTokens + above-threshold rates for Sol/Terra/Luna
Priority rates Correct — Priority tab shows 2× input Priority input/output/cache-read rates for all three tiers
gpt-5.6 alias Correct — alias routes to Sol normalizeCodexModelgpt-5.6-sol

Verification

swift test --filter CostUsagePricingTests   # 38 passed
swift test --filter PiSession               # 11 passed

Threads replied + resolved. Ready for re-review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e20f9a8f16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/PiSessionCostScanner.swift
Comment thread Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift
Comment thread Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift
@0xSMW

0xSMW commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Second review round addressed (8d2d038)

Thread Verdict Action
Invalidate stale Pi cached costs Correct Bump Pi cost cache v4 → v5 so complete costNanos rows reprice with cache-write rates
Priority cache-write 1.25× Correct Priority CodexPricing now sets write = priorityInput × 1.25 when base model has write rates
Wire cache writes into native Codex JSONL Not fixable yet Local token_count events only expose input / cached_input / output / reasoning_output — no cache_write_tokens in CLI logs (verified). Pi path already prices writes. Follow-up when CLI surfaces the field.

Verification

swift test --filter 'CostUsagePricingTests|PiSessionCostScannerTests'  # 51 passed

Threads replied + resolved.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d2d038560

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift Outdated
@0xSMW

0xSMW commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Third review round addressed

Thread Verdict Fix
Fall back all GPT-5.6 long-context rates from models.dev gaps Correct Bundle above-threshold input/output/cache-read rates when catalog omits context_over_200k but the 272K threshold is still applied

Verification

swift test --filter CostUsagePricingTests  # 40 passed

Thread replied + resolved.

@steipete

Copy link
Copy Markdown
Owner

Thanks — I independently verified the public GPT-5.6 Sol, Terra, and Luna model cards and OpenAI pricing table. The model IDs, gpt-5.6 → Sol alias, standard/cache-write/long-context/Priority rates, and 272K threshold are current, so this PR should stay open.

Before merge, please rebase onto current main; #2018 now conflicts in CHANGELOG.md and the generated parser hash. Preserve both changelog entries and regenerate the hash after resolving.

One repository-policy fix is also needed: the official cards currently list only the unsuffixed snapshots, so the *-2026-06-26 identifiers in CostUsagePricingTests.swift are not verified released model IDs. Please use the exact released IDs for pricing coverage, or an explicitly fictitious dated suffix such as 2099-01-01 for normalization-only coverage.

Please also refresh the PR summary, which still says flat rates/no long-context or Priority although HEAD now implements those paths. After rebasing, rerun the focused pricing/Pi tests, make check, and make test. The current head has only GitGuardian; we’ll re-review the exact rebased head once the full CI rollup is green.

@0xSMW 0xSMW force-pushed the codex/gpt-5.6-sol-terra-luna-pricing branch from c785ddf to 3d298e7 Compare July 10, 2026 06:19
@0xSMW

0xSMW commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the rate verification and the correction on the model identifiers.

  1. Rebased
  2. Updated model ID policy
  3. Refreshed PR summary
  4. Verification green

@steipete steipete force-pushed the codex/gpt-5.6-sol-terra-luna-pricing branch from 701d636 to fd72c50 Compare July 10, 2026 07:43
@steipete

Copy link
Copy Markdown
Owner

Exact-head proof for fd72c50fe3b09d83ac4093d648cc37cfbf27a24e:

  • Public Model Identifier Gate: PASS. Only the released GPT-5.6 tier IDs and public unsuffixed alias are used in production; dated normalization fixtures use an unmistakably fictitious year. The identifiers, alias, and rates match the current OpenAI model cards and pricing table.
  • Pricing semantics: the published short/long/cache-write/Priority rates are explicit; Priority remains unavailable above 272K, so traced long-context rows retain their bucket attribution while using Standard long-context base cost.
  • Focused suites: 150 pricing/scanner/cache tests passed, including all-tier boundaries, catalog authority/fallback, unchanged-file repricing, and fetched-time stability.
  • make check: passed; generated parser hash current.
  • Full make test: 594/594 selections, 50/50 groups, zero failures, retries, or timeouts.
  • Independent review: clean after rejecting an unsupported attempt to combine Standard-long and Priority-short pricing.
  • Signed packaged proof: debug bundle embeds fd72c50f, bundle ID com.steipete.codexbar.debug, valid Developer ID signature, packaged CLI CodexBar 0.41.1.
  • Source-blind isolated CLI behavior: 400,000 tokens priced at $1.00; changing only cache-write rate repriced the untouched Pi file to $1.40 and changed the pricing key; changing only fetchedAt kept $1.40, the pricing key, and scan timestamp stable. No credentials, Keychain, browser state, or provider requests.
  • Dependency freshness: N/A; no dependencies changed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd72c50fe3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift
0xSMW and others added 7 commits July 10, 2026 01:44
Local cost scanning already counts gpt-5.6-* tokens but left day totals understated without rates. Bundle preview pricing so Sol/Terra/Luna resolve without models.dev.
Address review: official long-context (>272K) and Priority rates, 1.25x
cache-write billing for Pi disjoint writes, and route gpt-5.6 to Sol.
Bump Pi session cost cache to v5 so GPT-5.6 rows reprice with 1.25x
cache-write rates, and apply the same multiplier on Priority input.
When models.dev has a GPT-5.6 hit without context_over_200k fields, still
apply bundled above-threshold input/output/cache-read rates with the 272K
threshold so long prompts are not under-billed at short rates.
Co-authored-by: Stephen <stephen@klu.ai>
Match AGENTS model-name policy: price coverage uses official unsuffixed
IDs; dated normalization uses explicitly fictitious 2099-01-01 suffixes.
@steipete steipete force-pushed the codex/gpt-5.6-sol-terra-luna-pricing branch from fd72c50 to 615276b Compare July 10, 2026 09:01
@steipete

Copy link
Copy Markdown
Owner

Exact rebased head 615276b8 is ready for hosted verification.

Proof:

  • Public Model Identifier Gate: PASS; released canonical production names only, with explicitly fictitious dated test variants.
  • Focused pricing/scanner/models.dev/unknown-model coverage: 112 tests passed.
  • make check: passed.
  • Full make test: all 595 selections and 50 groups passed. One unrelated slow group exceeded the batch timeout; all 12 selections passed on isolated retry.
  • Independent exact-head range-diff and code review: clean; every PR code/test blob is byte-identical to the previously proven head, and the only rebase difference is retained changelog context from Fix: Keep cost history chart steady while hovering #2016/Add Kimi K2 usage dashboard shortcut #1919.
  • Signed debug package: embedded 615276b8, bundle ID com.steipete.codexbar.debug, Developer ID Peter Steinberger / Y5PE65HELJ, packaged CLI 0.41.1.
  • Exact packaged live proof: 272,000-token boundary row $0.59625; 272,001-token long-context row $1.185005; a rate-only catalog change repriced the unchanged Pi file $1.781255 → $3.56251; fetched-time-only change kept cost, pricing key, and scan timestamp stable.
  • Live harness was fully isolated with synthetic Pi JSONL and a local cache; no provider, browser, Keychain, or ambient credentials.
  • Dependency freshness: no dependencies added or changed.

Hosted CI/security now applies to this exact synchronized head.

@steipete steipete merged commit aa40f1e into steipete:main Jul 10, 2026
9 checks 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.

2 participants