Skip to content

chore(v1.10): price-table + model-alias refresh - #74

Merged
jameskhair-code merged 1 commit into
mainfrom
chore/v1.10-price-refresh
Jun 11, 2026
Merged

jameskhair-code merged 1 commit into
mainfrom
chore/v1.10-price-refresh

Conversation

@jameskhair-code

Copy link
Copy Markdown
Owner

Item 2 of the v1.10 preflight (docs/planning/v1.10-charter.md). Prices verified against the live Anthropic pricing docs (platform.claude.com/docs/en/about-claude/pricing) on 2026-06-10 — not from memory.

What changed

usage.py:_PRICES — two real errors fixed:

  • The single claude-opus-4 prefix entry carried $15/$75 (Opus 4.0/4.1-era rates). Opus 4.5 through 4.8 actually bill at $5/$25 (cache read $0.50, 5m cache write $6.25). The table now has per-version entries for claude-opus-4-5/-6/-7/-8 at the new rates; longest-prefix matching keeps the bare claude-opus-4 entry as the $15/$75 fallback for 4.0/4.1 dated IDs (e.g. claude-opus-4-20250514). Net effect: anything billed at latest was being over-estimated 3×.
  • claude-haiku-4 carried $0.80/$4.00 — those are Haiku 3.5 rates. Haiku 4.5 is $1/$5 (read $0.10, write $1.25).
  • Sonnet 4.x unchanged at $3/$15. The 3.x legacy entries stay (correct as written) so old usage-log replays keep pricing.

models.py — latest rolls claude-opus-4-7 → claude-opus-4-8 (the current Opus; same API surface as 4.7). _DEPRECATED_MODELS seeded from Anthropic's deprecation schedule: claude-opus-4-1 (retires 2026-08-05), claude-opus-4-20250514 / claude-sonnet-4-20250514 (retire 2026-06-15), claude-3-haiku-20240307 (retired). fast/legacy unchanged; no docs/config changes needed — they reference aliases only, and the real config.json pins claude-sonnet-4-6 explicitly so nothing changes behavior today.

The campaign model decision (James picks)

Projected cost for one full sweep of the four measured AI steps over ~5,000 books, from usage.jsonl history (228 calls, all Sonnet 4.6) — per-call averages divided by each step's default batch size, priced at verified rates. The Opus column includes a +30% token adjustment for the 4.7+ tokenizer (docs say "up to 35% more tokens").

Step per-book tokens (in/out/cache-write/cache-read) Opus 4.8 Sonnet 4.6 Haiku 4.5
clean-titles 48 / 67 / 119 / 723 $19.64 $9.07 $3.02
lcc-enrich 107 / 86 / 620 / 169 $43.20 $19.94 $6.65
comments-enrich 159 / 503 / 1,205 / 289 $136.75 $63.11 $21.04
tags-enrich 64 / 32 / 54 / 108 $9.87 $4.56 $1.52
Full-library total ≈ $209 ≈ $97 ≈ $32

Per-book, all four steps: Opus $0.042 · Sonnet $0.019 · Haiku $0.006.

Caveats, stated honestly:

  • These skew high. History is dominated by small smoke batches, so fixed per-call overhead and cold cache writes are spread over fewer books than a real 250–500-book wave would amortize. Campaign-scale runs should land below these figures.
  • Not covered: the enrich-identifiers AI path (never run — no usage history; applies only to a subset of books) and the tags-cleanup pass (batches of 150, few calls — small). Both add to the total but not materially against the model deltas.
  • All history is Sonnet 4.6; cross-model figures assume the same token shape, which is the simplest honest projection available.

My read: comments-enrich is ~2/3 of total cost at any model, and the Opus-vs-Sonnet delta on the whole campaign is ~$110. The decision is recorded when you pick — including per-step mixes (e.g. Sonnet everywhere, Opus for comments only ≈ $170).

Verification

  • python -m pytest -q — 639 passed (3 price-pinned tests updated to the verified rates, including a new assertion that legacy Opus 4.0 IDs still resolve to $15).
  • Real-library smoke: clean-titles --limit 3 --dry-run shows a dollar estimate (≈ $0.04, cold-cache write dominated) with the refreshed table. A smoke on the chosen campaign model happens after your pick.

🤖 Generated with Claude Code

Prices verified against platform.claude.com pricing docs on 2026-06-10:
Opus 4.5+ repriced to $5/$25 (was billed at the 4.0/4.1-era $15/$75 via
the bare claude-opus-4 prefix); Haiku 4.5 corrected to $1/$5 (table had
the Haiku 3.5 rates). Per-version Opus entries take longest-prefix
precedence; the bare prefix keeps legacy rates for 4.0/4.1 dated IDs.

latest alias rolls claude-opus-4-7 -> claude-opus-4-8. Deprecation table
seeded from Anthropic deprecation schedule (opus-4-1, opus/sonnet
4-20250514, claude-3-haiku).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jameskhair-code
jameskhair-code merged commit 9e50c57 into main Jun 11, 2026
2 checks passed
@jameskhair-code
jameskhair-code deleted the chore/v1.10-price-refresh branch June 11, 2026 01:57
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