Skip to content

tx: add claude-sonnet-5 pricing entries - #34

Merged
inodb merged 1 commit into
v0.8.7-custom-v1from
sonnet-5-pricing
Aug 11, 2026
Merged

tx: add claude-sonnet-5 pricing entries#34
inodb merged 1 commit into
v0.8.7-custom-v1from
sonnet-5-pricing

Conversation

@inodb

@inodb inodb commented Aug 11, 2026

Copy link
Copy Markdown
Member

Two-line addition to packages/data-schemas/src/methods/tx.ts matching upstream main's post-v0.8.7 pricing additions for Sonnet 5:

  • Base rates: prompt: 2, completion: 10 (per MTok, promo)
  • Cache rates: write: 2.5, read: 0.2 (per MTok, promo)

Why

Prod flipped all 6 modelSpec agents to us.anthropic.claude-sonnet-5 today. Our fork's tx.ts pricing table was missing the entry, so LibreChat's balance-meter fallback (defaultRate = 6) was charging users a flat $6/M for BOTH input and output. That over-counts cached input especially — the 40k system-prompt prefix gets billed at 60x its actual read rate.

Net effect: users hit their 20M (203) or 80M (666) weekly token cap faster than they should.

Post-Sept 1 note

Anthropic's promo pricing ends 2026-08-31. On Sept 1 the rate flips to $3/$15 base + $3.75/$0.30 cache. Upstream may or may not push the update on that date — check back around then and bump these constants if upstream lags.

Match upstream main's post-v0.8.7 additions. Rates are the current
promotional pricing (through 2026-08-31):
- base: $2 prompt / $10 completion per MTok
- cache: $2.50 write / $0.20 read per MTok

Without these entries, LibreChat's balance meter falls back to
`defaultRate = 6` for both prompt and completion — flat $6/M applied
to Sonnet 5 traffic instead of the correct 2/10 split. That over-meters
input tokens (esp. the cached 40k system-prompt prefix) so users hit
the balance cap earlier than the actual AWS spend justifies.

Post-2026-09-01 the Anthropic rate flips to $3/$15 + $3.75/$0.30 cache.
Upstream may or may not update these constants on that date — worth
re-checking around then.
@inodb
inodb merged commit d89391d into v0.8.7-custom-v1 Aug 11, 2026
17 of 18 checks passed
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