Skip to content

fix: add explicit pricing for Opus 4.8 (claude-opus-4-8)#134

Merged
phuryn merged 1 commit into
phuryn:mainfrom
Ninhache:fix/opus-4-8-pricing
Jun 15, 2026
Merged

fix: add explicit pricing for Opus 4.8 (claude-opus-4-8)#134
phuryn merged 1 commit into
phuryn:mainfrom
Ninhache:fix/opus-4-8-pricing

Conversation

@Ninhache

@Ninhache Ninhache commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an explicit pricing entry for Opus 4.8 (claude-opus-4-8), which was missing from both pricing tables. Closes #133.

Before this change, cost for claude-opus-4-8 was only computed via the generic opus substring fallback, which returned the 4.7 rate. The numbers happened to be correct (4.8 has the same API pricing as 4.7), but:

  • the newest/most-used Opus model wasn't listed explicitly like 4-7/4-6/4-5;
  • if 4.8 were ever priced differently, costs would silently be wrong;
  • the opus catch-all fallback pointed at a previous model.

Changes

  • cli.py — add claude-opus-4-8 to PRICING; point the opus fallback at claude-opus-4-8
  • dashboard.py — add claude-opus-4-8 to the JS PRICING; point the opus fallback at claude-opus-4-8
  • README.md — add the claude-opus-4-8 row to the cost table
  • tests/test_cli.py — add claude-opus-4-8 to the known-models list + a regression guard (test_opus_4_8_has_explicit_entry)

Rates match Opus 4.7 (verified against claude.com/pricing#api): $5 input, $25 output, $0.50 cache read, $6.25 cache write per MTok.

Testing

  • python3 -m unittest discover -s tests — all green (incl. the new guard and the existing cli↔dashboard pricing-parity tests).

Opus 4.8 had no explicit entry in either pricing table; cost only
resolved via the generic 'opus' substring fallback to 4.7's rate.
Add claude-opus-4-8 (same rates as 4.7: $5/$25 in/out, $0.50 cache
read, $6.25 cache write) to cli.py PRICING, dashboard.py PRICING, and
the README cost table, and point the opus fallback at the latest model.

Adds a regression guard test. Closes phuryn#133.
phuryn added a commit that referenced this pull request Jun 15, 2026
The live CLI + dashboard pricing tables already carry claude-fable-5,
claude-mythos-5, and (via #134) claude-opus-4-8, but the README cost table
listed none of them and still said "as of April 2026". Add the three rows,
list fable/mythos in the "included models" note, and align the date with the
dashboard footnote (May 2026). Record both this and #134 under v1.2.6.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@phuryn

phuryn commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Merged to DEV (preserving your commit as the merge parent for credit) — ships in v1.2.6. There was a small conflict to resolve since v1.2.5 had just added the Fable/Mythos entries right where your Opus 4.8 lines land, but it slotted in cleanly alongside them. I also added the claude-opus-4-8 row (plus Fable/Mythos) to the README cost table in a follow-up so the docs match the code. Thanks @Ninhache! 🙏

@phuryn phuryn merged commit 0953021 into phuryn:main Jun 15, 2026
3 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.

Missing explicit pricing entry for Opus 4.8 (claude-opus-4-8)

2 participants