Skip to content

feat: add Claude Fable 5 pricing#136

Closed
iliaal wants to merge 1 commit into
phuryn:mainfrom
iliaal:feat/fable-5-pricing
Closed

feat: add Claude Fable 5 pricing#136
iliaal wants to merge 1 commit into
phuryn:mainfrom
iliaal:feat/fable-5-pricing

Conversation

@iliaal

@iliaal iliaal commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

What

Adds pricing for Claude Fable 5, the new tier above Opus.

Model Input Output Cache write Cache read
claude-fable-5 $10.00/MTok $50.00/MTok $12.50/MTok $1.00/MTok

Input and output rates are from the Fable 5 announcement. Cache rates follow the same multipliers every other row uses (read = input × 0.1, write = input × 1.25).

Why

Fable usage matches none of the existing pricing keywords, so get_pricing returns None and calc_cost bills it at $0. The dashboard also drops it from billable totals. Tokens show up, but cost reads as $0 / n/a.

Changes

  • cli.py / dashboard.py: a claude-fable-5 row in both PRICING tables, plus a fable substring fallback so date-suffixed ids (e.g. claude-fable-5-20260601) resolve. The two tables stay in sync, which the existing sync test enforces.
  • dashboard.py: fable now counts in isBillable, resolves in getPricing, and sorts first in modelPriority as the top tier.
  • scanner.py: MODEL_PRIORITY gains fable: 4, so a session's primary model picks Fable over a subagent's Opus or Sonnet turn.
  • README.md: pricing table row and the included-keywords sentence.
  • Tests: explicit-entry and fallback guards in test_cli.py, priority ordering in test_scanner.py. Suite is 107 passing.

Same shape as the Opus 4.8 pricing PR, with the added scanner.py priority bump that a new model family needs.

Fable 5 is a new tier above Opus, priced at $10/MTok input and $50/MTok
output (cache read $1.00, cache write $12.50). Without an entry it matched
no pricing keyword, so calc_cost billed it at $0 and the dashboard dropped
it from billable totals.

- Add claude-fable-5 to the PRICING tables in cli.py and dashboard.py,
  plus a "fable" substring fallback for date-suffixed ids
- Include fable in the dashboard billable filter and model sort, and in
  the scanner's session primary-model priority (above opus)
- Update the README pricing table and keyword list
- Add tests for the pricing entry, fallback, and priority ordering
@phuryn

phuryn commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Thanks @iliaal, and sorry for the duplicated effort. We added Claude Fable 5 (and Mythos 5) pricing independently in v1.2.5 (released today, 2026-06-15): both models are now explicit entries in cli.py and dashboard.py at 2x Opus, with a fable/mythos keyword fallback and pricing-parity tests.

Since that already shipped to main, I'm closing this one. Landing it that way is purely about timing, not a quality judgment on your PR — really appreciate you taking the time to send it. 🙏

@phuryn phuryn closed this Jun 15, 2026
phuryn added a commit that referenced this pull request Jun 15, 2026
The Rescan button's POST /api/rescan handler unlink()ed usage.db and
rebuilt from the JSONL transcripts on disk. That is data-loss by design:
Claude Code prunes old transcripts on a rolling basis (cleanupPeriodDays),
and usage.db — being append-only — is the only durable record of history
older than the on-disk retention window. Clicking Rescan once wiped every
day older than that window, with no warning and no backup.

Fix: /api/rescan now runs an incremental scanner.scan() WITHOUT unlinking
the DB (scan dedupes via the message_id index and only adds new turns, so
history is preserved). Unlike PR #138 we keep the button — it's the only
in-session way to ingest new turns, since auto-refresh only re-reads
/api/data. Reworded its tooltip to describe the additive behaviour.

Tests:
- test_api_rescan_is_non_destructive: seeds history with no on-disk JSONL,
  posts /api/rescan, asserts the rows survive (fails under the old wipe).
- test_fable_and_mythos_have_explicit_entries / _date_suffix / substring:
  lock in Fable/Mythos pricing (#136/#137 had no regression guard).

Co-Authored-By: OtoGodfrey <OtoGodfrey@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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