@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 +11 -0
- package/cjs/index.cjs +200 -6
- package/cjs/index.cjs.map +1 -1
- package/esm/index.d.mts +3 -2
- package/esm/index.mjs +3 -2
- package/esm/known-context-windows.mjs +1 -1
- package/esm/known-context-windows.mjs.map +1 -1
- package/esm/known-lifecycle.d.mts +26 -0
- package/esm/known-lifecycle.d.mts.map +1 -0
- package/esm/known-lifecycle.mjs +99 -0
- package/esm/known-lifecycle.mjs.map +1 -0
- package/esm/known-pricing.d.mts +16 -5
- package/esm/known-pricing.d.mts.map +1 -1
- package/esm/known-pricing.mjs +99 -6
- package/esm/known-pricing.mjs.map +1 -1
- package/llms-full.txt +3 -2
- package/package.json +3 -3
- package/skills/SKILL.md +3 -2
package/esm/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OpenAIEmbedderConfig, OpenAIImageConfig, OpenAISDKConfig, OpenAISpeechConfig, OpenAITranscriptionConfig } from "./config.type.mjs";
|
|
2
2
|
import { OpenAISDK } from "./sdk.mjs";
|
|
3
|
-
import { OPENAI_MODEL_PRICING, OPENAI_SERVER_TOOL_PRICING, openAIPricingFor } from "./known-pricing.mjs";
|
|
3
|
+
import { OPENAI_MODEL_PRICING, OPENAI_MODEL_PRICING_AS_OF, OPENAI_SERVER_TOOL_PRICING, openAIPricingFor } from "./known-pricing.mjs";
|
|
4
|
+
import { OPENAI_MODEL_LIFECYCLE, OPENAI_MODEL_LIFECYCLE_AS_OF, openAILifecycleFor } from "./known-lifecycle.mjs";
|
|
4
5
|
import { OpenAIResponsesModel } from "./responses-model.mjs";
|
|
5
6
|
import { OpenAIEmbedder } from "./embedder.mjs";
|
|
6
7
|
import { OpenAIImageModel } from "./image.mjs";
|
|
@@ -8,4 +9,4 @@ import { OpenAISpeechModel } from "./speech.mjs";
|
|
|
8
9
|
import { OpenAITranscriptionModel } from "./transcription.mjs";
|
|
9
10
|
import { OpenAICallOptions, QwenCallOptions } from "./provider-options.mjs";
|
|
10
11
|
import { KIMI_SERVER_TOOL_PRICING, KimiFetchOutput, KimiSearchOutput, KimiSearchResult, KimiSearchToolOptions, KimiToolOptions, kimiFetchTool, kimiSearchTool } from "./kimi-tools.mjs";
|
|
11
|
-
export { KIMI_SERVER_TOOL_PRICING, type KimiFetchOutput, type KimiSearchOutput, type KimiSearchResult, type KimiSearchToolOptions, type KimiToolOptions, OPENAI_MODEL_PRICING, OPENAI_SERVER_TOOL_PRICING, type OpenAICallOptions, OpenAIEmbedder, type OpenAIEmbedderConfig, type OpenAIImageConfig, OpenAIImageModel, OpenAIResponsesModel, OpenAISDK, type OpenAISDKConfig, type OpenAISpeechConfig, OpenAISpeechModel, type OpenAITranscriptionConfig, OpenAITranscriptionModel, type QwenCallOptions, kimiFetchTool, kimiSearchTool, openAIPricingFor };
|
|
12
|
+
export { KIMI_SERVER_TOOL_PRICING, type KimiFetchOutput, type KimiSearchOutput, type KimiSearchResult, type KimiSearchToolOptions, type KimiToolOptions, OPENAI_MODEL_LIFECYCLE, OPENAI_MODEL_LIFECYCLE_AS_OF, OPENAI_MODEL_PRICING, OPENAI_MODEL_PRICING_AS_OF, OPENAI_SERVER_TOOL_PRICING, type OpenAICallOptions, OpenAIEmbedder, type OpenAIEmbedderConfig, type OpenAIImageConfig, OpenAIImageModel, OpenAIResponsesModel, OpenAISDK, type OpenAISDKConfig, type OpenAISpeechConfig, OpenAISpeechModel, type OpenAITranscriptionConfig, OpenAITranscriptionModel, type QwenCallOptions, kimiFetchTool, kimiSearchTool, openAILifecycleFor, openAIPricingFor };
|
package/esm/index.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { OPENAI_MODEL_PRICING, OPENAI_SERVER_TOOL_PRICING, openAIPricingFor } from "./known-pricing.mjs";
|
|
1
|
+
import { OPENAI_MODEL_PRICING, OPENAI_MODEL_PRICING_AS_OF, OPENAI_SERVER_TOOL_PRICING, openAIPricingFor } from "./known-pricing.mjs";
|
|
2
2
|
import { OpenAIEmbedder } from "./embedder.mjs";
|
|
3
3
|
import { OpenAIImageModel } from "./image.mjs";
|
|
4
4
|
import { OpenAIResponsesModel } from "./responses-model.mjs";
|
|
5
5
|
import { OpenAISpeechModel } from "./speech.mjs";
|
|
6
6
|
import { OpenAITranscriptionModel } from "./transcription.mjs";
|
|
7
7
|
import { OpenAISDK } from "./sdk.mjs";
|
|
8
|
+
import { OPENAI_MODEL_LIFECYCLE, OPENAI_MODEL_LIFECYCLE_AS_OF, openAILifecycleFor } from "./known-lifecycle.mjs";
|
|
8
9
|
import { KIMI_SERVER_TOOL_PRICING, kimiFetchTool, kimiSearchTool } from "./kimi-tools.mjs";
|
|
9
10
|
|
|
10
|
-
export { KIMI_SERVER_TOOL_PRICING, OPENAI_MODEL_PRICING, OPENAI_SERVER_TOOL_PRICING, OpenAIEmbedder, OpenAIImageModel, OpenAIResponsesModel, OpenAISDK, OpenAISpeechModel, OpenAITranscriptionModel, kimiFetchTool, kimiSearchTool, openAIPricingFor };
|
|
11
|
+
export { KIMI_SERVER_TOOL_PRICING, OPENAI_MODEL_LIFECYCLE, OPENAI_MODEL_LIFECYCLE_AS_OF, OPENAI_MODEL_PRICING, OPENAI_MODEL_PRICING_AS_OF, OPENAI_SERVER_TOOL_PRICING, OpenAIEmbedder, OpenAIImageModel, OpenAIResponsesModel, OpenAISDK, OpenAISpeechModel, OpenAITranscriptionModel, kimiFetchTool, kimiSearchTool, openAILifecycleFor, openAIPricingFor };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"known-context-windows.mjs","names":[],"sources":["../../../../../../../packages/ai-openai/src/known-context-windows.ts"],"sourcesContent":["/*\n * Context windows of OpenAI models with a documented, stable size. Longest\n * prefix wins; ids that match nothing resolve to `undefined`, so a\n * window-relative trigger stays inert until the window is set with\n * `openai.model({ name, contextWindow })`.\n */\nconst PREFIX_WINDOWS: ReadonlyArray<readonly [prefix: string, window: number]> = [\n [\"gpt-5-\", 400_000],\n // The gpt-5.x
|
|
1
|
+
{"version":3,"file":"known-context-windows.mjs","names":[],"sources":["../../../../../../../packages/ai-openai/src/known-context-windows.ts"],"sourcesContent":["/*\n * Context windows of OpenAI models with a documented, stable size. Longest\n * prefix wins; ids that match nothing resolve to `undefined`, so a\n * window-relative trigger stays inert until the window is set with\n * `openai.model({ name, contextWindow })`.\n */\nconst PREFIX_WINDOWS: ReadonlyArray<readonly [prefix: string, window: number]> = [\n [\"gpt-5-\", 400_000],\n // The gpt-5.x releases use the 400K figure every gpt-5 model documents;\n // the gpt-6 models document 1.05M. A different window is set with `contextWindow`.\n [\"gpt-5.\", 400_000],\n [\"gpt-6\", 1_050_000],\n [\"gpt-4-turbo\", 128_000],\n [\"gpt-3.5-turbo\", 16_385],\n [\"chatgpt-4o\", 128_000],\n [\"o3-mini\", 200_000],\n [\"o3-pro\", 200_000],\n [\"o1-pro\", 200_000],\n [\"gpt-4.1\", 1_047_576],\n [\"gpt-5-chat\", 128_000],\n [\"gpt-4o\", 128_000],\n [\"o4-mini\", 200_000],\n [\"o3\", 200_000],\n [\"o1\", 200_000],\n [\"o1-mini\", 128_000],\n [\"o1-preview\", 128_000],\n];\n\n/**\n * The known context window of a direct-OpenAI model id, or `undefined`.\n *\n * @example\n * inferContextWindow(\"gpt-4.1-mini\"); // → 1047576\n */\nexport function inferContextWindow(modelName: string): number | undefined {\n const id = modelName.toLowerCase();\n if (id === \"gpt-5\") return 400_000;\n if (id === \"gpt-4\") return 8_192;\n\n let best: readonly [string, number] | undefined;\n\n for (const entry of PREFIX_WINDOWS) {\n if (id.startsWith(entry[0]) && (!best || entry[0].length > best[0].length)) {\n best = entry;\n }\n }\n\n return best?.[1];\n}\n"],"mappings":";AAMA,MAAM,iBAA2E;CAC/E,CAAC,UAAU,GAAO;CAGlB,CAAC,UAAU,GAAO;CAClB,CAAC,SAAS,KAAS;CACnB,CAAC,eAAe,KAAO;CACvB,CAAC,iBAAiB,KAAM;CACxB,CAAC,cAAc,KAAO;CACtB,CAAC,WAAW,GAAO;CACnB,CAAC,UAAU,GAAO;CAClB,CAAC,UAAU,GAAO;CAClB,CAAC,WAAW,OAAS;CACrB,CAAC,cAAc,KAAO;CACtB,CAAC,UAAU,KAAO;CAClB,CAAC,WAAW,GAAO;CACnB,CAAC,MAAM,GAAO;CACd,CAAC,MAAM,GAAO;CACd,CAAC,WAAW,KAAO;CACnB,CAAC,cAAc,KAAO;AACxB;;;;;;;AAQA,SAAgB,mBAAmB,WAAuC;CACxE,MAAM,KAAK,UAAU,YAAY;CACjC,IAAI,OAAO,SAAS,OAAO;CAC3B,IAAI,OAAO,SAAS,OAAO;CAE3B,IAAI;CAEJ,KAAK,MAAM,SAAS,gBAClB,IAAI,GAAG,WAAW,MAAM,EAAE,MAAM,CAAC,QAAQ,MAAM,EAAE,CAAC,SAAS,KAAK,EAAE,CAAC,SACjE,OAAO;CAIX,OAAO,OAAO;AAChB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ModelLifecycle } from "@warlock.js/ai";
|
|
2
|
+
//#region ../../packages/ai-openai/src/known-lifecycle.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Where OpenAI's own deprecation page puts the models in
|
|
5
|
+
* {@link OPENAI_MODEL_PRICING}, as of {@link OPENAI_MODEL_LIFECYCLE_AS_OF}.
|
|
6
|
+
* `retiring` ids work until `retiresOn`; `retired` ids are past their
|
|
7
|
+
* shutdown date but stay priced so stored reports keep their cost.
|
|
8
|
+
*
|
|
9
|
+
* Source: https://developers.openai.com/api/docs/deprecations. Models the
|
|
10
|
+
* page does not mention are `current`. `gpt-4o`, `gpt-4o-mini` and
|
|
11
|
+
* `gpt-5.2` are left out: the page lists only their dated snapshots or
|
|
12
|
+
* variants, so the status of the plain id is not documented.
|
|
13
|
+
*/
|
|
14
|
+
export declare const OPENAI_MODEL_LIFECYCLE: Readonly<Record<string, ModelLifecycle>>;
|
|
15
|
+
/** The date {@link OPENAI_MODEL_LIFECYCLE} was last checked against OpenAI's deprecation page. */
|
|
16
|
+
export declare const OPENAI_MODEL_LIFECYCLE_AS_OF = "2026-11-06";
|
|
17
|
+
/**
|
|
18
|
+
* Look up the lifecycle of an OpenAI model id (exact match), or
|
|
19
|
+
* `undefined` when the table does not cover it.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* openAILifecycleFor("o1"); // { status: "retired", retiresOn: "2026-10-23", replacement: "gpt-5.6-sol" }
|
|
23
|
+
*/
|
|
24
|
+
export declare function openAILifecycleFor(modelName: string): ModelLifecycle | undefined;
|
|
25
|
+
//#endregion
|
|
26
|
+
//# sourceMappingURL=known-lifecycle.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-lifecycle.d.mts","names":[],"sources":["../../../../../../../packages/ai-openai/src/known-lifecycle.ts"],"mappings":";;;;;;;;;;;;;qBAaa,wBAAwB,SAAS,eAAe;;qBAyBhD;;;;;;;;wBASG,mBAAmB,oBAAoB"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
//#region ../../packages/ai-openai/src/known-lifecycle.ts
|
|
2
|
+
/**
|
|
3
|
+
* Where OpenAI's own deprecation page puts the models in
|
|
4
|
+
* {@link OPENAI_MODEL_PRICING}, as of {@link OPENAI_MODEL_LIFECYCLE_AS_OF}.
|
|
5
|
+
* `retiring` ids work until `retiresOn`; `retired` ids are past their
|
|
6
|
+
* shutdown date but stay priced so stored reports keep their cost.
|
|
7
|
+
*
|
|
8
|
+
* Source: https://developers.openai.com/api/docs/deprecations. Models the
|
|
9
|
+
* page does not mention are `current`. `gpt-4o`, `gpt-4o-mini` and
|
|
10
|
+
* `gpt-5.2` are left out: the page lists only their dated snapshots or
|
|
11
|
+
* variants, so the status of the plain id is not documented.
|
|
12
|
+
*/
|
|
13
|
+
const OPENAI_MODEL_LIFECYCLE = {
|
|
14
|
+
"gpt-6.1-terra": { status: "current" },
|
|
15
|
+
"gpt-6-cyber": { status: "current" },
|
|
16
|
+
"gpt-6-astra": { status: "current" },
|
|
17
|
+
"gpt-6-luna": { status: "current" },
|
|
18
|
+
"gpt-5.6-terra": { status: "current" },
|
|
19
|
+
"gpt-5.6-luna": { status: "current" },
|
|
20
|
+
"gpt-5.5": { status: "current" },
|
|
21
|
+
"gpt-5.4": { status: "current" },
|
|
22
|
+
"gpt-5.4-mini": { status: "current" },
|
|
23
|
+
"gpt-5.4-nano": {
|
|
24
|
+
status: "retiring",
|
|
25
|
+
retiresOn: "2027-04-01",
|
|
26
|
+
replacement: "gpt-6-luna"
|
|
27
|
+
},
|
|
28
|
+
"gpt-5.1": {
|
|
29
|
+
status: "retiring",
|
|
30
|
+
retiresOn: "2027-04-01",
|
|
31
|
+
replacement: "gpt-6-sol"
|
|
32
|
+
},
|
|
33
|
+
"gpt-5": {
|
|
34
|
+
status: "retiring",
|
|
35
|
+
retiresOn: "2026-12-11",
|
|
36
|
+
replacement: "gpt-5.6-sol"
|
|
37
|
+
},
|
|
38
|
+
"gpt-5-mini": {
|
|
39
|
+
status: "retiring",
|
|
40
|
+
retiresOn: "2026-12-11",
|
|
41
|
+
replacement: "gpt-5.6-terra"
|
|
42
|
+
},
|
|
43
|
+
"gpt-5-nano": {
|
|
44
|
+
status: "retiring",
|
|
45
|
+
retiresOn: "2026-12-11",
|
|
46
|
+
replacement: "gpt-5.6-luna"
|
|
47
|
+
},
|
|
48
|
+
o3: {
|
|
49
|
+
status: "retiring",
|
|
50
|
+
retiresOn: "2026-12-11",
|
|
51
|
+
replacement: "gpt-5.6-sol"
|
|
52
|
+
},
|
|
53
|
+
"gpt-4.1": {
|
|
54
|
+
status: "retiring",
|
|
55
|
+
retiresOn: "2027-01-14",
|
|
56
|
+
replacement: "gpt-6-luna"
|
|
57
|
+
},
|
|
58
|
+
"gpt-4.1-mini": {
|
|
59
|
+
status: "retiring",
|
|
60
|
+
retiresOn: "2027-01-14",
|
|
61
|
+
replacement: "gpt-6-luna"
|
|
62
|
+
},
|
|
63
|
+
"gpt-4.1-nano": {
|
|
64
|
+
status: "retired",
|
|
65
|
+
retiresOn: "2026-10-23",
|
|
66
|
+
replacement: "gpt-5.6-luna"
|
|
67
|
+
},
|
|
68
|
+
"o4-mini": {
|
|
69
|
+
status: "retired",
|
|
70
|
+
retiresOn: "2026-10-23",
|
|
71
|
+
replacement: "gpt-5.6-terra"
|
|
72
|
+
},
|
|
73
|
+
"o3-mini": {
|
|
74
|
+
status: "retired",
|
|
75
|
+
retiresOn: "2026-10-23",
|
|
76
|
+
replacement: "gpt-5.6-sol"
|
|
77
|
+
},
|
|
78
|
+
o1: {
|
|
79
|
+
status: "retired",
|
|
80
|
+
retiresOn: "2026-10-23",
|
|
81
|
+
replacement: "gpt-5.6-sol"
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
/** The date {@link OPENAI_MODEL_LIFECYCLE} was last checked against OpenAI's deprecation page. */
|
|
85
|
+
const OPENAI_MODEL_LIFECYCLE_AS_OF = "2026-11-06";
|
|
86
|
+
/**
|
|
87
|
+
* Look up the lifecycle of an OpenAI model id (exact match), or
|
|
88
|
+
* `undefined` when the table does not cover it.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* openAILifecycleFor("o1"); // { status: "retired", retiresOn: "2026-10-23", replacement: "gpt-5.6-sol" }
|
|
92
|
+
*/
|
|
93
|
+
function openAILifecycleFor(modelName) {
|
|
94
|
+
return Object.hasOwn(OPENAI_MODEL_LIFECYCLE, modelName) ? OPENAI_MODEL_LIFECYCLE[modelName] : void 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
export { OPENAI_MODEL_LIFECYCLE, OPENAI_MODEL_LIFECYCLE_AS_OF, openAILifecycleFor };
|
|
99
|
+
//# sourceMappingURL=known-lifecycle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-lifecycle.mjs","names":[],"sources":["../../../../../../../packages/ai-openai/src/known-lifecycle.ts"],"sourcesContent":["import type { ModelLifecycle } from \"@warlock.js/ai\";\n\n/**\n * Where OpenAI's own deprecation page puts the models in\n * {@link OPENAI_MODEL_PRICING}, as of {@link OPENAI_MODEL_LIFECYCLE_AS_OF}.\n * `retiring` ids work until `retiresOn`; `retired` ids are past their\n * shutdown date but stay priced so stored reports keep their cost.\n *\n * Source: https://developers.openai.com/api/docs/deprecations. Models the\n * page does not mention are `current`. `gpt-4o`, `gpt-4o-mini` and\n * `gpt-5.2` are left out: the page lists only their dated snapshots or\n * variants, so the status of the plain id is not documented.\n */\nexport const OPENAI_MODEL_LIFECYCLE: Readonly<Record<string, ModelLifecycle>> = {\n \"gpt-6.1-terra\": { status: \"current\" },\n \"gpt-6-cyber\": { status: \"current\" },\n \"gpt-6-astra\": { status: \"current\" },\n \"gpt-6-luna\": { status: \"current\" },\n \"gpt-5.6-terra\": { status: \"current\" },\n \"gpt-5.6-luna\": { status: \"current\" },\n \"gpt-5.5\": { status: \"current\" },\n \"gpt-5.4\": { status: \"current\" },\n \"gpt-5.4-mini\": { status: \"current\" },\n \"gpt-5.4-nano\": { status: \"retiring\", retiresOn: \"2027-04-01\", replacement: \"gpt-6-luna\" },\n \"gpt-5.1\": { status: \"retiring\", retiresOn: \"2027-04-01\", replacement: \"gpt-6-sol\" },\n \"gpt-5\": { status: \"retiring\", retiresOn: \"2026-12-11\", replacement: \"gpt-5.6-sol\" },\n \"gpt-5-mini\": { status: \"retiring\", retiresOn: \"2026-12-11\", replacement: \"gpt-5.6-terra\" },\n \"gpt-5-nano\": { status: \"retiring\", retiresOn: \"2026-12-11\", replacement: \"gpt-5.6-luna\" },\n o3: { status: \"retiring\", retiresOn: \"2026-12-11\", replacement: \"gpt-5.6-sol\" },\n \"gpt-4.1\": { status: \"retiring\", retiresOn: \"2027-01-14\", replacement: \"gpt-6-luna\" },\n \"gpt-4.1-mini\": { status: \"retiring\", retiresOn: \"2027-01-14\", replacement: \"gpt-6-luna\" },\n \"gpt-4.1-nano\": { status: \"retired\", retiresOn: \"2026-10-23\", replacement: \"gpt-5.6-luna\" },\n \"o4-mini\": { status: \"retired\", retiresOn: \"2026-10-23\", replacement: \"gpt-5.6-terra\" },\n \"o3-mini\": { status: \"retired\", retiresOn: \"2026-10-23\", replacement: \"gpt-5.6-sol\" },\n o1: { status: \"retired\", retiresOn: \"2026-10-23\", replacement: \"gpt-5.6-sol\" },\n};\n\n/** The date {@link OPENAI_MODEL_LIFECYCLE} was last checked against OpenAI's deprecation page. */\nexport const OPENAI_MODEL_LIFECYCLE_AS_OF = \"2026-11-06\";\n\n/**\n * Look up the lifecycle of an OpenAI model id (exact match), or\n * `undefined` when the table does not cover it.\n *\n * @example\n * openAILifecycleFor(\"o1\"); // { status: \"retired\", retiresOn: \"2026-10-23\", replacement: \"gpt-5.6-sol\" }\n */\nexport function openAILifecycleFor(modelName: string): ModelLifecycle | undefined {\n return Object.hasOwn(OPENAI_MODEL_LIFECYCLE, modelName)\n ? OPENAI_MODEL_LIFECYCLE[modelName]\n : undefined;\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,yBAAmE;CAC9E,iBAAiB,EAAE,QAAQ,UAAU;CACrC,eAAe,EAAE,QAAQ,UAAU;CACnC,eAAe,EAAE,QAAQ,UAAU;CACnC,cAAc,EAAE,QAAQ,UAAU;CAClC,iBAAiB,EAAE,QAAQ,UAAU;CACrC,gBAAgB,EAAE,QAAQ,UAAU;CACpC,WAAW,EAAE,QAAQ,UAAU;CAC/B,WAAW,EAAE,QAAQ,UAAU;CAC/B,gBAAgB,EAAE,QAAQ,UAAU;CACpC,gBAAgB;EAAE,QAAQ;EAAY,WAAW;EAAc,aAAa;CAAa;CACzF,WAAW;EAAE,QAAQ;EAAY,WAAW;EAAc,aAAa;CAAY;CACnF,SAAS;EAAE,QAAQ;EAAY,WAAW;EAAc,aAAa;CAAc;CACnF,cAAc;EAAE,QAAQ;EAAY,WAAW;EAAc,aAAa;CAAgB;CAC1F,cAAc;EAAE,QAAQ;EAAY,WAAW;EAAc,aAAa;CAAe;CACzF,IAAI;EAAE,QAAQ;EAAY,WAAW;EAAc,aAAa;CAAc;CAC9E,WAAW;EAAE,QAAQ;EAAY,WAAW;EAAc,aAAa;CAAa;CACpF,gBAAgB;EAAE,QAAQ;EAAY,WAAW;EAAc,aAAa;CAAa;CACzF,gBAAgB;EAAE,QAAQ;EAAW,WAAW;EAAc,aAAa;CAAe;CAC1F,WAAW;EAAE,QAAQ;EAAW,WAAW;EAAc,aAAa;CAAgB;CACtF,WAAW;EAAE,QAAQ;EAAW,WAAW;EAAc,aAAa;CAAc;CACpF,IAAI;EAAE,QAAQ;EAAW,WAAW;EAAc,aAAa;CAAc;AAC/E;;AAGA,MAAa,+BAA+B;;;;;;;;AAS5C,SAAgB,mBAAmB,WAA+C;CAChF,OAAO,OAAO,OAAO,wBAAwB,SAAS,IAClD,uBAAuB,aACvB;AACN"}
|
package/esm/known-pricing.d.mts
CHANGED
|
@@ -6,19 +6,29 @@ import { ModelPricing } from "@warlock.js/ai";
|
|
|
6
6
|
* models charges for cache writes.
|
|
7
7
|
*
|
|
8
8
|
* Source: https://developers.openai.com/api/docs/pricing (the target of
|
|
9
|
-
* platform.openai.com/docs/pricing), Standard tier,
|
|
9
|
+
* platform.openai.com/docs/pricing), Standard tier, as of
|
|
10
|
+
* {@link OPENAI_MODEL_PRICING_AS_OF}. Entries for models the page no
|
|
11
|
+
* longer lists (the retired ids and a few older ones) keep the rates
|
|
12
|
+
* verified on 2026-10-17, so a stored report can still be costed.
|
|
13
|
+
*
|
|
14
|
+
* Models priced by prompt length carry `tiers`: above 272K prompt tokens
|
|
15
|
+
* the whole request bills at the tier rates.
|
|
10
16
|
*
|
|
11
17
|
* Applied only when the SDK's provider label is `"openai"`, and only on
|
|
12
18
|
* an exact id match — dated snapshots can carry other prices. Left out on
|
|
13
19
|
* purpose, so pass `pricing` yourself for them:
|
|
14
20
|
*
|
|
15
|
-
* -
|
|
16
|
-
*
|
|
17
|
-
* `-pro` models. A flat `ModelPricing` cannot express the tiers.
|
|
21
|
+
* - The `-pro` models, `gpt-6-sol` / `gpt-5.6-sol` (promotional pricing
|
|
22
|
+
* until 2026-11-30) and models without a listed price.
|
|
18
23
|
* - Promotional, Batch, Flex and Priority pricing, and the regional
|
|
19
24
|
* (data-residency) uplift.
|
|
25
|
+
*
|
|
26
|
+
* Retired ids stay in the table so old reports keep their cost; see
|
|
27
|
+
* {@link OPENAI_MODEL_LIFECYCLE} for their status.
|
|
20
28
|
*/
|
|
21
29
|
export declare const OPENAI_MODEL_PRICING: Readonly<Record<string, ModelPricing>>;
|
|
30
|
+
/** The date the {@link OPENAI_MODEL_PRICING} rates were last checked against OpenAI's pricing page. */
|
|
31
|
+
export declare const OPENAI_MODEL_PRICING_AS_OF = "2026-11-06";
|
|
22
32
|
/**
|
|
23
33
|
* Look up the built-in list price for an OpenAI model id (exact match).
|
|
24
34
|
* Returns `undefined` for unknown ids, so cost stays unknown rather than
|
|
@@ -26,7 +36,8 @@ export declare const OPENAI_MODEL_PRICING: Readonly<Record<string, ModelPricing>
|
|
|
26
36
|
*
|
|
27
37
|
* @example
|
|
28
38
|
* openAIPricingFor("gpt-4o-mini"); // { input: 0.15, output: 0.6, cachedInput: 0.075 }
|
|
29
|
-
* openAIPricingFor("gpt-5.5"); //
|
|
39
|
+
* openAIPricingFor("gpt-5.5"); // { input: 5, output: 30, cachedInput: 0.5, tiers: [...] }
|
|
40
|
+
* openAIPricingFor("gpt-5.5-pro"); // undefined — not in the table
|
|
30
41
|
*/
|
|
31
42
|
export declare function openAIPricingFor(modelName: string): ModelPricing | undefined;
|
|
32
43
|
/** USD per request for web_search (NOT non-reasoning web_search_preview).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"known-pricing.d.mts","names":[],"sources":["../../../../../../../packages/ai-openai/src/known-pricing.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"known-pricing.d.mts","names":[],"sources":["../../../../../../../packages/ai-openai/src/known-pricing.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA4Ba,sBAAsB,SAAS,eAAe;;qBA+D9C;;;;;;;;;;;wBAYG,iBAAiB,oBAAoB;;;;qBAOxC;EAA+B"}
|
package/esm/known-pricing.mjs
CHANGED
|
@@ -5,19 +5,109 @@
|
|
|
5
5
|
* models charges for cache writes.
|
|
6
6
|
*
|
|
7
7
|
* Source: https://developers.openai.com/api/docs/pricing (the target of
|
|
8
|
-
* platform.openai.com/docs/pricing), Standard tier,
|
|
8
|
+
* platform.openai.com/docs/pricing), Standard tier, as of
|
|
9
|
+
* {@link OPENAI_MODEL_PRICING_AS_OF}. Entries for models the page no
|
|
10
|
+
* longer lists (the retired ids and a few older ones) keep the rates
|
|
11
|
+
* verified on 2026-10-17, so a stored report can still be costed.
|
|
12
|
+
*
|
|
13
|
+
* Models priced by prompt length carry `tiers`: above 272K prompt tokens
|
|
14
|
+
* the whole request bills at the tier rates.
|
|
9
15
|
*
|
|
10
16
|
* Applied only when the SDK's provider label is `"openai"`, and only on
|
|
11
17
|
* an exact id match — dated snapshots can carry other prices. Left out on
|
|
12
18
|
* purpose, so pass `pricing` yourself for them:
|
|
13
19
|
*
|
|
14
|
-
* -
|
|
15
|
-
*
|
|
16
|
-
* `-pro` models. A flat `ModelPricing` cannot express the tiers.
|
|
20
|
+
* - The `-pro` models, `gpt-6-sol` / `gpt-5.6-sol` (promotional pricing
|
|
21
|
+
* until 2026-11-30) and models without a listed price.
|
|
17
22
|
* - Promotional, Batch, Flex and Priority pricing, and the regional
|
|
18
23
|
* (data-residency) uplift.
|
|
24
|
+
*
|
|
25
|
+
* Retired ids stay in the table so old reports keep their cost; see
|
|
26
|
+
* {@link OPENAI_MODEL_LIFECYCLE} for their status.
|
|
19
27
|
*/
|
|
20
28
|
const OPENAI_MODEL_PRICING = {
|
|
29
|
+
"gpt-6.1-terra": {
|
|
30
|
+
input: 1,
|
|
31
|
+
output: 5,
|
|
32
|
+
cachedInput: .05,
|
|
33
|
+
tiers: [{
|
|
34
|
+
abovePromptTokens: 272e3,
|
|
35
|
+
input: 2,
|
|
36
|
+
output: 7.5,
|
|
37
|
+
cachedInput: .1
|
|
38
|
+
}]
|
|
39
|
+
},
|
|
40
|
+
"gpt-6-cyber": {
|
|
41
|
+
input: 20,
|
|
42
|
+
output: 100,
|
|
43
|
+
cachedInput: 2
|
|
44
|
+
},
|
|
45
|
+
"gpt-6-astra": {
|
|
46
|
+
input: 10,
|
|
47
|
+
output: 50,
|
|
48
|
+
cachedInput: 1,
|
|
49
|
+
tiers: [{
|
|
50
|
+
abovePromptTokens: 272e3,
|
|
51
|
+
input: 20,
|
|
52
|
+
output: 75,
|
|
53
|
+
cachedInput: 2
|
|
54
|
+
}]
|
|
55
|
+
},
|
|
56
|
+
"gpt-6-luna": {
|
|
57
|
+
input: .1,
|
|
58
|
+
output: .5,
|
|
59
|
+
cachedInput: .01,
|
|
60
|
+
tiers: [{
|
|
61
|
+
abovePromptTokens: 272e3,
|
|
62
|
+
input: .2,
|
|
63
|
+
output: .75,
|
|
64
|
+
cachedInput: .02
|
|
65
|
+
}]
|
|
66
|
+
},
|
|
67
|
+
"gpt-5.6-terra": {
|
|
68
|
+
input: 2,
|
|
69
|
+
output: 12,
|
|
70
|
+
cachedInput: .2,
|
|
71
|
+
tiers: [{
|
|
72
|
+
abovePromptTokens: 272e3,
|
|
73
|
+
input: 4,
|
|
74
|
+
output: 18,
|
|
75
|
+
cachedInput: .4
|
|
76
|
+
}]
|
|
77
|
+
},
|
|
78
|
+
"gpt-5.6-luna": {
|
|
79
|
+
input: .2,
|
|
80
|
+
output: 1.2,
|
|
81
|
+
cachedInput: .02,
|
|
82
|
+
tiers: [{
|
|
83
|
+
abovePromptTokens: 272e3,
|
|
84
|
+
input: .4,
|
|
85
|
+
output: 1.8,
|
|
86
|
+
cachedInput: .04
|
|
87
|
+
}]
|
|
88
|
+
},
|
|
89
|
+
"gpt-5.5": {
|
|
90
|
+
input: 5,
|
|
91
|
+
output: 30,
|
|
92
|
+
cachedInput: .5,
|
|
93
|
+
tiers: [{
|
|
94
|
+
abovePromptTokens: 272e3,
|
|
95
|
+
input: 10,
|
|
96
|
+
output: 45,
|
|
97
|
+
cachedInput: 1
|
|
98
|
+
}]
|
|
99
|
+
},
|
|
100
|
+
"gpt-5.4": {
|
|
101
|
+
input: 2.5,
|
|
102
|
+
output: 15,
|
|
103
|
+
cachedInput: .25,
|
|
104
|
+
tiers: [{
|
|
105
|
+
abovePromptTokens: 272e3,
|
|
106
|
+
input: 5,
|
|
107
|
+
output: 22.5,
|
|
108
|
+
cachedInput: .5
|
|
109
|
+
}]
|
|
110
|
+
},
|
|
21
111
|
"gpt-5.4-mini": {
|
|
22
112
|
input: .75,
|
|
23
113
|
output: 4.5,
|
|
@@ -99,6 +189,8 @@ const OPENAI_MODEL_PRICING = {
|
|
|
99
189
|
cachedInput: 7.5
|
|
100
190
|
}
|
|
101
191
|
};
|
|
192
|
+
/** The date the {@link OPENAI_MODEL_PRICING} rates were last checked against OpenAI's pricing page. */
|
|
193
|
+
const OPENAI_MODEL_PRICING_AS_OF = "2026-11-06";
|
|
102
194
|
/**
|
|
103
195
|
* Look up the built-in list price for an OpenAI model id (exact match).
|
|
104
196
|
* Returns `undefined` for unknown ids, so cost stays unknown rather than
|
|
@@ -106,7 +198,8 @@ const OPENAI_MODEL_PRICING = {
|
|
|
106
198
|
*
|
|
107
199
|
* @example
|
|
108
200
|
* openAIPricingFor("gpt-4o-mini"); // { input: 0.15, output: 0.6, cachedInput: 0.075 }
|
|
109
|
-
* openAIPricingFor("gpt-5.5"); //
|
|
201
|
+
* openAIPricingFor("gpt-5.5"); // { input: 5, output: 30, cachedInput: 0.5, tiers: [...] }
|
|
202
|
+
* openAIPricingFor("gpt-5.5-pro"); // undefined — not in the table
|
|
110
203
|
*/
|
|
111
204
|
function openAIPricingFor(modelName) {
|
|
112
205
|
return OPENAI_MODEL_PRICING[modelName];
|
|
@@ -117,5 +210,5 @@ function openAIPricingFor(modelName) {
|
|
|
117
210
|
const OPENAI_SERVER_TOOL_PRICING = { webSearch: .01 };
|
|
118
211
|
|
|
119
212
|
//#endregion
|
|
120
|
-
export { OPENAI_MODEL_PRICING, OPENAI_SERVER_TOOL_PRICING, openAIPricingFor };
|
|
213
|
+
export { OPENAI_MODEL_PRICING, OPENAI_MODEL_PRICING_AS_OF, OPENAI_SERVER_TOOL_PRICING, openAIPricingFor };
|
|
121
214
|
//# sourceMappingURL=known-pricing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"known-pricing.mjs","names":[],"sources":["../../../../../../../packages/ai-openai/src/known-pricing.ts"],"sourcesContent":["import type { ModelPricing } from \"@warlock.js/ai\";\n\n/**\n * Built-in OpenAI API list prices, USD per 1,000,000 tokens, keyed by\n * exact model id. `cachedInput` is the cached-input rate. None of these\n * models charges for cache writes.\n *\n * Source: https://developers.openai.com/api/docs/pricing (the target of\n * platform.openai.com/docs/pricing), Standard tier,
|
|
1
|
+
{"version":3,"file":"known-pricing.mjs","names":[],"sources":["../../../../../../../packages/ai-openai/src/known-pricing.ts"],"sourcesContent":["import type { ModelPricing } from \"@warlock.js/ai\";\n\n/**\n * Built-in OpenAI API list prices, USD per 1,000,000 tokens, keyed by\n * exact model id. `cachedInput` is the cached-input rate. None of these\n * models charges for cache writes.\n *\n * Source: https://developers.openai.com/api/docs/pricing (the target of\n * platform.openai.com/docs/pricing), Standard tier, as of\n * {@link OPENAI_MODEL_PRICING_AS_OF}. Entries for models the page no\n * longer lists (the retired ids and a few older ones) keep the rates\n * verified on 2026-10-17, so a stored report can still be costed.\n *\n * Models priced by prompt length carry `tiers`: above 272K prompt tokens\n * the whole request bills at the tier rates.\n *\n * Applied only when the SDK's provider label is `\"openai\"`, and only on\n * an exact id match — dated snapshots can carry other prices. Left out on\n * purpose, so pass `pricing` yourself for them:\n *\n * - The `-pro` models, `gpt-6-sol` / `gpt-5.6-sol` (promotional pricing\n * until 2026-11-30) and models without a listed price.\n * - Promotional, Batch, Flex and Priority pricing, and the regional\n * (data-residency) uplift.\n *\n * Retired ids stay in the table so old reports keep their cost; see\n * {@link OPENAI_MODEL_LIFECYCLE} for their status.\n */\nexport const OPENAI_MODEL_PRICING: Readonly<Record<string, ModelPricing>> = {\n \"gpt-6.1-terra\": {\n input: 1,\n output: 5,\n cachedInput: 0.05,\n tiers: [{ abovePromptTokens: 272_000, input: 2, output: 7.5, cachedInput: 0.1 }],\n },\n \"gpt-6-cyber\": { input: 20, output: 100, cachedInput: 2 },\n \"gpt-6-astra\": {\n input: 10,\n output: 50,\n cachedInput: 1,\n tiers: [{ abovePromptTokens: 272_000, input: 20, output: 75, cachedInput: 2 }],\n },\n \"gpt-6-luna\": {\n input: 0.1,\n output: 0.5,\n cachedInput: 0.01,\n tiers: [{ abovePromptTokens: 272_000, input: 0.2, output: 0.75, cachedInput: 0.02 }],\n },\n \"gpt-5.6-terra\": {\n input: 2,\n output: 12,\n cachedInput: 0.2,\n tiers: [{ abovePromptTokens: 272_000, input: 4, output: 18, cachedInput: 0.4 }],\n },\n \"gpt-5.6-luna\": {\n input: 0.2,\n output: 1.2,\n cachedInput: 0.02,\n tiers: [{ abovePromptTokens: 272_000, input: 0.4, output: 1.8, cachedInput: 0.04 }],\n },\n \"gpt-5.5\": {\n input: 5,\n output: 30,\n cachedInput: 0.5,\n tiers: [{ abovePromptTokens: 272_000, input: 10, output: 45, cachedInput: 1 }],\n },\n \"gpt-5.4\": {\n input: 2.5,\n output: 15,\n cachedInput: 0.25,\n tiers: [{ abovePromptTokens: 272_000, input: 5, output: 22.5, cachedInput: 0.5 }],\n },\n \"gpt-5.4-mini\": { input: 0.75, output: 4.5, cachedInput: 0.075 },\n \"gpt-5.4-nano\": { input: 0.2, output: 1.25, cachedInput: 0.02 },\n \"gpt-5.2\": { input: 1.75, output: 14, cachedInput: 0.175 },\n \"gpt-5.1\": { input: 1.25, output: 10, cachedInput: 0.125 },\n \"gpt-5\": { input: 1.25, output: 10, cachedInput: 0.125 },\n \"gpt-5-mini\": { input: 0.25, output: 2, cachedInput: 0.025 },\n \"gpt-5-nano\": { input: 0.05, output: 0.4, cachedInput: 0.005 },\n \"gpt-4.1\": { input: 2, output: 8, cachedInput: 0.5 },\n \"gpt-4.1-mini\": { input: 0.4, output: 1.6, cachedInput: 0.1 },\n \"gpt-4.1-nano\": { input: 0.1, output: 0.4, cachedInput: 0.025 },\n \"gpt-4o\": { input: 2.5, output: 10, cachedInput: 1.25 },\n \"gpt-4o-mini\": { input: 0.15, output: 0.6, cachedInput: 0.075 },\n o3: { input: 2, output: 8, cachedInput: 0.5 },\n \"o4-mini\": { input: 1.1, output: 4.4, cachedInput: 0.275 },\n \"o3-mini\": { input: 1.1, output: 4.4, cachedInput: 0.55 },\n o1: { input: 15, output: 60, cachedInput: 7.5 },\n};\n\n/** The date the {@link OPENAI_MODEL_PRICING} rates were last checked against OpenAI's pricing page. */\nexport const OPENAI_MODEL_PRICING_AS_OF = \"2026-11-06\";\n\n/**\n * Look up the built-in list price for an OpenAI model id (exact match).\n * Returns `undefined` for unknown ids, so cost stays unknown rather than\n * wrong.\n *\n * @example\n * openAIPricingFor(\"gpt-4o-mini\"); // { input: 0.15, output: 0.6, cachedInput: 0.075 }\n * openAIPricingFor(\"gpt-5.5\"); // { input: 5, output: 30, cachedInput: 0.5, tiers: [...] }\n * openAIPricingFor(\"gpt-5.5-pro\"); // undefined — not in the table\n */\nexport function openAIPricingFor(modelName: string): ModelPricing | undefined {\n return OPENAI_MODEL_PRICING[modelName];\n}\n\n/** USD per request for web_search (NOT non-reasoning web_search_preview).\n * Search content tokens are additional; preview variants can have other rates.\n * https://developers.openai.com/api/docs/pricing#built-in-tools — verified 2026-10-18. */\nexport const OPENAI_SERVER_TOOL_PRICING = { webSearch: 0.01 };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,uBAA+D;CAC1E,iBAAiB;EACf,OAAO;EACP,QAAQ;EACR,aAAa;EACb,OAAO,CAAC;GAAE,mBAAmB;GAAS,OAAO;GAAG,QAAQ;GAAK,aAAa;EAAI,CAAC;CACjF;CACA,eAAe;EAAE,OAAO;EAAI,QAAQ;EAAK,aAAa;CAAE;CACxD,eAAe;EACb,OAAO;EACP,QAAQ;EACR,aAAa;EACb,OAAO,CAAC;GAAE,mBAAmB;GAAS,OAAO;GAAI,QAAQ;GAAI,aAAa;EAAE,CAAC;CAC/E;CACA,cAAc;EACZ,OAAO;EACP,QAAQ;EACR,aAAa;EACb,OAAO,CAAC;GAAE,mBAAmB;GAAS,OAAO;GAAK,QAAQ;GAAM,aAAa;EAAK,CAAC;CACrF;CACA,iBAAiB;EACf,OAAO;EACP,QAAQ;EACR,aAAa;EACb,OAAO,CAAC;GAAE,mBAAmB;GAAS,OAAO;GAAG,QAAQ;GAAI,aAAa;EAAI,CAAC;CAChF;CACA,gBAAgB;EACd,OAAO;EACP,QAAQ;EACR,aAAa;EACb,OAAO,CAAC;GAAE,mBAAmB;GAAS,OAAO;GAAK,QAAQ;GAAK,aAAa;EAAK,CAAC;CACpF;CACA,WAAW;EACT,OAAO;EACP,QAAQ;EACR,aAAa;EACb,OAAO,CAAC;GAAE,mBAAmB;GAAS,OAAO;GAAI,QAAQ;GAAI,aAAa;EAAE,CAAC;CAC/E;CACA,WAAW;EACT,OAAO;EACP,QAAQ;EACR,aAAa;EACb,OAAO,CAAC;GAAE,mBAAmB;GAAS,OAAO;GAAG,QAAQ;GAAM,aAAa;EAAI,CAAC;CAClF;CACA,gBAAgB;EAAE,OAAO;EAAM,QAAQ;EAAK,aAAa;CAAM;CAC/D,gBAAgB;EAAE,OAAO;EAAK,QAAQ;EAAM,aAAa;CAAK;CAC9D,WAAW;EAAE,OAAO;EAAM,QAAQ;EAAI,aAAa;CAAM;CACzD,WAAW;EAAE,OAAO;EAAM,QAAQ;EAAI,aAAa;CAAM;CACzD,SAAS;EAAE,OAAO;EAAM,QAAQ;EAAI,aAAa;CAAM;CACvD,cAAc;EAAE,OAAO;EAAM,QAAQ;EAAG,aAAa;CAAM;CAC3D,cAAc;EAAE,OAAO;EAAM,QAAQ;EAAK,aAAa;CAAM;CAC7D,WAAW;EAAE,OAAO;EAAG,QAAQ;EAAG,aAAa;CAAI;CACnD,gBAAgB;EAAE,OAAO;EAAK,QAAQ;EAAK,aAAa;CAAI;CAC5D,gBAAgB;EAAE,OAAO;EAAK,QAAQ;EAAK,aAAa;CAAM;CAC9D,UAAU;EAAE,OAAO;EAAK,QAAQ;EAAI,aAAa;CAAK;CACtD,eAAe;EAAE,OAAO;EAAM,QAAQ;EAAK,aAAa;CAAM;CAC9D,IAAI;EAAE,OAAO;EAAG,QAAQ;EAAG,aAAa;CAAI;CAC5C,WAAW;EAAE,OAAO;EAAK,QAAQ;EAAK,aAAa;CAAM;CACzD,WAAW;EAAE,OAAO;EAAK,QAAQ;EAAK,aAAa;CAAK;CACxD,IAAI;EAAE,OAAO;EAAI,QAAQ;EAAI,aAAa;CAAI;AAChD;;AAGA,MAAa,6BAA6B;;;;;;;;;;;AAY1C,SAAgB,iBAAiB,WAA6C;CAC5E,OAAO,qBAAqB;AAC9B;;;;AAKA,MAAa,6BAA6B,EAAE,WAAW,IAAK"}
|
package/llms-full.txt
CHANGED
|
@@ -277,8 +277,9 @@ const side = await openai
|
|
|
277
277
|
console.log(totalCost(side.usage.cost));
|
|
278
278
|
```
|
|
279
279
|
|
|
280
|
-
- **Source.** `OPENAI_MODEL_PRICING` comes from https://developers.openai.com/api/docs/pricing (the target of platform.openai.com/docs/pricing), Standard tier,
|
|
281
|
-
- **
|
|
280
|
+
- **Source.** `OPENAI_MODEL_PRICING` comes from https://developers.openai.com/api/docs/pricing (the target of platform.openai.com/docs/pricing), Standard tier, as of `OPENAI_MODEL_PRICING_AS_OF` (2026-11-06). It covers `gpt-6.1-terra`, `gpt-6-cyber`, `gpt-6-astra`, `gpt-6-luna`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5`, `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.4-nano`, `gpt-5.2`, `gpt-5.1`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-4.1` (+ `-mini` / `-nano`), `gpt-4o`, `gpt-4o-mini`, `o3`, `o4-mini`, `o3-mini`, `o1`. None of them charges for cache writes. The gpt-6, gpt-5.6, gpt-5.5 and gpt-5.4 entries carry `tiers` (above 272K prompt tokens the whole request bills at the tier rates; `computeCost` and `resolvePricing` from `@warlock.js/ai` apply them).
|
|
281
|
+
- **Lifecycle.** `OPENAI_MODEL_LIFECYCLE` / `openAILifecycleFor(name)` (checked `OPENAI_MODEL_LIFECYCLE_AS_OF`) gives `{ status: "current" | "retiring" | "retired", retiresOn?, replacement? }` per priced id from https://developers.openai.com/api/docs/deprecations: `o1`, `o3-mini`, `o4-mini`, `gpt-4.1-nano` retired 2026-10-23; `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `o3` retiring 2026-12-11; `gpt-4.1`, `gpt-4.1-mini` 2027-01-14; `gpt-5.1`, `gpt-5.4-nano` 2027-04-01. Retired ids stay priced so old reports keep their cost. `gpt-4o`, `gpt-4o-mini` and `gpt-5.2` have no status (OpenAI lists only their snapshots or variants).
|
|
282
|
+
- **Deliberately unpriced:** the `-pro` models, `gpt-6-sol` / `gpt-5.6-sol` (promotional pricing until 2026-11-30), dated snapshot ids, Batch / Flex / Priority pricing, and the regional data-residency uplift. Wrapper SDKs (`provider` other than `"openai"`) never fall back to this table.
|
|
282
283
|
|
|
283
284
|
## Errors
|
|
284
285
|
|
package/package.json
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"openai": "^7.23.0",
|
|
18
|
-
"@warlock.js/logger": "5.
|
|
18
|
+
"@warlock.js/logger": "5.47.1"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@warlock.js/ai": "5.
|
|
21
|
+
"@warlock.js/ai": "5.47.1"
|
|
22
22
|
},
|
|
23
|
-
"version": "5.
|
|
23
|
+
"version": "5.47.1",
|
|
24
24
|
"main": "./cjs/index.cjs",
|
|
25
25
|
"module": "./esm/index.mjs",
|
|
26
26
|
"types": "./esm/index.d.mts",
|
package/skills/SKILL.md
CHANGED
|
@@ -269,8 +269,9 @@ const side = await openai
|
|
|
269
269
|
console.log(totalCost(side.usage.cost));
|
|
270
270
|
```
|
|
271
271
|
|
|
272
|
-
- **Source.** `OPENAI_MODEL_PRICING` comes from https://developers.openai.com/api/docs/pricing (the target of platform.openai.com/docs/pricing), Standard tier,
|
|
273
|
-
- **
|
|
272
|
+
- **Source.** `OPENAI_MODEL_PRICING` comes from https://developers.openai.com/api/docs/pricing (the target of platform.openai.com/docs/pricing), Standard tier, as of `OPENAI_MODEL_PRICING_AS_OF` (2026-11-06). It covers `gpt-6.1-terra`, `gpt-6-cyber`, `gpt-6-astra`, `gpt-6-luna`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5`, `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.4-nano`, `gpt-5.2`, `gpt-5.1`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-4.1` (+ `-mini` / `-nano`), `gpt-4o`, `gpt-4o-mini`, `o3`, `o4-mini`, `o3-mini`, `o1`. None of them charges for cache writes. The gpt-6, gpt-5.6, gpt-5.5 and gpt-5.4 entries carry `tiers` (above 272K prompt tokens the whole request bills at the tier rates; `computeCost` and `resolvePricing` from `@warlock.js/ai` apply them).
|
|
273
|
+
- **Lifecycle.** `OPENAI_MODEL_LIFECYCLE` / `openAILifecycleFor(name)` (checked `OPENAI_MODEL_LIFECYCLE_AS_OF`) gives `{ status: "current" | "retiring" | "retired", retiresOn?, replacement? }` per priced id from https://developers.openai.com/api/docs/deprecations: `o1`, `o3-mini`, `o4-mini`, `gpt-4.1-nano` retired 2026-10-23; `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `o3` retiring 2026-12-11; `gpt-4.1`, `gpt-4.1-mini` 2027-01-14; `gpt-5.1`, `gpt-5.4-nano` 2027-04-01. Retired ids stay priced so old reports keep their cost. `gpt-4o`, `gpt-4o-mini` and `gpt-5.2` have no status (OpenAI lists only their snapshots or variants).
|
|
274
|
+
- **Deliberately unpriced:** the `-pro` models, `gpt-6-sol` / `gpt-5.6-sol` (promotional pricing until 2026-11-30), dated snapshot ids, Batch / Flex / Priority pricing, and the regional data-residency uplift. Wrapper SDKs (`provider` other than `"openai"`) never fall back to this table.
|
|
274
275
|
|
|
275
276
|
## Errors
|
|
276
277
|
|