@warlock.js/ai-anthropic 5.46.0 → 5.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.d.mts CHANGED
@@ -3,9 +3,10 @@ import { AnthropicCallOptions, AnthropicClearThinking, AnthropicClearToolUses, A
3
3
  import { AnthropicNonStreamingRequest, AnthropicRequest, AnthropicRequestOptions, AnthropicStreamingRequest } from "./request.type.mjs";
4
4
  import { AnthropicModel } from "./model.mjs";
5
5
  import { AnthropicSDK } from "./sdk.mjs";
6
- import { ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_MULTIPLIER, ANTHROPIC_MODEL_PRICING, ANTHROPIC_SERVER_TOOL_PRICING, anthropicPricingFor, withAnthropicCacheWriteRates } from "./known-pricing.mjs";
6
+ import { ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_MULTIPLIER, ANTHROPIC_MODEL_PRICING, ANTHROPIC_MODEL_PRICING_AS_OF, ANTHROPIC_SERVER_TOOL_PRICING, anthropicPricingFor, withAnthropicCacheWriteRates } from "./known-pricing.mjs";
7
+ import { ANTHROPIC_MODEL_LIFECYCLE, ANTHROPIC_MODEL_LIFECYCLE_AS_OF, anthropicLifecycleFor } from "./known-lifecycle.mjs";
7
8
  import { ANTHROPIC_BLOCK_FORMAT, fromProviderBlocks, toProviderBlocks } from "./utils/provider-blocks.mjs";
8
9
  import { AnthropicMessages, ToAnthropicMessagesOptions, toAnthropicMessages } from "./utils/to-anthropic-messages.mjs";
9
10
  import { toAnthropicTools } from "./utils/to-anthropic-tools.mjs";
10
11
  import "./utils/index.mjs";
11
- export { ANTHROPIC_BLOCK_FORMAT, ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_MULTIPLIER, ANTHROPIC_MODEL_PRICING, ANTHROPIC_SERVER_TOOL_PRICING, type AnthropicCallOptions, type AnthropicClearThinking, type AnthropicClearToolUses, type AnthropicContextManagement, type AnthropicMessages, AnthropicModel, type AnthropicModelConfig, type AnthropicNonStreamingRequest, type AnthropicRequest, type AnthropicRequestOptions, AnthropicSDK, type AnthropicSDKConfig, type AnthropicServerCompaction, type AnthropicStreamingRequest, type AnthropicThinkingMode, type ToAnthropicMessagesOptions, anthropicPricingFor, fromProviderBlocks, inferPreservedThinking, toAnthropicMessages, toAnthropicTools, toProviderBlocks, withAnthropicCacheWriteRates };
12
+ export { ANTHROPIC_BLOCK_FORMAT, ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_MULTIPLIER, ANTHROPIC_MODEL_LIFECYCLE, ANTHROPIC_MODEL_LIFECYCLE_AS_OF, ANTHROPIC_MODEL_PRICING, ANTHROPIC_MODEL_PRICING_AS_OF, ANTHROPIC_SERVER_TOOL_PRICING, type AnthropicCallOptions, type AnthropicClearThinking, type AnthropicClearToolUses, type AnthropicContextManagement, type AnthropicMessages, AnthropicModel, type AnthropicModelConfig, type AnthropicNonStreamingRequest, type AnthropicRequest, type AnthropicRequestOptions, AnthropicSDK, type AnthropicSDKConfig, type AnthropicServerCompaction, type AnthropicStreamingRequest, type AnthropicThinkingMode, type ToAnthropicMessagesOptions, anthropicLifecycleFor, anthropicPricingFor, fromProviderBlocks, inferPreservedThinking, toAnthropicMessages, toAnthropicTools, toProviderBlocks, withAnthropicCacheWriteRates };
package/esm/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_MULTIPLIER, ANTHROPIC_MODEL_PRICING, ANTHROPIC_SERVER_TOOL_PRICING, anthropicPricingFor, withAnthropicCacheWriteRates } from "./known-pricing.mjs";
1
+ import { ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_MULTIPLIER, ANTHROPIC_MODEL_PRICING, ANTHROPIC_MODEL_PRICING_AS_OF, ANTHROPIC_SERVER_TOOL_PRICING, anthropicPricingFor, withAnthropicCacheWriteRates } from "./known-pricing.mjs";
2
2
  import { inferPreservedThinking } from "./thinking-mode.mjs";
3
3
  import { ANTHROPIC_BLOCK_FORMAT, fromProviderBlocks, toProviderBlocks } from "./utils/provider-blocks.mjs";
4
4
  import { toAnthropicMessages } from "./utils/to-anthropic-messages.mjs";
@@ -6,5 +6,6 @@ import { toAnthropicTools } from "./utils/to-anthropic-tools.mjs";
6
6
  import "./utils/index.mjs";
7
7
  import { AnthropicModel } from "./model.mjs";
8
8
  import { AnthropicSDK } from "./sdk.mjs";
9
+ import { ANTHROPIC_MODEL_LIFECYCLE, ANTHROPIC_MODEL_LIFECYCLE_AS_OF, anthropicLifecycleFor } from "./known-lifecycle.mjs";
9
10
 
10
- export { ANTHROPIC_BLOCK_FORMAT, ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_MULTIPLIER, ANTHROPIC_MODEL_PRICING, ANTHROPIC_SERVER_TOOL_PRICING, AnthropicModel, AnthropicSDK, anthropicPricingFor, fromProviderBlocks, inferPreservedThinking, toAnthropicMessages, toAnthropicTools, toProviderBlocks, withAnthropicCacheWriteRates };
11
+ export { ANTHROPIC_BLOCK_FORMAT, ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_MULTIPLIER, ANTHROPIC_MODEL_LIFECYCLE, ANTHROPIC_MODEL_LIFECYCLE_AS_OF, ANTHROPIC_MODEL_PRICING, ANTHROPIC_MODEL_PRICING_AS_OF, ANTHROPIC_SERVER_TOOL_PRICING, AnthropicModel, AnthropicSDK, anthropicLifecycleFor, anthropicPricingFor, fromProviderBlocks, inferPreservedThinking, toAnthropicMessages, toAnthropicTools, toProviderBlocks, withAnthropicCacheWriteRates };
@@ -0,0 +1,24 @@
1
+ import { ModelLifecycle } from "@warlock.js/ai";
2
+ //#region ../../packages/ai-anthropic/src/known-lifecycle.d.ts
3
+ /**
4
+ * Where Anthropic's model-deprecations page puts the models in
5
+ * {@link ANTHROPIC_MODEL_PRICING}, as of {@link ANTHROPIC_MODEL_LIFECYCLE_AS_OF}.
6
+ * Active models carry no `retiresOn`: Anthropic documents only a
7
+ * "not sooner than" date for them.
8
+ *
9
+ * Source: https://platform.claude.com/docs/en/about-claude/model-deprecations
10
+ */
11
+ export declare const ANTHROPIC_MODEL_LIFECYCLE: Readonly<Record<string, ModelLifecycle>>;
12
+ /** The date {@link ANTHROPIC_MODEL_LIFECYCLE} was last checked against Anthropic's deprecations page. */
13
+ export declare const ANTHROPIC_MODEL_LIFECYCLE_AS_OF = "2026-11-06";
14
+ /**
15
+ * Look up the lifecycle of a Claude model id. Accepts the alias
16
+ * (`claude-sonnet-4-5`) or a dated snapshot (`claude-sonnet-4-5-20250929`).
17
+ * Returns `undefined` for an id the table does not cover.
18
+ *
19
+ * @example
20
+ * anthropicLifecycleFor("claude-sonnet-4-5-20250929"); // { status: "retiring", retiresOn: "2026-11-30", … }
21
+ */
22
+ export declare function anthropicLifecycleFor(modelName: string): ModelLifecycle | undefined;
23
+ //#endregion
24
+ //# sourceMappingURL=known-lifecycle.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"known-lifecycle.d.mts","names":[],"sources":["../../../../../../../packages/ai-anthropic/src/known-lifecycle.ts"],"mappings":";;;;;;;;;;qBAUa,2BAA2B,SAAS,eAAe;;qBAwCnD;;;;;;;;;wBAaG,sBAAsB,oBAAoB"}
@@ -0,0 +1,79 @@
1
+ //#region ../../packages/ai-anthropic/src/known-lifecycle.ts
2
+ /**
3
+ * Where Anthropic's model-deprecations page puts the models in
4
+ * {@link ANTHROPIC_MODEL_PRICING}, as of {@link ANTHROPIC_MODEL_LIFECYCLE_AS_OF}.
5
+ * Active models carry no `retiresOn`: Anthropic documents only a
6
+ * "not sooner than" date for them.
7
+ *
8
+ * Source: https://platform.claude.com/docs/en/about-claude/model-deprecations
9
+ */
10
+ const ANTHROPIC_MODEL_LIFECYCLE = {
11
+ "claude-fable-5-1": { status: "current" },
12
+ "claude-fable-5": { status: "current" },
13
+ "claude-opus-5-5": { status: "current" },
14
+ "claude-opus-5": { status: "current" },
15
+ "claude-opus-4-8": { status: "current" },
16
+ "claude-opus-4-7": { status: "current" },
17
+ "claude-opus-4-6": { status: "current" },
18
+ "claude-opus-4-5": { status: "current" },
19
+ "claude-sonnet-5-5": { status: "current" },
20
+ "claude-sonnet-5": { status: "current" },
21
+ "claude-sonnet-4-6": { status: "current" },
22
+ "claude-sonnet-4-5": {
23
+ status: "retiring",
24
+ retiresOn: "2026-11-30",
25
+ replacement: "claude-sonnet-5-5"
26
+ },
27
+ "claude-haiku-5-5": { status: "current" },
28
+ "claude-haiku-4-5": { status: "current" },
29
+ "claude-opus-4-1": {
30
+ status: "retired",
31
+ retiresOn: "2026-08-05",
32
+ replacement: "claude-opus-4-8"
33
+ },
34
+ "claude-opus-4": {
35
+ status: "retired",
36
+ retiresOn: "2026-06-15",
37
+ replacement: "claude-opus-4-8"
38
+ },
39
+ "claude-sonnet-4": {
40
+ status: "retired",
41
+ retiresOn: "2026-06-15",
42
+ replacement: "claude-sonnet-5-5"
43
+ },
44
+ "claude-3-7-sonnet": {
45
+ status: "retired",
46
+ retiresOn: "2026-02-19",
47
+ replacement: "claude-sonnet-5-5"
48
+ },
49
+ "claude-3-5-haiku": {
50
+ status: "retired",
51
+ retiresOn: "2026-02-19",
52
+ replacement: "claude-haiku-4-5"
53
+ },
54
+ "claude-3-haiku": {
55
+ status: "retired",
56
+ retiresOn: "2026-04-20",
57
+ replacement: "claude-haiku-4-5"
58
+ }
59
+ };
60
+ /** The date {@link ANTHROPIC_MODEL_LIFECYCLE} was last checked against Anthropic's deprecations page. */
61
+ const ANTHROPIC_MODEL_LIFECYCLE_AS_OF = "2026-11-06";
62
+ /** A trailing `-YYYYMMDD` snapshot date on a Claude model id. */
63
+ const SNAPSHOT_SUFFIX = /-\d{8}$/;
64
+ /**
65
+ * Look up the lifecycle of a Claude model id. Accepts the alias
66
+ * (`claude-sonnet-4-5`) or a dated snapshot (`claude-sonnet-4-5-20250929`).
67
+ * Returns `undefined` for an id the table does not cover.
68
+ *
69
+ * @example
70
+ * anthropicLifecycleFor("claude-sonnet-4-5-20250929"); // { status: "retiring", retiresOn: "2026-11-30", … }
71
+ */
72
+ function anthropicLifecycleFor(modelName) {
73
+ const id = Object.hasOwn(ANTHROPIC_MODEL_LIFECYCLE, modelName) ? modelName : modelName.replace(SNAPSHOT_SUFFIX, "");
74
+ return Object.hasOwn(ANTHROPIC_MODEL_LIFECYCLE, id) ? ANTHROPIC_MODEL_LIFECYCLE[id] : void 0;
75
+ }
76
+
77
+ //#endregion
78
+ export { ANTHROPIC_MODEL_LIFECYCLE, ANTHROPIC_MODEL_LIFECYCLE_AS_OF, anthropicLifecycleFor };
79
+ //# sourceMappingURL=known-lifecycle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"known-lifecycle.mjs","names":[],"sources":["../../../../../../../packages/ai-anthropic/src/known-lifecycle.ts"],"sourcesContent":["import type { ModelLifecycle } from \"@warlock.js/ai\";\n\n/**\n * Where Anthropic's model-deprecations page puts the models in\n * {@link ANTHROPIC_MODEL_PRICING}, as of {@link ANTHROPIC_MODEL_LIFECYCLE_AS_OF}.\n * Active models carry no `retiresOn`: Anthropic documents only a\n * \"not sooner than\" date for them.\n *\n * Source: https://platform.claude.com/docs/en/about-claude/model-deprecations\n */\nexport const ANTHROPIC_MODEL_LIFECYCLE: Readonly<Record<string, ModelLifecycle>> = {\n \"claude-fable-5-1\": { status: \"current\" },\n \"claude-fable-5\": { status: \"current\" },\n \"claude-opus-5-5\": { status: \"current\" },\n \"claude-opus-5\": { status: \"current\" },\n \"claude-opus-4-8\": { status: \"current\" },\n \"claude-opus-4-7\": { status: \"current\" },\n \"claude-opus-4-6\": { status: \"current\" },\n \"claude-opus-4-5\": { status: \"current\" },\n \"claude-sonnet-5-5\": { status: \"current\" },\n \"claude-sonnet-5\": { status: \"current\" },\n \"claude-sonnet-4-6\": { status: \"current\" },\n \"claude-sonnet-4-5\": {\n status: \"retiring\",\n retiresOn: \"2026-11-30\",\n replacement: \"claude-sonnet-5-5\",\n },\n \"claude-haiku-5-5\": { status: \"current\" },\n \"claude-haiku-4-5\": { status: \"current\" },\n \"claude-opus-4-1\": { status: \"retired\", retiresOn: \"2026-08-05\", replacement: \"claude-opus-4-8\" },\n \"claude-opus-4\": { status: \"retired\", retiresOn: \"2026-06-15\", replacement: \"claude-opus-4-8\" },\n \"claude-sonnet-4\": {\n status: \"retired\",\n retiresOn: \"2026-06-15\",\n replacement: \"claude-sonnet-5-5\",\n },\n \"claude-3-7-sonnet\": {\n status: \"retired\",\n retiresOn: \"2026-02-19\",\n replacement: \"claude-sonnet-5-5\",\n },\n \"claude-3-5-haiku\": {\n status: \"retired\",\n retiresOn: \"2026-02-19\",\n replacement: \"claude-haiku-4-5\",\n },\n \"claude-3-haiku\": { status: \"retired\", retiresOn: \"2026-04-20\", replacement: \"claude-haiku-4-5\" },\n};\n\n/** The date {@link ANTHROPIC_MODEL_LIFECYCLE} was last checked against Anthropic's deprecations page. */\nexport const ANTHROPIC_MODEL_LIFECYCLE_AS_OF = \"2026-11-06\";\n\n/** A trailing `-YYYYMMDD` snapshot date on a Claude model id. */\nconst SNAPSHOT_SUFFIX = /-\\d{8}$/;\n\n/**\n * Look up the lifecycle of a Claude model id. Accepts the alias\n * (`claude-sonnet-4-5`) or a dated snapshot (`claude-sonnet-4-5-20250929`).\n * Returns `undefined` for an id the table does not cover.\n *\n * @example\n * anthropicLifecycleFor(\"claude-sonnet-4-5-20250929\"); // { status: \"retiring\", retiresOn: \"2026-11-30\", … }\n */\nexport function anthropicLifecycleFor(modelName: string): ModelLifecycle | undefined {\n const id = Object.hasOwn(ANTHROPIC_MODEL_LIFECYCLE, modelName)\n ? modelName\n : modelName.replace(SNAPSHOT_SUFFIX, \"\");\n\n return Object.hasOwn(ANTHROPIC_MODEL_LIFECYCLE, id) ? ANTHROPIC_MODEL_LIFECYCLE[id] : undefined;\n}\n"],"mappings":";;;;;;;;;AAUA,MAAa,4BAAsE;CACjF,oBAAoB,EAAE,QAAQ,UAAU;CACxC,kBAAkB,EAAE,QAAQ,UAAU;CACtC,mBAAmB,EAAE,QAAQ,UAAU;CACvC,iBAAiB,EAAE,QAAQ,UAAU;CACrC,mBAAmB,EAAE,QAAQ,UAAU;CACvC,mBAAmB,EAAE,QAAQ,UAAU;CACvC,mBAAmB,EAAE,QAAQ,UAAU;CACvC,mBAAmB,EAAE,QAAQ,UAAU;CACvC,qBAAqB,EAAE,QAAQ,UAAU;CACzC,mBAAmB,EAAE,QAAQ,UAAU;CACvC,qBAAqB,EAAE,QAAQ,UAAU;CACzC,qBAAqB;EACnB,QAAQ;EACR,WAAW;EACX,aAAa;CACf;CACA,oBAAoB,EAAE,QAAQ,UAAU;CACxC,oBAAoB,EAAE,QAAQ,UAAU;CACxC,mBAAmB;EAAE,QAAQ;EAAW,WAAW;EAAc,aAAa;CAAkB;CAChG,iBAAiB;EAAE,QAAQ;EAAW,WAAW;EAAc,aAAa;CAAkB;CAC9F,mBAAmB;EACjB,QAAQ;EACR,WAAW;EACX,aAAa;CACf;CACA,qBAAqB;EACnB,QAAQ;EACR,WAAW;EACX,aAAa;CACf;CACA,oBAAoB;EAClB,QAAQ;EACR,WAAW;EACX,aAAa;CACf;CACA,kBAAkB;EAAE,QAAQ;EAAW,WAAW;EAAc,aAAa;CAAmB;AAClG;;AAGA,MAAa,kCAAkC;;AAG/C,MAAM,kBAAkB;;;;;;;;;AAUxB,SAAgB,sBAAsB,WAA+C;CACnF,MAAM,KAAK,OAAO,OAAO,2BAA2B,SAAS,IACzD,YACA,UAAU,QAAQ,iBAAiB,EAAE;CAEzC,OAAO,OAAO,OAAO,2BAA2B,EAAE,IAAI,0BAA0B,MAAM;AACxF"}
@@ -16,11 +16,12 @@ export declare const ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER = 2;
16
16
  * 5-minute write rate and `cacheWrite1h` the 1-hour write rate.
17
17
  *
18
18
  * Source: https://platform.claude.com/docs/en/about-claude/pricing,
19
- * "Model pricing" table, fetched 2026-10-17. Standard (global) routing,
20
- * non-batch. Not covered, so pass `pricing` yourself when you need them:
19
+ * "Model pricing" table, as of {@link ANTHROPIC_MODEL_PRICING_AS_OF}.
20
+ * Standard (global) routing, non-batch. Claude Haiku 5.5 carries `tiers`:
21
+ * a request whose prompt (cache reads and writes included) is over
22
+ * 100,000 tokens bills at the higher rates. Not covered, so pass `pricing`
23
+ * yourself when you need them:
21
24
  *
22
- * - Claude Haiku 5.5 — priced by prompt length (higher rates above
23
- * 100,000 prompt tokens), which a flat `ModelPricing` cannot express.
24
25
  * - US-only inference (`inference_geo: "us"`, 1.1x), fast mode, the Batch
25
26
  * API, and Claude on Bedrock / Vertex AI (partner-priced).
26
27
  * - Limited-availability models (Mythos) and retired models.
@@ -29,6 +30,8 @@ export declare const ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER = 2;
29
30
  * entry through {@link anthropicPricingFor}.
30
31
  */
31
32
  export declare const ANTHROPIC_MODEL_PRICING: Readonly<Record<string, ModelPricing>>;
33
+ /** The date the {@link ANTHROPIC_MODEL_PRICING} rates were last checked against Anthropic's pricing page. */
34
+ export declare const ANTHROPIC_MODEL_PRICING_AS_OF = "2026-11-06";
32
35
  /**
33
36
  * Look up the built-in list price for a Claude model id. Accepts the
34
37
  * alias (`claude-sonnet-4-5`) or a dated snapshot
@@ -37,7 +40,7 @@ export declare const ANTHROPIC_MODEL_PRICING: Readonly<Record<string, ModelPrici
37
40
  *
38
41
  * @example
39
42
  * anthropicPricingFor("claude-haiku-4-5-20251001"); // { input: 1, output: 5, … }
40
- * anthropicPricingFor("claude-haiku-5-5"); // undefined (prompt-length tiers)
43
+ * anthropicPricingFor("claude-haiku-5-5"); // { input: 0.1, output: 0.5, …, tiers: [...] }
41
44
  */
42
45
  export declare function anthropicPricingFor(modelName: string): ModelPricing | undefined;
43
46
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"known-pricing.d.mts","names":[],"sources":["../../../../../../../packages/ai-anthropic/src/known-pricing.ts"],"mappings":";;;;;;;;;;qBAUa;qBACA;;;;;;;;;;;;;;;;;;;qBAoBA,yBAAyB,SAAS,eAAe;;;;;;;;;;;wBA+C9C,oBAAoB,oBAAoB;;;;;;;;;;;;wBAqBxC,6BACd,SAAS,2BACR;;;;qBAmBU;EAAkC;EAAiB"}
1
+ {"version":3,"file":"known-pricing.d.mts","names":[],"sources":["../../../../../../../packages/ai-anthropic/src/known-pricing.ts"],"mappings":";;;;;;;;;;qBAUa;qBACA;;;;;;;;;;;;;;;;;;;;qBAqBA,yBAAyB,SAAS,eAAe;;qBAoDjD;;;;;;;;;;;wBAeG,oBAAoB,oBAAoB;;;;;;;;;;;;wBAqBxC,6BACd,SAAS,2BACR;;;;qBAmBU;EAAkC;EAAiB"}
@@ -15,11 +15,12 @@ const ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER = 2;
15
15
  * 5-minute write rate and `cacheWrite1h` the 1-hour write rate.
16
16
  *
17
17
  * Source: https://platform.claude.com/docs/en/about-claude/pricing,
18
- * "Model pricing" table, fetched 2026-10-17. Standard (global) routing,
19
- * non-batch. Not covered, so pass `pricing` yourself when you need them:
18
+ * "Model pricing" table, as of {@link ANTHROPIC_MODEL_PRICING_AS_OF}.
19
+ * Standard (global) routing, non-batch. Claude Haiku 5.5 carries `tiers`:
20
+ * a request whose prompt (cache reads and writes included) is over
21
+ * 100,000 tokens bills at the higher rates. Not covered, so pass `pricing`
22
+ * yourself when you need them:
20
23
  *
21
- * - Claude Haiku 5.5 — priced by prompt length (higher rates above
22
- * 100,000 prompt tokens), which a flat `ModelPricing` cannot express.
23
24
  * - US-only inference (`inference_geo: "us"`, 1.1x), fast mode, the Batch
24
25
  * API, and Claude on Bedrock / Vertex AI (partner-priced).
25
26
  * - Limited-availability models (Mythos) and retired models.
@@ -28,6 +29,21 @@ const ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER = 2;
28
29
  * entry through {@link anthropicPricingFor}.
29
30
  */
30
31
  const ANTHROPIC_MODEL_PRICING = {
32
+ "claude-haiku-5-5": {
33
+ input: .1,
34
+ output: .5,
35
+ cachedInput: .01,
36
+ cacheWrite: .125,
37
+ cacheWrite1h: .2,
38
+ tiers: [{
39
+ abovePromptTokens: 1e5,
40
+ input: .5,
41
+ output: 2.5,
42
+ cachedInput: .05,
43
+ cacheWrite: .625,
44
+ cacheWrite1h: 1
45
+ }]
46
+ },
31
47
  "claude-fable-5-1": {
32
48
  input: 10,
33
49
  output: 50,
@@ -120,6 +136,8 @@ const ANTHROPIC_MODEL_PRICING = {
120
136
  cacheWrite1h: 2
121
137
  }
122
138
  };
139
+ /** The date the {@link ANTHROPIC_MODEL_PRICING} rates were last checked against Anthropic's pricing page. */
140
+ const ANTHROPIC_MODEL_PRICING_AS_OF = "2026-11-06";
123
141
  /** A trailing `-YYYYMMDD` snapshot date on a Claude model id. */
124
142
  const SNAPSHOT_SUFFIX = /-\d{8}$/;
125
143
  /**
@@ -130,7 +148,7 @@ const SNAPSHOT_SUFFIX = /-\d{8}$/;
130
148
  *
131
149
  * @example
132
150
  * anthropicPricingFor("claude-haiku-4-5-20251001"); // { input: 1, output: 5, … }
133
- * anthropicPricingFor("claude-haiku-5-5"); // undefined (prompt-length tiers)
151
+ * anthropicPricingFor("claude-haiku-5-5"); // { input: 0.1, output: 0.5, …, tiers: [...] }
134
152
  */
135
153
  function anthropicPricingFor(modelName) {
136
154
  const exact = ANTHROPIC_MODEL_PRICING[modelName];
@@ -168,5 +186,5 @@ const ANTHROPIC_SERVER_TOOL_PRICING = {
168
186
  };
169
187
 
170
188
  //#endregion
171
- export { ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_MULTIPLIER, ANTHROPIC_MODEL_PRICING, ANTHROPIC_SERVER_TOOL_PRICING, anthropicPricingFor, withAnthropicCacheWriteRates };
189
+ export { ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_MULTIPLIER, ANTHROPIC_MODEL_PRICING, ANTHROPIC_MODEL_PRICING_AS_OF, ANTHROPIC_SERVER_TOOL_PRICING, anthropicPricingFor, withAnthropicCacheWriteRates };
172
190
  //# sourceMappingURL=known-pricing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"known-pricing.mjs","names":[],"sources":["../../../../../../../packages/ai-anthropic/src/known-pricing.ts"],"sourcesContent":["import type { ModelPricing } from \"@warlock.js/ai\";\n\n/**\n * Anthropic's prompt-cache write multipliers, relative to the base input\n * rate: a 5-minute write costs 1.25x, a 1-hour write 2x. They hold for\n * every Claude model on Anthropic's price list.\n *\n * Source: https://platform.claude.com/docs/en/about-claude/pricing\n * (fetched 2026-10-17).\n */\nexport const ANTHROPIC_CACHE_WRITE_MULTIPLIER = 1.25;\nexport const ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER = 2;\n\n/**\n * Built-in Claude API list prices, USD per 1,000,000 tokens, keyed by\n * model id. `cachedInput` is the cache-hit rate, `cacheWrite` the\n * 5-minute write rate and `cacheWrite1h` the 1-hour write rate.\n *\n * Source: https://platform.claude.com/docs/en/about-claude/pricing,\n * \"Model pricing\" table, fetched 2026-10-17. Standard (global) routing,\n * non-batch. Not covered, so pass `pricing` yourself when you need them:\n *\n * - Claude Haiku 5.5 — priced by prompt length (higher rates above\n * 100,000 prompt tokens), which a flat `ModelPricing` cannot express.\n * - US-only inference (`inference_geo: \"us\"`, 1.1x), fast mode, the Batch\n * API, and Claude on Bedrock / Vertex AI (partner-priced).\n * - Limited-availability models (Mythos) and retired models.\n *\n * Dated snapshot ids (`claude-haiku-4-5-20251001`) resolve to their alias\n * entry through {@link anthropicPricingFor}.\n */\nexport const ANTHROPIC_MODEL_PRICING: Readonly<Record<string, ModelPricing>> = {\n \"claude-fable-5-1\": {\n input: 10,\n output: 50,\n cachedInput: 0.25,\n cacheWrite: 12.5,\n cacheWrite1h: 20,\n },\n \"claude-fable-5\": { input: 10, output: 50, cachedInput: 1, cacheWrite: 12.5, cacheWrite1h: 20 },\n \"claude-opus-5-5\": { input: 4, output: 20, cachedInput: 0.2, cacheWrite: 5, cacheWrite1h: 8 },\n \"claude-opus-5\": { input: 5, output: 25, cachedInput: 0.5, cacheWrite: 6.25, cacheWrite1h: 10 },\n \"claude-opus-4-8\": { input: 5, output: 25, cachedInput: 0.5, cacheWrite: 6.25, cacheWrite1h: 10 },\n \"claude-opus-4-7\": { input: 5, output: 25, cachedInput: 0.5, cacheWrite: 6.25, cacheWrite1h: 10 },\n \"claude-opus-4-6\": { input: 5, output: 25, cachedInput: 0.5, cacheWrite: 6.25, cacheWrite1h: 10 },\n \"claude-opus-4-5\": { input: 5, output: 25, cachedInput: 0.5, cacheWrite: 6.25, cacheWrite1h: 10 },\n \"claude-sonnet-5-5\": { input: 2, output: 10, cachedInput: 0.1, cacheWrite: 2.5, cacheWrite1h: 4 },\n \"claude-sonnet-5\": { input: 2, output: 10, cachedInput: 0.2, cacheWrite: 2.5, cacheWrite1h: 4 },\n \"claude-sonnet-4-6\": {\n input: 3,\n output: 15,\n cachedInput: 0.3,\n cacheWrite: 3.75,\n cacheWrite1h: 6,\n },\n \"claude-sonnet-4-5\": {\n input: 3,\n output: 15,\n cachedInput: 0.3,\n cacheWrite: 3.75,\n cacheWrite1h: 6,\n },\n \"claude-haiku-4-5\": { input: 1, output: 5, cachedInput: 0.1, cacheWrite: 1.25, cacheWrite1h: 2 },\n};\n\n/** A trailing `-YYYYMMDD` snapshot date on a Claude model id. */\nconst SNAPSHOT_SUFFIX = /-\\d{8}$/;\n\n/**\n * Look up the built-in list price for a Claude model id. Accepts the\n * alias (`claude-sonnet-4-5`) or a dated snapshot\n * (`claude-sonnet-4-5-20250929`). Returns `undefined` for any id not in\n * {@link ANTHROPIC_MODEL_PRICING}, so cost stays unknown rather than wrong.\n *\n * @example\n * anthropicPricingFor(\"claude-haiku-4-5-20251001\"); // { input: 1, output: 5, … }\n * anthropicPricingFor(\"claude-haiku-5-5\"); // undefined (prompt-length tiers)\n */\nexport function anthropicPricingFor(modelName: string): ModelPricing | undefined {\n const exact = ANTHROPIC_MODEL_PRICING[modelName];\n\n if (exact) {\n return exact;\n }\n\n return ANTHROPIC_MODEL_PRICING[modelName.replace(SNAPSHOT_SUFFIX, \"\")];\n}\n\n/**\n * Fill the cache-write rates Anthropic derives from the input rate\n * (5-minute writes 1.25x, 1-hour writes 2x) into a pricing entry that\n * omits them, so a caller who supplies only `{ input, output }` is no\n * longer billed nothing for cache writes. Explicit rates always win; the\n * cache-read rate is left alone because it differs per model.\n *\n * @example\n * withAnthropicCacheWriteRates({ input: 3, output: 15 });\n * // { input: 3, output: 15, cacheWrite: 3.75, cacheWrite1h: 6 }\n */\nexport function withAnthropicCacheWriteRates(\n pricing: ModelPricing | undefined,\n): ModelPricing | undefined {\n if (!pricing) {\n return undefined;\n }\n\n const cacheWrite =\n pricing.cacheWrite ?? pricing.cachedOutput ?? pricing.input * ANTHROPIC_CACHE_WRITE_MULTIPLIER;\n const cacheWrite1h = pricing.cacheWrite1h ?? pricing.input * ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER;\n\n if (pricing.cacheWrite === cacheWrite && pricing.cacheWrite1h === cacheWrite1h) {\n return pricing;\n }\n\n return { ...pricing, cacheWrite, cacheWrite1h };\n}\n\n/** USD per request, verified 2026-10-18. Tokens are additional.\n * https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool#usage-and-pricing\n * https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-fetch-tool#usage-and-pricing */\nexport const ANTHROPIC_SERVER_TOOL_PRICING = { webSearch: 0.01, webFetch: 0 };\n"],"mappings":";;;;;;;;;AAUA,MAAa,mCAAmC;AAChD,MAAa,sCAAsC;;;;;;;;;;;;;;;;;;;AAoBnD,MAAa,0BAAkE;CAC7E,oBAAoB;EAClB,OAAO;EACP,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,cAAc;CAChB;CACA,kBAAkB;EAAE,OAAO;EAAI,QAAQ;EAAI,aAAa;EAAG,YAAY;EAAM,cAAc;CAAG;CAC9F,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAG,cAAc;CAAE;CAC5F,iBAAiB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAM,cAAc;CAAG;CAC9F,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAM,cAAc;CAAG;CAChG,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAM,cAAc;CAAG;CAChG,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAM,cAAc;CAAG;CAChG,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAM,cAAc;CAAG;CAChG,qBAAqB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAK,cAAc;CAAE;CAChG,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAK,cAAc;CAAE;CAC9F,qBAAqB;EACnB,OAAO;EACP,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,cAAc;CAChB;CACA,qBAAqB;EACnB,OAAO;EACP,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,cAAc;CAChB;CACA,oBAAoB;EAAE,OAAO;EAAG,QAAQ;EAAG,aAAa;EAAK,YAAY;EAAM,cAAc;CAAE;AACjG;;AAGA,MAAM,kBAAkB;;;;;;;;;;;AAYxB,SAAgB,oBAAoB,WAA6C;CAC/E,MAAM,QAAQ,wBAAwB;CAEtC,IAAI,OACF,OAAO;CAGT,OAAO,wBAAwB,UAAU,QAAQ,iBAAiB,EAAE;AACtE;;;;;;;;;;;;AAaA,SAAgB,6BACd,SAC0B;CAC1B,IAAI,CAAC,SACH;CAGF,MAAM,aACJ,QAAQ,cAAc,QAAQ,gBAAgB,QAAQ;CACxD,MAAM,eAAe,QAAQ,gBAAgB,QAAQ;CAErD,IAAI,QAAQ,eAAe,cAAc,QAAQ,iBAAiB,cAChE,OAAO;CAGT,OAAO;EAAE,GAAG;EAAS;EAAY;CAAa;AAChD;;;;AAKA,MAAa,gCAAgC;CAAE,WAAW;CAAM,UAAU;AAAE"}
1
+ {"version":3,"file":"known-pricing.mjs","names":[],"sources":["../../../../../../../packages/ai-anthropic/src/known-pricing.ts"],"sourcesContent":["import type { ModelPricing } from \"@warlock.js/ai\";\n\n/**\n * Anthropic's prompt-cache write multipliers, relative to the base input\n * rate: a 5-minute write costs 1.25x, a 1-hour write 2x. They hold for\n * every Claude model on Anthropic's price list.\n *\n * Source: https://platform.claude.com/docs/en/about-claude/pricing\n * (fetched 2026-10-17).\n */\nexport const ANTHROPIC_CACHE_WRITE_MULTIPLIER = 1.25;\nexport const ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER = 2;\n\n/**\n * Built-in Claude API list prices, USD per 1,000,000 tokens, keyed by\n * model id. `cachedInput` is the cache-hit rate, `cacheWrite` the\n * 5-minute write rate and `cacheWrite1h` the 1-hour write rate.\n *\n * Source: https://platform.claude.com/docs/en/about-claude/pricing,\n * \"Model pricing\" table, as of {@link ANTHROPIC_MODEL_PRICING_AS_OF}.\n * Standard (global) routing, non-batch. Claude Haiku 5.5 carries `tiers`:\n * a request whose prompt (cache reads and writes included) is over\n * 100,000 tokens bills at the higher rates. Not covered, so pass `pricing`\n * yourself when you need them:\n *\n * - US-only inference (`inference_geo: \"us\"`, 1.1x), fast mode, the Batch\n * API, and Claude on Bedrock / Vertex AI (partner-priced).\n * - Limited-availability models (Mythos) and retired models.\n *\n * Dated snapshot ids (`claude-haiku-4-5-20251001`) resolve to their alias\n * entry through {@link anthropicPricingFor}.\n */\nexport const ANTHROPIC_MODEL_PRICING: Readonly<Record<string, ModelPricing>> = {\n \"claude-haiku-5-5\": {\n input: 0.1,\n output: 0.5,\n cachedInput: 0.01,\n cacheWrite: 0.125,\n cacheWrite1h: 0.2,\n tiers: [\n {\n abovePromptTokens: 100_000,\n input: 0.5,\n output: 2.5,\n cachedInput: 0.05,\n cacheWrite: 0.625,\n cacheWrite1h: 1,\n },\n ],\n },\n \"claude-fable-5-1\": {\n input: 10,\n output: 50,\n cachedInput: 0.25,\n cacheWrite: 12.5,\n cacheWrite1h: 20,\n },\n \"claude-fable-5\": { input: 10, output: 50, cachedInput: 1, cacheWrite: 12.5, cacheWrite1h: 20 },\n \"claude-opus-5-5\": { input: 4, output: 20, cachedInput: 0.2, cacheWrite: 5, cacheWrite1h: 8 },\n \"claude-opus-5\": { input: 5, output: 25, cachedInput: 0.5, cacheWrite: 6.25, cacheWrite1h: 10 },\n \"claude-opus-4-8\": { input: 5, output: 25, cachedInput: 0.5, cacheWrite: 6.25, cacheWrite1h: 10 },\n \"claude-opus-4-7\": { input: 5, output: 25, cachedInput: 0.5, cacheWrite: 6.25, cacheWrite1h: 10 },\n \"claude-opus-4-6\": { input: 5, output: 25, cachedInput: 0.5, cacheWrite: 6.25, cacheWrite1h: 10 },\n \"claude-opus-4-5\": { input: 5, output: 25, cachedInput: 0.5, cacheWrite: 6.25, cacheWrite1h: 10 },\n \"claude-sonnet-5-5\": { input: 2, output: 10, cachedInput: 0.1, cacheWrite: 2.5, cacheWrite1h: 4 },\n \"claude-sonnet-5\": { input: 2, output: 10, cachedInput: 0.2, cacheWrite: 2.5, cacheWrite1h: 4 },\n \"claude-sonnet-4-6\": {\n input: 3,\n output: 15,\n cachedInput: 0.3,\n cacheWrite: 3.75,\n cacheWrite1h: 6,\n },\n \"claude-sonnet-4-5\": {\n input: 3,\n output: 15,\n cachedInput: 0.3,\n cacheWrite: 3.75,\n cacheWrite1h: 6,\n },\n \"claude-haiku-4-5\": { input: 1, output: 5, cachedInput: 0.1, cacheWrite: 1.25, cacheWrite1h: 2 },\n};\n\n/** The date the {@link ANTHROPIC_MODEL_PRICING} rates were last checked against Anthropic's pricing page. */\nexport const ANTHROPIC_MODEL_PRICING_AS_OF = \"2026-11-06\";\n\n/** A trailing `-YYYYMMDD` snapshot date on a Claude model id. */\nconst SNAPSHOT_SUFFIX = /-\\d{8}$/;\n\n/**\n * Look up the built-in list price for a Claude model id. Accepts the\n * alias (`claude-sonnet-4-5`) or a dated snapshot\n * (`claude-sonnet-4-5-20250929`). Returns `undefined` for any id not in\n * {@link ANTHROPIC_MODEL_PRICING}, so cost stays unknown rather than wrong.\n *\n * @example\n * anthropicPricingFor(\"claude-haiku-4-5-20251001\"); // { input: 1, output: 5, … }\n * anthropicPricingFor(\"claude-haiku-5-5\"); // { input: 0.1, output: 0.5, …, tiers: [...] }\n */\nexport function anthropicPricingFor(modelName: string): ModelPricing | undefined {\n const exact = ANTHROPIC_MODEL_PRICING[modelName];\n\n if (exact) {\n return exact;\n }\n\n return ANTHROPIC_MODEL_PRICING[modelName.replace(SNAPSHOT_SUFFIX, \"\")];\n}\n\n/**\n * Fill the cache-write rates Anthropic derives from the input rate\n * (5-minute writes 1.25x, 1-hour writes 2x) into a pricing entry that\n * omits them, so a caller who supplies only `{ input, output }` is no\n * longer billed nothing for cache writes. Explicit rates always win; the\n * cache-read rate is left alone because it differs per model.\n *\n * @example\n * withAnthropicCacheWriteRates({ input: 3, output: 15 });\n * // { input: 3, output: 15, cacheWrite: 3.75, cacheWrite1h: 6 }\n */\nexport function withAnthropicCacheWriteRates(\n pricing: ModelPricing | undefined,\n): ModelPricing | undefined {\n if (!pricing) {\n return undefined;\n }\n\n const cacheWrite =\n pricing.cacheWrite ?? pricing.cachedOutput ?? pricing.input * ANTHROPIC_CACHE_WRITE_MULTIPLIER;\n const cacheWrite1h = pricing.cacheWrite1h ?? pricing.input * ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER;\n\n if (pricing.cacheWrite === cacheWrite && pricing.cacheWrite1h === cacheWrite1h) {\n return pricing;\n }\n\n return { ...pricing, cacheWrite, cacheWrite1h };\n}\n\n/** USD per request, verified 2026-10-18. Tokens are additional.\n * https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool#usage-and-pricing\n * https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-fetch-tool#usage-and-pricing */\nexport const ANTHROPIC_SERVER_TOOL_PRICING = { webSearch: 0.01, webFetch: 0 };\n"],"mappings":";;;;;;;;;AAUA,MAAa,mCAAmC;AAChD,MAAa,sCAAsC;;;;;;;;;;;;;;;;;;;;AAqBnD,MAAa,0BAAkE;CAC7E,oBAAoB;EAClB,OAAO;EACP,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,cAAc;EACd,OAAO,CACL;GACE,mBAAmB;GACnB,OAAO;GACP,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;EAChB,CACF;CACF;CACA,oBAAoB;EAClB,OAAO;EACP,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,cAAc;CAChB;CACA,kBAAkB;EAAE,OAAO;EAAI,QAAQ;EAAI,aAAa;EAAG,YAAY;EAAM,cAAc;CAAG;CAC9F,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAG,cAAc;CAAE;CAC5F,iBAAiB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAM,cAAc;CAAG;CAC9F,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAM,cAAc;CAAG;CAChG,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAM,cAAc;CAAG;CAChG,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAM,cAAc;CAAG;CAChG,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAM,cAAc;CAAG;CAChG,qBAAqB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAK,cAAc;CAAE;CAChG,mBAAmB;EAAE,OAAO;EAAG,QAAQ;EAAI,aAAa;EAAK,YAAY;EAAK,cAAc;CAAE;CAC9F,qBAAqB;EACnB,OAAO;EACP,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,cAAc;CAChB;CACA,qBAAqB;EACnB,OAAO;EACP,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,cAAc;CAChB;CACA,oBAAoB;EAAE,OAAO;EAAG,QAAQ;EAAG,aAAa;EAAK,YAAY;EAAM,cAAc;CAAE;AACjG;;AAGA,MAAa,gCAAgC;;AAG7C,MAAM,kBAAkB;;;;;;;;;;;AAYxB,SAAgB,oBAAoB,WAA6C;CAC/E,MAAM,QAAQ,wBAAwB;CAEtC,IAAI,OACF,OAAO;CAGT,OAAO,wBAAwB,UAAU,QAAQ,iBAAiB,EAAE;AACtE;;;;;;;;;;;;AAaA,SAAgB,6BACd,SAC0B;CAC1B,IAAI,CAAC,SACH;CAGF,MAAM,aACJ,QAAQ,cAAc,QAAQ,gBAAgB,QAAQ;CACxD,MAAM,eAAe,QAAQ,gBAAgB,QAAQ;CAErD,IAAI,QAAQ,eAAe,cAAc,QAAQ,iBAAiB,cAChE,OAAO;CAGT,OAAO;EAAE,GAAG;EAAS;EAAY;CAAa;AAChD;;;;AAKA,MAAa,gCAAgC;CAAE,WAAW;CAAM,UAAU;AAAE"}
package/llms-full.txt CHANGED
@@ -82,9 +82,10 @@ withAnthropicCacheWriteRates({ input: 2, output: 10 }); // { input: 2, output: 1
82
82
  Object.keys(ANTHROPIC_MODEL_PRICING); // the priced ids
83
83
  ```
84
84
 
85
- - **Source.** `ANTHROPIC_MODEL_PRICING` holds the "Model pricing" table of https://platform.claude.com/docs/en/about-claude/pricing (fetched 2026-10-17): input, output, cache read (`cachedInput`), 5-minute write (`cacheWrite`) and 1-hour write (`cacheWrite1h`), USD per 1M tokens, standard global routing.
85
+ - **Source.** `ANTHROPIC_MODEL_PRICING` holds the "Model pricing" table of https://platform.claude.com/docs/en/about-claude/pricing (as of `ANTHROPIC_MODEL_PRICING_AS_OF`, 2026-11-06): input, output, cache read (`cachedInput`), 5-minute write (`cacheWrite`) and 1-hour write (`cacheWrite1h`), USD per 1M tokens, standard global routing. Claude Haiku 5.5 carries `tiers`: a prompt over 100,000 tokens (cache reads and writes counted) bills at the higher rates, which `computeCost` / `resolvePricing` from `@warlock.js/ai` apply.
86
+ - **Lifecycle.** `ANTHROPIC_MODEL_LIFECYCLE` / `anthropicLifecycleFor(name)` (alias or dated snapshot; checked `ANTHROPIC_MODEL_LIFECYCLE_AS_OF`) gives `{ status: "current" | "retiring" | "retired", retiresOn?, replacement? }` from https://platform.claude.com/docs/en/about-claude/model-deprecations. `claude-sonnet-4-5` is `retiring` on 2026-11-30 (replacement `claude-sonnet-5-5`); `claude-opus-4-1`, `claude-opus-4`, `claude-sonnet-4`, `claude-3-7-sonnet`, `claude-3-5-haiku` and `claude-3-haiku` are `retired`. Active models carry no `retiresOn` (Anthropic documents only a "not sooner than" date).
86
87
  - **Write rates are filled for you.** Anthropic charges 1.25x input for a 5-minute cache write and 2x for a 1-hour write on every Claude model, so any entry without `cacheWrite` / `cacheWrite1h` (your own `{ input, output }` included) gets them from those multipliers (`withAnthropicCacheWriteRates`, exported with `ANTHROPIC_CACHE_WRITE_MULTIPLIER` / `ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER`). The read rate differs per model (0.1x, 0.05x on Opus 5.5 / Sonnet 5.5, 0.025x on Fable 5.1), so it is never derived — set `cachedInput` yourself when you supply pricing, or cache reads bill at the full input rate.
87
- - **Deliberately unpriced** (pass `pricing` yourself): Claude Haiku 5.5 (priced by prompt length — higher rates above 100,000 prompt tokens, which a flat rate cannot express), US-only inference (`inference_geo: "us"`, 1.1x), fast mode, the Batch API, limited-availability and retired models, and Claude on Bedrock / Vertex (partner-priced — see `@warlock.js/ai-bedrock`).
88
+ - **Deliberately unpriced** (pass `pricing` yourself): US-only inference (`inference_geo: "us"`, 1.1x), fast mode, the Batch API, limited-availability and retired models, and Claude on Bedrock / Vertex (partner-priced — see `@warlock.js/ai-bedrock`).
88
89
 
89
90
  ## Tokens & usage accounting
90
91
 
package/package.json CHANGED
@@ -15,13 +15,13 @@
15
15
  "directory": "packages/ai-anthropic"
16
16
  },
17
17
  "peerDependencies": {
18
- "@warlock.js/ai": "5.46.0"
18
+ "@warlock.js/ai": "5.47.1"
19
19
  },
20
20
  "dependencies": {
21
21
  "@anthropic-ai/sdk": "^0.129.0",
22
- "@warlock.js/logger": "5.46.0"
22
+ "@warlock.js/logger": "5.47.1"
23
23
  },
24
- "version": "5.46.0",
24
+ "version": "5.47.1",
25
25
  "main": "./cjs/index.cjs",
26
26
  "module": "./esm/index.mjs",
27
27
  "types": "./esm/index.d.mts",
package/skills/SKILL.md CHANGED
@@ -74,9 +74,10 @@ withAnthropicCacheWriteRates({ input: 2, output: 10 }); // { input: 2, output: 1
74
74
  Object.keys(ANTHROPIC_MODEL_PRICING); // the priced ids
75
75
  ```
76
76
 
77
- - **Source.** `ANTHROPIC_MODEL_PRICING` holds the "Model pricing" table of https://platform.claude.com/docs/en/about-claude/pricing (fetched 2026-10-17): input, output, cache read (`cachedInput`), 5-minute write (`cacheWrite`) and 1-hour write (`cacheWrite1h`), USD per 1M tokens, standard global routing.
77
+ - **Source.** `ANTHROPIC_MODEL_PRICING` holds the "Model pricing" table of https://platform.claude.com/docs/en/about-claude/pricing (as of `ANTHROPIC_MODEL_PRICING_AS_OF`, 2026-11-06): input, output, cache read (`cachedInput`), 5-minute write (`cacheWrite`) and 1-hour write (`cacheWrite1h`), USD per 1M tokens, standard global routing. Claude Haiku 5.5 carries `tiers`: a prompt over 100,000 tokens (cache reads and writes counted) bills at the higher rates, which `computeCost` / `resolvePricing` from `@warlock.js/ai` apply.
78
+ - **Lifecycle.** `ANTHROPIC_MODEL_LIFECYCLE` / `anthropicLifecycleFor(name)` (alias or dated snapshot; checked `ANTHROPIC_MODEL_LIFECYCLE_AS_OF`) gives `{ status: "current" | "retiring" | "retired", retiresOn?, replacement? }` from https://platform.claude.com/docs/en/about-claude/model-deprecations. `claude-sonnet-4-5` is `retiring` on 2026-11-30 (replacement `claude-sonnet-5-5`); `claude-opus-4-1`, `claude-opus-4`, `claude-sonnet-4`, `claude-3-7-sonnet`, `claude-3-5-haiku` and `claude-3-haiku` are `retired`. Active models carry no `retiresOn` (Anthropic documents only a "not sooner than" date).
78
79
  - **Write rates are filled for you.** Anthropic charges 1.25x input for a 5-minute cache write and 2x for a 1-hour write on every Claude model, so any entry without `cacheWrite` / `cacheWrite1h` (your own `{ input, output }` included) gets them from those multipliers (`withAnthropicCacheWriteRates`, exported with `ANTHROPIC_CACHE_WRITE_MULTIPLIER` / `ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER`). The read rate differs per model (0.1x, 0.05x on Opus 5.5 / Sonnet 5.5, 0.025x on Fable 5.1), so it is never derived — set `cachedInput` yourself when you supply pricing, or cache reads bill at the full input rate.
79
- - **Deliberately unpriced** (pass `pricing` yourself): Claude Haiku 5.5 (priced by prompt length — higher rates above 100,000 prompt tokens, which a flat rate cannot express), US-only inference (`inference_geo: "us"`, 1.1x), fast mode, the Batch API, limited-availability and retired models, and Claude on Bedrock / Vertex (partner-priced — see `@warlock.js/ai-bedrock`).
80
+ - **Deliberately unpriced** (pass `pricing` yourself): US-only inference (`inference_geo: "us"`, 1.1x), fast mode, the Batch API, limited-availability and retired models, and Claude on Bedrock / Vertex (partner-priced — see `@warlock.js/ai-bedrock`).
80
81
 
81
82
  ## Tokens & usage accounting
82
83