Skip to content

fix(pricing): add Claude Opus 4.8 to MODEL_PRICING dict#4

Open
ezwep wants to merge 2 commits into
mainfrom
fix/opus-4-8-pricing
Open

fix(pricing): add Claude Opus 4.8 to MODEL_PRICING dict#4
ezwep wants to merge 2 commits into
mainfrom
fix/opus-4-8-pricing

Conversation

@ezwep

@ezwep ezwep commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Companion to PR #1 (Opus 4.7). Without this, Opus 4.8 tokens silently return zero cost — masking the bulk of weekly spend on the dashboard.

On my local index (last 7 days):

  • 3.91 billion Opus 4.8 tokens → displayed as $0
  • Estimated real cost at Opus 4.7 rates: ~$9,200

Applied Opus 4.7 rates ($5 in / $25 out / $0.50 cache read / $6.25-$10 cache writes) following the same conservative-fallback pattern Vincent used for Opus 4.6→4.7. Also adds the `-latest` alias for forward-compat.

Test plan

  • `get_model_pricing("claude-opus-4-8")` returns the new entry
  • `get_model_pricing("claude-opus-4-8-latest")` resolves via alias
  • `estimate_message_cost_usd("claude-opus-4-8", usage)` returns priced=true
  • After reindex, dashboard cost totals reflect Opus 4.8 spend

ezwep added 2 commits April 27, 2026 10:56
- Replace UNION-then-date-sort with two FTS5 queries that yield BM25
  scores per matching session. Title hits get a 200pt boost so a query
  match in the conversation title outranks a body-only match.
- Add a "Best match" sort option (default for active searches) and
  preserve existing date/token/cost sorts when the user picks them.
- Pass the FTS5 snippet() output (with <mark> tags) back to the UI,
  rendered as a highlighted excerpt under each card so users can see
  why a session matches.
- Smarter query parser: multi-word input becomes implicit-AND with
  prefix matching on each token; quoted phrases, NEAR, NOT, and column
  filters still pass through to FTS5 verbatim.
- Surface invalid FTS syntax (e.g. unbalanced quotes) as an inline
  status banner under the search input instead of silently returning
  zero results.
- Return shape changed from list to {conversations, search} so the UI
  can show match counts and errors. Backward-compatible array fallback
  in the JS callsite.
Prior to this fix, all Opus 4.8 tokens returned (0.0, False) from
estimate_message_cost_usd — silently underestimating dashboard cost
totals. On the local index this masked ~3.9B Opus 4.8 tokens / week
that should have surfaced as a real spend in the high-four-figures
range.

Applied Opus 4.7 rates as conservative fallback ($5/$25 input/output,
$0.50 cache read, $6.25/$10 cache writes) following the established
pattern from PR #1 (Opus 4.7 fallback). Anthropic typically holds
pricing constant across minor version bumps so this is a safe default
until verified against the public pricing page.

Also added -latest alias for forward-compat.
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