@@ -3,6 +3,9 @@ import type { ModelInfo } from "../model.js"
33// https://docs.anthropic.com/en/docs/about-claude/models
44// https://platform.claude.com/docs/en/about-claude/pricing
55
6+ // Every entry here is an Anthropic-hosted Claude model, and 1h cache writes are GA
7+ // on all active Claude models, so each one advertises both TTL classes. The 5m class
8+ // is the vendor default and is never emitted explicitly (ADR-0006 I3).
69export type AnthropicModelId = keyof typeof anthropicModels
710export const anthropicDefaultModelId : AnthropicModelId = "claude-sonnet-4-5"
811export const ANTHROPIC_API_PROTOCOL = "anthropic"
@@ -13,6 +16,7 @@ export const anthropicModels = {
1316 contextWindow : 200_000 , // Default 200K, extendable to 1M with beta flag 'context-1m-2025-08-07'
1417 supportsImages : true ,
1518 supportsPromptCache : true ,
19+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
1620 inputPrice : 3.0 , // $3 per million input tokens (≤200K context)
1721 outputPrice : 15.0 , // $15 per million output tokens (≤200K context)
1822 cacheWritesPrice : 3.75 , // $3.75 per million tokens
@@ -36,6 +40,7 @@ export const anthropicModels = {
3640 contextWindow : 1_000_000 , // 1M context window native (no beta header required)
3741 supportsImages : true ,
3842 supportsPromptCache : true ,
43+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
3944 inputPrice : 2.0 , // $2 per million input tokens (introductory pricing through Aug 31, 2026)
4045 outputPrice : 10.0 , // $10 per million output tokens (introductory pricing through Aug 31, 2026)
4146 cacheWritesPrice : 2.5 , // $2.50 per million tokens (introductory pricing through Aug 31, 2026)
@@ -56,6 +61,7 @@ export const anthropicModels = {
5661 contextWindow : 200_000 , // Default 200K, extendable to 1M with beta flag 'context-1m-2025-08-07'
5762 supportsImages : true ,
5863 supportsPromptCache : true ,
64+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
5965 inputPrice : 3.0 , // $3 per million input tokens (≤200K context)
6066 outputPrice : 15.0 , // $15 per million output tokens (≤200K context)
6167 cacheWritesPrice : 3.75 , // $3.75 per million tokens
@@ -79,6 +85,7 @@ export const anthropicModels = {
7985 contextWindow : 200_000 , // Default 200K, extendable to 1M with beta flag 'context-1m-2025-08-07'
8086 supportsImages : true ,
8187 supportsPromptCache : true ,
88+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
8289 inputPrice : 3.0 , // $3 per million input tokens (≤200K context)
8390 outputPrice : 15.0 , // $15 per million output tokens (≤200K context)
8491 cacheWritesPrice : 3.75 , // $3.75 per million tokens
@@ -102,6 +109,7 @@ export const anthropicModels = {
102109 contextWindow : 200_000 , // Default 200K, extendable to 1M with beta flag
103110 supportsImages : true ,
104111 supportsPromptCache : true ,
112+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
105113 inputPrice : 5.0 , // $5 per million input tokens (≤200K context)
106114 outputPrice : 25.0 , // $25 per million output tokens (≤200K context)
107115 cacheWritesPrice : 6.25 , // $6.25 per million tokens
@@ -125,6 +133,7 @@ export const anthropicModels = {
125133 contextWindow : 1_000_000 ,
126134 supportsImages : true ,
127135 supportsPromptCache : true ,
136+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
128137 inputPrice : 5.0 , // $5 per million input tokens
129138 outputPrice : 25.0 , // $25 per million output tokens
130139 cacheWritesPrice : 6.25 , // $6.25 per million tokens
@@ -143,6 +152,7 @@ export const anthropicModels = {
143152 contextWindow : 1_000_000 , // 1M context window native (no beta header required, same as 4.7)
144153 supportsImages : true ,
145154 supportsPromptCache : true ,
155+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
146156 inputPrice : 5.0 , // $5 per million input tokens (regular tier)
147157 outputPrice : 25.0 , // $25 per million output tokens (regular tier)
148158 cacheWritesPrice : 6.25 , // $6.25 per million tokens
@@ -162,6 +172,7 @@ export const anthropicModels = {
162172 contextWindow : 1_000_000 , // 1M context window native (no beta header required)
163173 supportsImages : true ,
164174 supportsPromptCache : true ,
175+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
165176 inputPrice : 5.0 , // $5 per million input tokens
166177 outputPrice : 25.0 , // $25 per million output tokens
167178 cacheWritesPrice : 6.25 , // $6.25 per million tokens
@@ -181,6 +192,7 @@ export const anthropicModels = {
181192 contextWindow : 1_000_000 , // 1M context window native (no beta header required)
182193 supportsImages : true ,
183194 supportsPromptCache : true ,
195+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
184196 inputPrice : 4.0 , // $4 per million input tokens
185197 outputPrice : 20.0 , // $20 per million output tokens
186198 cacheWritesPrice : 5.0 , // $5 per million tokens
@@ -197,6 +209,7 @@ export const anthropicModels = {
197209 contextWindow : 1_000_000 , // 1M context window native (no beta header required)
198210 supportsImages : true ,
199211 supportsPromptCache : true ,
212+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
200213 // Standard pricing (prompts of 100,000 tokens or fewer) from Anthropic's
201214 // pricing page. Prompts over 100,000 tokens bill at tiered rates
202215 // ($0.50 in / $2.50 out / $0.625 5m cache write / $0.05 cache read per
@@ -222,6 +235,7 @@ export const anthropicModels = {
222235 contextWindow : 1_000_000 ,
223236 supportsImages : true ,
224237 supportsPromptCache : true ,
238+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
225239 inputPrice : 10.0 , // $10 per million input tokens
226240 outputPrice : 50.0 , // $50 per million output tokens
227241 cacheWritesPrice : 12.5 , // $12.50 per million tokens (5-minute cache)
@@ -240,6 +254,7 @@ export const anthropicModels = {
240254 contextWindow : 1_000_000 ,
241255 supportsImages : true ,
242256 supportsPromptCache : true ,
257+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
243258 inputPrice : 10.0 , // $10 per million input tokens
244259 outputPrice : 50.0 , // $50 per million output tokens
245260 cacheWritesPrice : 12.5 , // $12.50 per million tokens
@@ -258,6 +273,7 @@ export const anthropicModels = {
258273 contextWindow : 200_000 ,
259274 supportsImages : true ,
260275 supportsPromptCache : true ,
276+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
261277 inputPrice : 5.0 , // $5 per million input tokens
262278 outputPrice : 25.0 , // $25 per million output tokens
263279 cacheWritesPrice : 6.25 , // $6.25 per million tokens
@@ -270,6 +286,7 @@ export const anthropicModels = {
270286 contextWindow : 200_000 ,
271287 supportsImages : true ,
272288 supportsPromptCache : true ,
289+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
273290 inputPrice : 15.0 , // $15 per million input tokens
274291 outputPrice : 75.0 , // $75 per million output tokens
275292 cacheWritesPrice : 18.75 , // $18.75 per million tokens
@@ -282,6 +299,7 @@ export const anthropicModels = {
282299 contextWindow : 200_000 ,
283300 supportsImages : true ,
284301 supportsPromptCache : true ,
302+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
285303 inputPrice : 15.0 , // $15 per million input tokens
286304 outputPrice : 75.0 , // $75 per million output tokens
287305 cacheWritesPrice : 18.75 , // $18.75 per million tokens
@@ -294,6 +312,7 @@ export const anthropicModels = {
294312 contextWindow : 200_000 ,
295313 supportsImages : true ,
296314 supportsPromptCache : true ,
315+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
297316 inputPrice : 3.0 , // $3 per million input tokens
298317 outputPrice : 15.0 , // $15 per million output tokens
299318 cacheWritesPrice : 3.75 , // $3.75 per million tokens
@@ -307,6 +326,7 @@ export const anthropicModels = {
307326 contextWindow : 200_000 ,
308327 supportsImages : true ,
309328 supportsPromptCache : true ,
329+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
310330 inputPrice : 3.0 , // $3 per million input tokens
311331 outputPrice : 15.0 , // $15 per million output tokens
312332 cacheWritesPrice : 3.75 , // $3.75 per million tokens
@@ -318,6 +338,7 @@ export const anthropicModels = {
318338 contextWindow : 200_000 ,
319339 supportsImages : true ,
320340 supportsPromptCache : true ,
341+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
321342 inputPrice : 3.0 , // $3 per million input tokens
322343 outputPrice : 15.0 , // $15 per million output tokens
323344 cacheWritesPrice : 3.75 , // $3.75 per million tokens
@@ -329,6 +350,7 @@ export const anthropicModels = {
329350 contextWindow : 200_000 ,
330351 supportsImages : false ,
331352 supportsPromptCache : true ,
353+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
332354 inputPrice : 1.0 ,
333355 outputPrice : 5.0 ,
334356 cacheWritesPrice : 1.25 ,
@@ -340,6 +362,7 @@ export const anthropicModels = {
340362 contextWindow : 200_000 ,
341363 supportsImages : true ,
342364 supportsPromptCache : true ,
365+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
343366 inputPrice : 15.0 ,
344367 outputPrice : 75.0 ,
345368 cacheWritesPrice : 18.75 ,
@@ -351,6 +374,7 @@ export const anthropicModels = {
351374 contextWindow : 200_000 ,
352375 supportsImages : true ,
353376 supportsPromptCache : true ,
377+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
354378 inputPrice : 0.25 ,
355379 outputPrice : 1.25 ,
356380 cacheWritesPrice : 0.3 ,
@@ -362,6 +386,7 @@ export const anthropicModels = {
362386 contextWindow : 200_000 ,
363387 supportsImages : true ,
364388 supportsPromptCache : true ,
389+ promptCacheTtlSupport : [ "5m" , "1h" ] ,
365390 inputPrice : 1.0 ,
366391 outputPrice : 5.0 ,
367392 cacheWritesPrice : 1.25 ,
0 commit comments