Fresh-eyes pass: mid-2026 pricing, specific model matching, codex token fix - #3
Open
fielding wants to merge 3 commits into
Open
Fresh-eyes pass: mid-2026 pricing, specific model matching, codex token fix#3fielding wants to merge 3 commits into
fielding wants to merge 3 commits into
Conversation
The table was last updated 2026-02-05 and predates every model that now dominates real usage. Adds anthropic claude-fable-5 / claude-mythos-5 ($10/$50), claude-opus-4-8 / claude-opus-4-7 ($5/$25), claude-sonnet-5 / claude-sonnet-4-6 ($3/$15), and openai gpt-5.5 ($5/$30), gpt-5.4 ($2.50/$15), gpt-5.3-codex ($1.75/$14), with cache rates at the standard 1.25x write / 0.1x read multipliers. Before this, claude-opus-4-8 usage fuzzy-matched the legacy claude-opus-4 entry and was estimated at 3x the real price, while claude-fable-5 matched nothing and was silently excluded from totals. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xan5eRiAXvcnAVvXHejdTz
Fuzzy matching took the first table entry that was a substring of the model id, so matching depended on table order: any new model sharing a prefix with an older family (claude-opus-4-8 vs claude-opus-4) could resolve to the wrong rates. Pick the longest matching entry instead, and add a regression suite that pins the models seen in real mid-2026 Claude Code and Codex CLI logs to their correct bundled rates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xan5eRiAXvcnAVvXHejdTz
Codex token_count payloads satisfy total_tokens = input_tokens + output_tokens: cached_input_tokens is a subset of input_tokens and reasoning_output_tokens a subset of output_tokens. The collector was billing cached tokens twice (full input rate plus cache-read rate) and adding reasoning on top of output. With ~90% of real codex input served from cache, estimates ran ~5-7x high (gpt-5.3-codex all-time dropped from $1442 to $197 on this machine's data). Split cached out of input so it bills at the cache-read rate, keep output as reported, and cover the semantics with unit tests built from a real session log payload. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xan5eRiAXvcnAVvXHejdTz
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.
Assessment
Fresh-eyes review of thinktax as of July 2026 (last commit June 7). State of the project:
node_modules(npm cifixed it; nothing in-repo).message.usagewithinput_tokens/cache_creation_input_tokens/ etc.). The Codex collector parses currenttoken_countevents but mis-modeled their semantics (fixed here).claude-opus-4-8(61k log entries locally),claude-fable-5(13.8k),claude-sonnet-4-6,claude-opus-4-7,gpt-5.3-codex(14k),gpt-5.4. Two silent failure modes followed: opus-4-8 fuzzy-matched the legacyclaude-opus-4entry at $15/$75 (3x overestimate), and fable-5 matched nothing and was excluded from totals entirely.Changes
findPricingnow prefers the longest matching entry instead of first-in-table-order, so prefix families (claude-opus-4vsclaude-opus-4-8) can't mis-price each other. Regression tests pin every model seen in real local logs to its bundled rates.total_tokens = input_tokens + output_tokens;cached_input_tokensandreasoning_output_tokensare subsets. The collector was billing cached input twice (full rate + cache-read rate) and adding reasoning on top of output. With ~90% of codex input cached, estimates ran 5–7x high.Verification
npm test: 53 passing (was 37), including new codex-semantics tests built from a real session payload and a bundled-table regression suite.refresh+statusagainst real local data (~103k events): all current models resolve to their own entries; codex all-time estimate dropped from $2.1k-ish to ~$600 (gpt-5.3-codex $1442 → $197), consistent with the cached-input correction.Note: this branch is independent of #1 (billing-honesty work) and shouldn't conflict with it beyond trivial proximity.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xan5eRiAXvcnAVvXHejdTz