Repository navigation
给 Claude 系列模型添加价格 - #20
Merged
Merged
Conversation
- Built-in Anthropic Claude standard API rates (USD/1M, verified 2026-11-05): Fable 5.1/5, Mythos 5.1/5, Opus 5.5/5/4.8/4.7/4.6/4.5/4.1/4, Sonnet 5.5/5/4.6/4.5/4, Haiku 4.5. Flat across peak/off-peak; CNY at the fixed 6.76 rate. Haiku 5.5 is not listed (prompt-length tiered pricing). - Optional `cacheWrite` rate (5-minute TTL write price), also accepted in pricing.json; absent → cache-miss rate (DeepSeek unchanged). - normalizeModelId: lower-case, strip `anthropic/`, dotted Claude versions → hyphens; shared by host resolver, pricing.json and client snapshot. - matchPricingKey: exact, else longest prefix (order-independent); Claude keys only accept a dated snapshot suffix (-YYYYMMDD / -latest), so unlisted versions and -fast/-batch/Bedrock variants never borrow a sibling's rate. - Unlisted models whose id contains `claude` (incl. Bedrock ids and display names) resolve to zero rates with `unpriced: true` instead of the deepseek-flash fallback. pricingFor()/estimateCost() change accordingly. - UI: totals with unpriced rounds show `≥` plus a panel note; the $0/1M price line and $0 compaction cost are hidden; anomaly detection skips unpriced rounds. - Docs: README/README_ZH Claude section, CHANGELOG Unreleased entry (incl. DSH 0.2.2-rc.1 compatibility check), ARCHITECTURE resolver row.
Contributor
Author
|
@al-alsace /review |
Max-Samson
reviewed
Nov 6, 2026
Owner
There was a problem hiding this comment.
🔁 This review has been superseded. See the latest review.
RoundBars ignored ChartCost.unpriced, so rounds on unlisted Claude models rendered a $0 value label, a "total $0" aria label and a zero cost in token-mode tooltips. Label them Unpriced and add rendering regression tests.
Max-Samson
reviewed
Nov 7, 2026
Owner
There was a problem hiding this comment.
🔁 This review has been superseded. See the latest review.
Contributor
Author
|
@Max-Samson 看看有没有问题 |
Max-Samson
reviewed
Nov 7, 2026
Max-Samson
left a comment
Owner
There was a problem hiding this comment.
Code Review: ✅ APPROVE
Typecheck and all 72 tests pass, plus additional host/client parity and compaction checks. Claude rates match the official pricing table. The previously reported unpriced-chart issue is fixed and regression-tested.
Verdict: APPROVE — No actionable issues found in pricing resolution, cost propagation, aggregation, or rendering.
No issues found. Code looks good!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.