Skip to content

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

Open
Ninhache wants to merge 1 commit into
phuryn:mainfrom
Ninhache:fix/opus-4-8-pricing
Open

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

Conversation

@Ninhache
Copy link
Copy Markdown

@Ninhache Ninhache commented Jun 2, 2026

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.
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)

1 participant