@warlock.js/ai-openai 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/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ All notable changes to `@warlock.js/ai-openai` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
6
6
 
7
+ ## 5.47.0 - 2026-11-06
8
+
9
+ ### Added
10
+
11
+ - `OPENAI_MODEL_PRICING` lists `gpt-6.1-terra`, `gpt-6-cyber`, `gpt-6-astra`, `gpt-6-luna`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5` and `gpt-5.4`; the models billed by prompt length carry `tiers` for prompts above 272K tokens. `OPENAI_MODEL_PRICING_AS_OF` dates the table.
12
+ - `OPENAI_MODEL_LIFECYCLE` and `openAILifecycleFor(name)` give each priced model a status: `o1`, `o3-mini`, `o4-mini` and `gpt-4.1-nano` are `retired`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano` and `o3` are `retiring` on 2026-12-11, `gpt-5.1` and `gpt-5.4-nano` on 2027-04-01, `gpt-4.1` and `gpt-4.1-mini` on 2027-01-14.
13
+
14
+ ### Fixed
15
+
16
+ - `gpt-6` models report a 1,050,000-token `capabilities.contextWindow` instead of 400,000.
17
+
7
18
  ## 5.45.0 - 2026-11-05
8
19
 
9
20
  ### Added
package/cjs/index.cjs CHANGED
@@ -38,19 +38,109 @@ let _warlock_js_logger = require("@warlock.js/logger");
38
38
  * models charges for cache writes.
39
39
  *
40
40
  * Source: https://developers.openai.com/api/docs/pricing (the target of
41
- * platform.openai.com/docs/pricing), Standard tier, fetched 2026-10-17.
41
+ * platform.openai.com/docs/pricing), Standard tier, as of
42
+ * {@link OPENAI_MODEL_PRICING_AS_OF}. Entries for models the page no
43
+ * longer lists (the retired ids and a few older ones) keep the rates
44
+ * verified on 2026-10-17, so a stored report can still be costed.
45
+ *
46
+ * Models priced by prompt length carry `tiers`: above 272K prompt tokens
47
+ * the whole request bills at the tier rates.
42
48
  *
43
49
  * Applied only when the SDK's provider label is `"openai"`, and only on
44
50
  * an exact id match — dated snapshots can carry other prices. Left out on
45
51
  * purpose, so pass `pricing` yourself for them:
46
52
  *
47
- * - Models priced by prompt length (a higher rate above 272K input
48
- * tokens): the gpt-6 / gpt-5.6 / gpt-5.5 / gpt-5.4 families and the
49
- * `-pro` models. A flat `ModelPricing` cannot express the tiers.
53
+ * - The `-pro` models, `gpt-6-sol` / `gpt-5.6-sol` (promotional pricing
54
+ * until 2026-11-30) and models without a listed price.
50
55
  * - Promotional, Batch, Flex and Priority pricing, and the regional
51
56
  * (data-residency) uplift.
57
+ *
58
+ * Retired ids stay in the table so old reports keep their cost; see
59
+ * {@link OPENAI_MODEL_LIFECYCLE} for their status.
52
60
  */
53
61
  const OPENAI_MODEL_PRICING = {
62
+ "gpt-6.1-terra": {
63
+ input: 1,
64
+ output: 5,
65
+ cachedInput: .05,
66
+ tiers: [{
67
+ abovePromptTokens: 272e3,
68
+ input: 2,
69
+ output: 7.5,
70
+ cachedInput: .1
71
+ }]
72
+ },
73
+ "gpt-6-cyber": {
74
+ input: 20,
75
+ output: 100,
76
+ cachedInput: 2
77
+ },
78
+ "gpt-6-astra": {
79
+ input: 10,
80
+ output: 50,
81
+ cachedInput: 1,
82
+ tiers: [{
83
+ abovePromptTokens: 272e3,
84
+ input: 20,
85
+ output: 75,
86
+ cachedInput: 2
87
+ }]
88
+ },
89
+ "gpt-6-luna": {
90
+ input: .1,
91
+ output: .5,
92
+ cachedInput: .01,
93
+ tiers: [{
94
+ abovePromptTokens: 272e3,
95
+ input: .2,
96
+ output: .75,
97
+ cachedInput: .02
98
+ }]
99
+ },
100
+ "gpt-5.6-terra": {
101
+ input: 2,
102
+ output: 12,
103
+ cachedInput: .2,
104
+ tiers: [{
105
+ abovePromptTokens: 272e3,
106
+ input: 4,
107
+ output: 18,
108
+ cachedInput: .4
109
+ }]
110
+ },
111
+ "gpt-5.6-luna": {
112
+ input: .2,
113
+ output: 1.2,
114
+ cachedInput: .02,
115
+ tiers: [{
116
+ abovePromptTokens: 272e3,
117
+ input: .4,
118
+ output: 1.8,
119
+ cachedInput: .04
120
+ }]
121
+ },
122
+ "gpt-5.5": {
123
+ input: 5,
124
+ output: 30,
125
+ cachedInput: .5,
126
+ tiers: [{
127
+ abovePromptTokens: 272e3,
128
+ input: 10,
129
+ output: 45,
130
+ cachedInput: 1
131
+ }]
132
+ },
133
+ "gpt-5.4": {
134
+ input: 2.5,
135
+ output: 15,
136
+ cachedInput: .25,
137
+ tiers: [{
138
+ abovePromptTokens: 272e3,
139
+ input: 5,
140
+ output: 22.5,
141
+ cachedInput: .5
142
+ }]
143
+ },
54
144
  "gpt-5.4-mini": {
55
145
  input: .75,
56
146
  output: 4.5,
@@ -132,6 +222,8 @@ const OPENAI_MODEL_PRICING = {
132
222
  cachedInput: 7.5
133
223
  }
134
224
  };
225
+ /** The date the {@link OPENAI_MODEL_PRICING} rates were last checked against OpenAI's pricing page. */
226
+ const OPENAI_MODEL_PRICING_AS_OF = "2026-11-06";
135
227
  /**
136
228
  * Look up the built-in list price for an OpenAI model id (exact match).
137
229
  * Returns `undefined` for unknown ids, so cost stays unknown rather than
@@ -139,7 +231,8 @@ const OPENAI_MODEL_PRICING = {
139
231
  *
140
232
  * @example
141
233
  * openAIPricingFor("gpt-4o-mini"); // { input: 0.15, output: 0.6, cachedInput: 0.075 }
142
- * openAIPricingFor("gpt-5.5"); // undefined — priced by prompt length
234
+ * openAIPricingFor("gpt-5.5"); // { input: 5, output: 30, cachedInput: 0.5, tiers: [...] }
235
+ * openAIPricingFor("gpt-5.5-pro"); // undefined — not in the table
143
236
  */
144
237
  function openAIPricingFor(modelName) {
145
238
  return OPENAI_MODEL_PRICING[modelName];
@@ -1433,7 +1526,7 @@ function compatibleSearchParams(provider, options) {
1433
1526
  const PREFIX_WINDOWS = [
1434
1527
  ["gpt-5-", 4e5],
1435
1528
  ["gpt-5.", 4e5],
1436
- ["gpt-6", 4e5],
1529
+ ["gpt-6", 105e4],
1437
1530
  ["gpt-4-turbo", 128e3],
1438
1531
  ["gpt-3.5-turbo", 16385],
1439
1532
  ["chatgpt-4o", 128e3],
@@ -2772,6 +2865,103 @@ var OpenAISDK = class {
2772
2865
  }
2773
2866
  };
2774
2867
 
2868
+ //#endregion
2869
+ //#region ../../packages/ai-openai/src/known-lifecycle.ts
2870
+ /**
2871
+ * Where OpenAI's own deprecation page puts the models in
2872
+ * {@link OPENAI_MODEL_PRICING}, as of {@link OPENAI_MODEL_LIFECYCLE_AS_OF}.
2873
+ * `retiring` ids work until `retiresOn`; `retired` ids are past their
2874
+ * shutdown date but stay priced so stored reports keep their cost.
2875
+ *
2876
+ * Source: https://developers.openai.com/api/docs/deprecations. Models the
2877
+ * page does not mention are `current`. `gpt-4o`, `gpt-4o-mini` and
2878
+ * `gpt-5.2` are left out: the page lists only their dated snapshots or
2879
+ * variants, so the status of the plain id is not documented.
2880
+ */
2881
+ const OPENAI_MODEL_LIFECYCLE = {
2882
+ "gpt-6.1-terra": { status: "current" },
2883
+ "gpt-6-cyber": { status: "current" },
2884
+ "gpt-6-astra": { status: "current" },
2885
+ "gpt-6-luna": { status: "current" },
2886
+ "gpt-5.6-terra": { status: "current" },
2887
+ "gpt-5.6-luna": { status: "current" },
2888
+ "gpt-5.5": { status: "current" },
2889
+ "gpt-5.4": { status: "current" },
2890
+ "gpt-5.4-mini": { status: "current" },
2891
+ "gpt-5.4-nano": {
2892
+ status: "retiring",
2893
+ retiresOn: "2027-04-01",
2894
+ replacement: "gpt-6-luna"
2895
+ },
2896
+ "gpt-5.1": {
2897
+ status: "retiring",
2898
+ retiresOn: "2027-04-01",
2899
+ replacement: "gpt-6-sol"
2900
+ },
2901
+ "gpt-5": {
2902
+ status: "retiring",
2903
+ retiresOn: "2026-12-11",
2904
+ replacement: "gpt-5.6-sol"
2905
+ },
2906
+ "gpt-5-mini": {
2907
+ status: "retiring",
2908
+ retiresOn: "2026-12-11",
2909
+ replacement: "gpt-5.6-terra"
2910
+ },
2911
+ "gpt-5-nano": {
2912
+ status: "retiring",
2913
+ retiresOn: "2026-12-11",
2914
+ replacement: "gpt-5.6-luna"
2915
+ },
2916
+ o3: {
2917
+ status: "retiring",
2918
+ retiresOn: "2026-12-11",
2919
+ replacement: "gpt-5.6-sol"
2920
+ },
2921
+ "gpt-4.1": {
2922
+ status: "retiring",
2923
+ retiresOn: "2027-01-14",
2924
+ replacement: "gpt-6-luna"
2925
+ },
2926
+ "gpt-4.1-mini": {
2927
+ status: "retiring",
2928
+ retiresOn: "2027-01-14",
2929
+ replacement: "gpt-6-luna"
2930
+ },
2931
+ "gpt-4.1-nano": {
2932
+ status: "retired",
2933
+ retiresOn: "2026-10-23",
2934
+ replacement: "gpt-5.6-luna"
2935
+ },
2936
+ "o4-mini": {
2937
+ status: "retired",
2938
+ retiresOn: "2026-10-23",
2939
+ replacement: "gpt-5.6-terra"
2940
+ },
2941
+ "o3-mini": {
2942
+ status: "retired",
2943
+ retiresOn: "2026-10-23",
2944
+ replacement: "gpt-5.6-sol"
2945
+ },
2946
+ o1: {
2947
+ status: "retired",
2948
+ retiresOn: "2026-10-23",
2949
+ replacement: "gpt-5.6-sol"
2950
+ }
2951
+ };
2952
+ /** The date {@link OPENAI_MODEL_LIFECYCLE} was last checked against OpenAI's deprecation page. */
2953
+ const OPENAI_MODEL_LIFECYCLE_AS_OF = "2026-11-06";
2954
+ /**
2955
+ * Look up the lifecycle of an OpenAI model id (exact match), or
2956
+ * `undefined` when the table does not cover it.
2957
+ *
2958
+ * @example
2959
+ * openAILifecycleFor("o1"); // { status: "retired", retiresOn: "2026-10-23", replacement: "gpt-5.6-sol" }
2960
+ */
2961
+ function openAILifecycleFor(modelName) {
2962
+ return Object.hasOwn(OPENAI_MODEL_LIFECYCLE, modelName) ? OPENAI_MODEL_LIFECYCLE[modelName] : void 0;
2963
+ }
2964
+
2775
2965
  //#endregion
2776
2966
  //#region ../../packages/ai-openai/src/kimi-tools.ts
2777
2967
  /** USD per billable REST request, verified 2026-10-18:
@@ -3024,7 +3214,10 @@ function stringInput(key) {
3024
3214
 
3025
3215
  //#endregion
3026
3216
  exports.KIMI_SERVER_TOOL_PRICING = KIMI_SERVER_TOOL_PRICING;
3217
+ exports.OPENAI_MODEL_LIFECYCLE = OPENAI_MODEL_LIFECYCLE;
3218
+ exports.OPENAI_MODEL_LIFECYCLE_AS_OF = OPENAI_MODEL_LIFECYCLE_AS_OF;
3027
3219
  exports.OPENAI_MODEL_PRICING = OPENAI_MODEL_PRICING;
3220
+ exports.OPENAI_MODEL_PRICING_AS_OF = OPENAI_MODEL_PRICING_AS_OF;
3028
3221
  exports.OPENAI_SERVER_TOOL_PRICING = OPENAI_SERVER_TOOL_PRICING;
3029
3222
  exports.OpenAIEmbedder = OpenAIEmbedder;
3030
3223
  exports.OpenAIImageModel = OpenAIImageModel;
@@ -3034,5 +3227,6 @@ exports.OpenAISpeechModel = OpenAISpeechModel;
3034
3227
  exports.OpenAITranscriptionModel = OpenAITranscriptionModel;
3035
3228
  exports.kimiFetchTool = kimiFetchTool;
3036
3229
  exports.kimiSearchTool = kimiSearchTool;
3230
+ exports.openAILifecycleFor = openAILifecycleFor;
3037
3231
  exports.openAIPricingFor = openAIPricingFor;
3038
3232
  //# sourceMappingURL=index.cjs.map