From 1fc595f10cda9c13fa0afd38c98c9fec1b869ae5 Mon Sep 17 00:00:00 2001 From: Sergey Galuza Date: Sun, 31 May 2026 20:23:14 +0200 Subject: [PATCH] docs(pricing): document legacy 4-7-thinking entry; cover tier metadata Final review polish: - Add an inline comment on the claude-opus-4-7-thinking registry entry explaining it is a pricing-only id kept for historical analytics data (no catalog model after Opus 4.7 moved to adaptive thinking levels), and why it carries no fast tier. - Add a test asserting applyServiceTier preserves the serviceTiers map on its result, guarding against a future simplification dropping it. Built [OnSteroids](https://onsteroids.ai) --- src/web-server/model-pricing.ts | 4 ++++ tests/unit/model-pricing.test.ts | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/web-server/model-pricing.ts b/src/web-server/model-pricing.ts index 25127406..7c01c32e 100644 --- a/src/web-server/model-pricing.ts +++ b/src/web-server/model-pricing.ts @@ -296,6 +296,10 @@ const PRICING_REGISTRY: Record = { fast: OPUS_46_47_FAST_RATES, }, }, + // Legacy pricing-only entry for historical analytics data; this id has no + // catalog model (Opus 4.7 moved to adaptive thinking levels in 84dc4e24, so + // there is no separate -thinking variant). Kept so older usage records still + // resolve to the correct rate. No fast tier: the id is never requested live. 'claude-opus-4-7-thinking': { inputPerMillion: 5.0, outputPerMillion: 25.0, diff --git a/tests/unit/model-pricing.test.ts b/tests/unit/model-pricing.test.ts index 95b6c7f1..16652330 100644 --- a/tests/unit/model-pricing.test.ts +++ b/tests/unit/model-pricing.test.ts @@ -223,6 +223,14 @@ describe('model-pricing', () => { expect(opus48fastDated.cacheReadPerMillion).toBe(1.0); }); + it('should preserve serviceTiers metadata when applying tier rates', () => { + // applyServiceTier must keep the serviceTiers map on the returned object + // so callers can still inspect available tiers after rate substitution. + const opus48fast = getModelPricing('claude-opus-4-8', { serviceTier: 'fast' }); + expect(opus48fast.serviceTiers).toBeDefined(); + expect(opus48fast.serviceTiers?.fast).toBeDefined(); + }); + it('should fall back to standard rates when serviceTier is unknown', () => { // Unknown tier names must not throw; revert to base pricing transparently. const opus48 = getModelPricing('claude-opus-4-8', { serviceTier: 'enterprise-mythos' });