Skip to content

feat(pricing): add Claude Sonnet 5 intro pricing entry - #60410

Closed
brunz-me wants to merge 1 commit into
NousResearch:mainfrom
brunz-me:feat/sonnet-5-pricing
Closed

feat(pricing): add Claude Sonnet 5 intro pricing entry#60410
brunz-me wants to merge 1 commit into
NousResearch:mainfrom
brunz-me:feat/sonnet-5-pricing

Conversation

@brunz-me

@brunz-me brunz-me commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Problem

Claude Sonnet 5 (claude-sonnet-5, launched 2026-06-30) has no entry in the official-docs pricing snapshot in agent/usage_pricing.py. Any session using it gets cost_status: unknown and estimated_cost_usd: 0.0, silently hiding real spend from hermes insights and any downstream cost-sync tooling.

Fix

Adds a PricingEntry for ("anthropic", "claude-sonnet-5") using the published introductory rate: $2/$10 per MTok in/out (cache read/write scaled the same way as sibling entries), effective through the 2026-08-31 intro window per Anthropic's pricing page. Left a comment flagging the entry needs bumping to $3/$15 after the intro window closes.

Testing

python -m pytest tests/agent/test_usage_pricing.py -q — 15 passed.

Source: https://platform.claude.com/docs/en/about-claude/pricing

Sonnet 5 launched 2026-06-30 with introductory pricing ($2/$10 per
MTok input/output) through 2026-08-31, after which it reverts to
$3/$15. The model had no entry in the official-docs pricing snapshot,
so any session on claude-sonnet-5 was tracked as cost_status=unknown
with $0 estimated cost -- silently hiding real spend from
hermes insights and any downstream cost sync.

Source: https://platform.claude.com/docs/en/about-claude/pricing
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/billing Account usage, credit usage, billing (cross-cutting) provider/anthropic Anthropic native Messages API labels Jul 7, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for identifying the missing native Anthropic pricing route. Current main supports anthropic/claude-sonnet-5 in hermes_cli/models.py:46, while agent/usage_pricing.py:660-661 routes it to the official snapshot and agent/usage_pricing.py:717-738 cannot find an entry; estimate_usage_cost() consequently returns unknown at agent/usage_pricing.py:928-930. The proposed values match Anthropic's current introductory pricing.

Problems

  • The diff changes only agent/usage_pricing.py; please add a regression test. tests/agent/test_usage_pricing.py:221-252 provides the existing pattern for a newly added pricing row.

Suggested changes

  • Exercise the native provider="anthropic" route with nonzero input, output, cache-read, and cache-write usage, asserting an estimated non-null result.

Automated hermes-sweeper review.

@teknium1 teknium1 added the sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users label Jul 15, 2026
teknium1 added a commit that referenced this pull request Jul 20, 2026
PR #55848 and #60410 both added an (anthropic, claude-sonnet-5) pricing
key; the later duplicate (/$15 standard rate) would silently win in
the dict literal. Keep the intro pricing entry ($2/$10 through
2026-08-31 per Anthropic docs) which carries the reversion note.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #67932 — your introductory-pricing commit was cherry-picked onto current main with your authorship preserved (rebase merge). Your entry (with the 2026-08-31 reversion note) was kept as the canonical Sonnet 5 pricing over a competing standard-rate entry. Thanks!

#67932

randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
PR NousResearch#55848 and NousResearch#60410 both added an (anthropic, claude-sonnet-5) pricing
key; the later duplicate (/$15 standard rate) would silently win in
the dict literal. Keep the intro pricing entry ($2/$10 through
2026-08-31 per Anthropic docs) which carries the reversion note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/billing Account usage, credit usage, billing (cross-cutting) comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have provider/anthropic Anthropic native Messages API sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants