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)
This commit is contained in:
Sergey Galuza
2026-05-31 20:23:14 +02:00
parent 5a79b47506
commit 1fc595f10c
2 changed files with 12 additions and 0 deletions
+4
View File
@@ -296,6 +296,10 @@ const PRICING_REGISTRY: Record<string, ModelPricing> = {
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,
+8
View File
@@ -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' });