diff --git a/src/web-server/model-pricing.ts b/src/web-server/model-pricing.ts index c8afc8e2..25127406 100644 --- a/src/web-server/model-pricing.ts +++ b/src/web-server/model-pricing.ts @@ -296,6 +296,12 @@ const PRICING_REGISTRY: Record = { fast: OPUS_46_47_FAST_RATES, }, }, + 'claude-opus-4-7-thinking': { + inputPerMillion: 5.0, + outputPerMillion: 25.0, + cacheCreationPerMillion: 6.25, + cacheReadPerMillion: 0.5, + }, // Claude 4.8 Opus ($5/$25) — fast mode ($10/$50, 2x premium per Anthropic docs) 'claude-opus-4-8': { inputPerMillion: 5.0, @@ -306,15 +312,6 @@ const PRICING_REGISTRY: Record = { fast: OPUS_48_FAST_RATES, }, }, - 'claude-opus-4-7-thinking': { - inputPerMillion: 5.0, - outputPerMillion: 25.0, - cacheCreationPerMillion: 6.25, - cacheReadPerMillion: 0.5, - serviceTiers: { - fast: OPUS_46_47_FAST_RATES, - }, - }, // --------------------------------------------------------------------------- // OpenAI Models - Source: better-ccusage diff --git a/tests/unit/model-pricing.test.ts b/tests/unit/model-pricing.test.ts index 653b5664..95b6c7f1 100644 --- a/tests/unit/model-pricing.test.ts +++ b/tests/unit/model-pricing.test.ts @@ -200,6 +200,17 @@ describe('model-pricing', () => { const opus47fast = getModelPricing('claude-opus-4-7', { serviceTier: 'fast' }); expect(opus47fast.inputPerMillion).toBe(30.0); expect(opus47fast.outputPerMillion).toBe(150.0); + expect(opus47fast.cacheCreationPerMillion).toBe(37.5); // 30 * 1.25 + expect(opus47fast.cacheReadPerMillion).toBe(3.0); // 30 * 0.1 + }); + + it('should return fast-tier pricing for Claude Opus 4.6 when serviceTier=fast', () => { + // Fast mode on 4.6 carries the same 6x premium as 4.7 ($30/$150). + const opus46fast = getModelPricing('claude-opus-4-6', { serviceTier: 'fast' }); + expect(opus46fast.inputPerMillion).toBe(30.0); + expect(opus46fast.outputPerMillion).toBe(150.0); + expect(opus46fast.cacheCreationPerMillion).toBe(37.5); // 30 * 1.25 + expect(opus46fast.cacheReadPerMillion).toBe(3.0); // 30 * 0.1 }); it('should apply fast-tier pricing together with date-suffix stripping', () => {