From b692fe28d2df953fbad06ae3afe5cb7406379bf6 Mon Sep 17 00:00:00 2001 From: "Jose I. Paris" Date: Fri, 2 Oct 2026 01:03:36 +0200 Subject: [PATCH] chore(trace): update Claude pricing table Add pricing for claude-fable-5-1, claude-mythos-5-1, claude-opus-5-5 and claude-sonnet-5-5, and document their non-standard cache read multipliers. Assisted-by: Claude Code Signed-off-by: Jose I. Paris Chainloop-Trace-Sessions: ed8c3b94-8bad-4f12-b82c-b7db41053166 --- app/cli/internal/trace/claude/pricing.go | 2 +- app/cli/internal/trace/claude/pricing.json | 32 +++++++++++++++++-- app/cli/internal/trace/claude/pricing_test.go | 20 ++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/app/cli/internal/trace/claude/pricing.go b/app/cli/internal/trace/claude/pricing.go index 5bfcc40e1..0dd042eb4 100644 --- a/app/cli/internal/trace/claude/pricing.go +++ b/app/cli/internal/trace/claude/pricing.go @@ -31,7 +31,7 @@ type modelPricing struct { CacheWrite float64 `json:"cache_write"` // CacheWrite1h is the price per 1M tokens written to the 1-hour prompt cache tier (2x base input). CacheWrite1h float64 `json:"cache_write_1h"` - // CacheRead is the price per 1M tokens read from the prompt cache (0.1x base input). + // CacheRead is the price per 1M tokens read from the prompt cache (0.1x base input on most models; see pricing.json notes for exceptions). CacheRead float64 `json:"cache_read"` } diff --git a/app/cli/internal/trace/claude/pricing.json b/app/cli/internal/trace/claude/pricing.json index 7a3f989e9..60dac9b80 100644 --- a/app/cli/internal/trace/claude/pricing.json +++ b/app/cli/internal/trace/claude/pricing.json @@ -1,9 +1,23 @@ { - "version": "2026-08-28", + "version": "2026-10-02", "source": "https://platform.claude.com/docs/en/about-claude/pricing", - "notes": "cache_write = 5-minute tier (~1.25x base input). cache_write_1h = 1-hour tier (~2x base input). cache_read = ~0.1x base input. Multipliers are approximate; the published rates at the source URL are authoritative and may differ due to rounding (e.g. claude-3-haiku-20240307 cache_write is $0.30, not 0.25 * 1.25 = $0.3125).", + "notes": "cache_write = 5-minute tier (~1.25x base input). cache_write_1h = 1-hour tier (~2x base input). cache_read = ~0.1x base input (0.025x on claude-fable-5-1 / claude-mythos-5-1, 0.05x on claude-opus-5-5). Multipliers are approximate; the published rates at the source URL are authoritative and may differ due to rounding (e.g. claude-3-haiku-20240307 cache_write is $0.30, not 0.25 * 1.25 = $0.3125).", "default_model": "claude-sonnet-4-6", "models": { + "claude-fable-5-1": { + "input": 10.00, + "output": 50.00, + "cache_write": 12.50, + "cache_write_1h": 20.00, + "cache_read": 0.25 + }, + "claude-mythos-5-1": { + "input": 10.00, + "output": 50.00, + "cache_write": 12.50, + "cache_write_1h": 20.00, + "cache_read": 0.25 + }, "claude-fable-5": { "input": 10.00, "output": 50.00, @@ -18,6 +32,13 @@ "cache_write_1h": 20.00, "cache_read": 1.00 }, + "claude-opus-5-5": { + "input": 4.00, + "output": 20.00, + "cache_write": 5.00, + "cache_write_1h": 8.00, + "cache_read": 0.20 + }, "claude-opus-5": { "input": 5.00, "output": 25.00, @@ -46,6 +67,13 @@ "cache_write_1h": 10.00, "cache_read": 0.50 }, + "claude-sonnet-5-5": { + "input": 2.00, + "output": 10.00, + "cache_write": 2.50, + "cache_write_1h": 4.00, + "cache_read": 0.20 + }, "claude-sonnet-5": { "input": 2.00, "output": 10.00, diff --git a/app/cli/internal/trace/claude/pricing_test.go b/app/cli/internal/trace/claude/pricing_test.go index e76b5cd81..160b8d5ed 100644 --- a/app/cli/internal/trace/claude/pricing_test.go +++ b/app/cli/internal/trace/claude/pricing_test.go @@ -50,3 +50,23 @@ func TestPricingEmbedLoads(t *testing.T) { assert.Equal(t, 4.00, sonnet5.CacheWrite1h) assert.Equal(t, 0.20, sonnet5.CacheRead) } + +func TestPricingModelRates(t *testing.T) { + testCases := []struct { + model string + want modelPricing + }{ + {"claude-fable-5-1", modelPricing{Input: 10.00, Output: 50.00, CacheWrite: 12.50, CacheWrite1h: 20.00, CacheRead: 0.25}}, + {"claude-mythos-5-1", modelPricing{Input: 10.00, Output: 50.00, CacheWrite: 12.50, CacheWrite1h: 20.00, CacheRead: 0.25}}, + {"claude-opus-5-5", modelPricing{Input: 4.00, Output: 20.00, CacheWrite: 5.00, CacheWrite1h: 8.00, CacheRead: 0.20}}, + {"claude-sonnet-5-5", modelPricing{Input: 2.00, Output: 10.00, CacheWrite: 2.50, CacheWrite1h: 4.00, CacheRead: 0.20}}, + } + + for _, tc := range testCases { + t.Run(tc.model, func(t *testing.T) { + got, ok := pricing[tc.model] + require.True(t, ok, "expected %s in embedded pricing table", tc.model) + assert.Equal(t, tc.want, got) + }) + } +}