From 36edc37ad73caf4c32a56ca9da102b5be4340927 Mon Sep 17 00:00:00 2001 From: Ino de Bruijn Date: Tue, 11 Aug 2026 21:33:53 +0000 Subject: [PATCH] tx: add claude-sonnet-5 pricing entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/data-schemas/src/methods/tx.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/data-schemas/src/methods/tx.ts b/packages/data-schemas/src/methods/tx.ts index 37e519baf4e..56da291fc30 100644 --- a/packages/data-schemas/src/methods/tx.ts +++ b/packages/data-schemas/src/methods/tx.ts @@ -172,6 +172,7 @@ export const tokenValues: Record 'claude-sonnet-4': { prompt: 3, completion: 15 }, 'claude-sonnet-4-5': { prompt: 3, completion: 15 }, 'claude-sonnet-4-6': { prompt: 3, completion: 15 }, + 'claude-sonnet-5': { prompt: 2, completion: 10 }, 'command-r': { prompt: 0.5, completion: 1.5 }, 'command-r-plus': { prompt: 3, completion: 15 }, 'command-text': { prompt: 1.5, completion: 2.0 }, @@ -305,6 +306,7 @@ export const cacheTokenValues: Record = 'claude-sonnet-4': { write: 3.75, read: 0.3 }, 'claude-sonnet-4-5': { write: 3.75, read: 0.3 }, 'claude-sonnet-4-6': { write: 3.75, read: 0.3 }, + 'claude-sonnet-5': { write: 2.5, read: 0.2 }, 'claude-opus-4': { write: 18.75, read: 1.5 }, 'claude-opus-4-5': { write: 6.25, read: 0.5 }, 'claude-opus-4-6': { write: 6.25, read: 0.5 },