@pydantic/genai-prices 0.0.35 → 0.0.37
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/dist/cli.js +741 -263
- package/dist/index.cjs +4 -4
- package/dist/index.js +579 -90
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import de from "yargs";
|
|
3
3
|
import { format as he } from "util";
|
|
4
|
-
import { resolve as
|
|
4
|
+
import { resolve as ie, normalize as Ie } from "path";
|
|
5
5
|
import { readFileSync as ke, writeFile as Le, statSync as Pe } from "fs";
|
|
6
6
|
import "assert";
|
|
7
7
|
import { fileURLToPath as Te } from "url";
|
|
@@ -14,53 +14,53 @@ function Se() {
|
|
|
14
14
|
function Ge() {
|
|
15
15
|
return !!process.versions.electron;
|
|
16
16
|
}
|
|
17
|
-
function Ce(
|
|
18
|
-
return
|
|
17
|
+
function Ce(a) {
|
|
18
|
+
return a.slice(Ae() + 1);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* @license
|
|
22
22
|
* Copyright (c) 2016, Contributors
|
|
23
23
|
* SPDX-License-Identifier: ISC
|
|
24
24
|
*/
|
|
25
|
-
function W(
|
|
26
|
-
if (
|
|
27
|
-
return
|
|
25
|
+
function W(a) {
|
|
26
|
+
if (a !== a.toLowerCase() && a !== a.toUpperCase() || (a = a.toLowerCase()), a.indexOf("-") === -1 && a.indexOf("_") === -1)
|
|
27
|
+
return a;
|
|
28
28
|
{
|
|
29
29
|
let m = "", s = !1;
|
|
30
|
-
const u =
|
|
31
|
-
for (let _ = u ? u[0].length : 0; _ <
|
|
32
|
-
let k =
|
|
30
|
+
const u = a.match(/^-+/);
|
|
31
|
+
for (let _ = u ? u[0].length : 0; _ < a.length; _++) {
|
|
32
|
+
let k = a.charAt(_);
|
|
33
33
|
s && (s = !1, k = k.toUpperCase()), _ !== 0 && (k === "-" || k === "_") ? s = !0 : k !== "-" && k !== "_" && (m += k);
|
|
34
34
|
}
|
|
35
35
|
return m;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function Oe(
|
|
39
|
-
const m =
|
|
38
|
+
function Oe(a, n) {
|
|
39
|
+
const m = a.toLowerCase();
|
|
40
40
|
n = n || "-";
|
|
41
41
|
let s = "";
|
|
42
|
-
for (let u = 0; u <
|
|
43
|
-
const _ = m.charAt(u), k =
|
|
42
|
+
for (let u = 0; u < a.length; u++) {
|
|
43
|
+
const _ = m.charAt(u), k = a.charAt(u);
|
|
44
44
|
_ !== k && u > 0 ? s += `${n}${m.charAt(u)}` : s += k;
|
|
45
45
|
}
|
|
46
46
|
return s;
|
|
47
47
|
}
|
|
48
|
-
function Re(
|
|
49
|
-
return
|
|
48
|
+
function Re(a) {
|
|
49
|
+
return a == null ? !1 : typeof a == "number" || /^0x[0-9a-f]+$/i.test(a) ? !0 : /^0[^.]/.test(a) ? !1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(a);
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright (c) 2016, Contributors
|
|
54
54
|
* SPDX-License-Identifier: ISC
|
|
55
55
|
*/
|
|
56
|
-
function
|
|
57
|
-
if (Array.isArray(
|
|
58
|
-
return
|
|
59
|
-
|
|
56
|
+
function Ee(a) {
|
|
57
|
+
if (Array.isArray(a))
|
|
58
|
+
return a.map((k) => typeof k != "string" ? k + "" : k);
|
|
59
|
+
a = a.trim();
|
|
60
60
|
let n = 0, m = null, s = null, u = null;
|
|
61
61
|
const _ = [];
|
|
62
|
-
for (let k = 0; k <
|
|
63
|
-
if (m = s, s =
|
|
62
|
+
for (let k = 0; k < a.length; k++) {
|
|
63
|
+
if (m = s, s = a.charAt(k), s === " " && !u) {
|
|
64
64
|
m !== " " && n++;
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
@@ -73,19 +73,19 @@ function Ne(i) {
|
|
|
73
73
|
* Copyright (c) 2016, Contributors
|
|
74
74
|
* SPDX-License-Identifier: ISC
|
|
75
75
|
*/
|
|
76
|
-
var
|
|
77
|
-
(function(
|
|
78
|
-
|
|
79
|
-
})(
|
|
76
|
+
var I;
|
|
77
|
+
(function(a) {
|
|
78
|
+
a.BOOLEAN = "boolean", a.STRING = "string", a.NUMBER = "number", a.ARRAY = "array";
|
|
79
|
+
})(I || (I = {}));
|
|
80
80
|
/**
|
|
81
81
|
* @license
|
|
82
82
|
* Copyright (c) 2016, Contributors
|
|
83
83
|
* SPDX-License-Identifier: ISC
|
|
84
84
|
*/
|
|
85
|
-
let
|
|
86
|
-
class
|
|
85
|
+
let A;
|
|
86
|
+
class Ne {
|
|
87
87
|
constructor(n) {
|
|
88
|
-
|
|
88
|
+
A = n;
|
|
89
89
|
}
|
|
90
90
|
parse(n, m) {
|
|
91
91
|
const s = Object.assign({
|
|
@@ -105,7 +105,7 @@ class Ee {
|
|
|
105
105
|
number: void 0,
|
|
106
106
|
__: void 0,
|
|
107
107
|
key: void 0
|
|
108
|
-
}, m), u =
|
|
108
|
+
}, m), u = Ee(n), _ = typeof n == "string", k = ze(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), h = Object.assign({
|
|
109
109
|
"boolean-negation": !0,
|
|
110
110
|
"camel-case-expansion": !0,
|
|
111
111
|
"combine-arrays": !1,
|
|
@@ -124,7 +124,7 @@ class Ee {
|
|
|
124
124
|
"strip-aliased": !1,
|
|
125
125
|
"strip-dashed": !1,
|
|
126
126
|
"unknown-options-as-args": !1
|
|
127
|
-
}, s.configuration), f = Object.assign(/* @__PURE__ */ Object.create(null), s.default),
|
|
127
|
+
}, s.configuration), f = Object.assign(/* @__PURE__ */ Object.create(null), s.default), y = s.configObjects || [], P = s.envPrefix, S = h["populate--"], G = S ? "--" : "_", Q = /* @__PURE__ */ Object.create(null), oe = /* @__PURE__ */ Object.create(null), C = s.__ || A.format, r = {
|
|
128
128
|
aliases: /* @__PURE__ */ Object.create(null),
|
|
129
129
|
arrays: /* @__PURE__ */ Object.create(null),
|
|
130
130
|
bools: /* @__PURE__ */ Object.create(null),
|
|
@@ -136,16 +136,16 @@ class Ee {
|
|
|
136
136
|
nargs: /* @__PURE__ */ Object.create(null),
|
|
137
137
|
coercions: /* @__PURE__ */ Object.create(null),
|
|
138
138
|
keys: []
|
|
139
|
-
},
|
|
139
|
+
}, L = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, U = new RegExp("^--" + h["negation-prefix"] + "(.+)");
|
|
140
140
|
[].concat(s.array || []).filter(Boolean).forEach(function(e) {
|
|
141
|
-
const
|
|
141
|
+
const i = typeof e == "object" ? e.key : e, l = Object.keys(e).map(function(o) {
|
|
142
142
|
return {
|
|
143
143
|
boolean: "bools",
|
|
144
144
|
string: "strings",
|
|
145
145
|
number: "numbers"
|
|
146
146
|
}[o];
|
|
147
147
|
}).filter(Boolean).pop();
|
|
148
|
-
l && (r[l][
|
|
148
|
+
l && (r[l][i] = !0), r.arrays[i] = !0, r.keys.push(i);
|
|
149
149
|
}), [].concat(s.boolean || []).filter(Boolean).forEach(function(e) {
|
|
150
150
|
r.bools[e] = !0, r.keys.push(e);
|
|
151
151
|
}), [].concat(s.string || []).filter(Boolean).forEach(function(e) {
|
|
@@ -156,46 +156,46 @@ class Ee {
|
|
|
156
156
|
r.counts[e] = !0, r.keys.push(e);
|
|
157
157
|
}), [].concat(s.normalize || []).filter(Boolean).forEach(function(e) {
|
|
158
158
|
r.normalize[e] = !0, r.keys.push(e);
|
|
159
|
-
}), typeof s.narg == "object" && Object.entries(s.narg).forEach(([e,
|
|
160
|
-
typeof
|
|
161
|
-
}), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([e,
|
|
162
|
-
typeof
|
|
159
|
+
}), typeof s.narg == "object" && Object.entries(s.narg).forEach(([e, i]) => {
|
|
160
|
+
typeof i == "number" && (r.nargs[e] = i, r.keys.push(e));
|
|
161
|
+
}), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([e, i]) => {
|
|
162
|
+
typeof i == "function" && (r.coercions[e] = i, r.keys.push(e));
|
|
163
163
|
}), typeof s.config < "u" && (Array.isArray(s.config) || typeof s.config == "string" ? [].concat(s.config).filter(Boolean).forEach(function(e) {
|
|
164
164
|
r.configs[e] = !0;
|
|
165
|
-
}) : typeof s.config == "object" && Object.entries(s.config).forEach(([e,
|
|
166
|
-
(typeof
|
|
165
|
+
}) : typeof s.config == "object" && Object.entries(s.config).forEach(([e, i]) => {
|
|
166
|
+
(typeof i == "boolean" || typeof i == "function") && (r.configs[e] = i);
|
|
167
167
|
})), qe(s.key, k, s.default, r.arrays), Object.keys(f).forEach(function(e) {
|
|
168
|
-
(r.aliases[e] || []).forEach(function(
|
|
169
|
-
f[
|
|
168
|
+
(r.aliases[e] || []).forEach(function(i) {
|
|
169
|
+
f[i] = f[e];
|
|
170
170
|
});
|
|
171
171
|
});
|
|
172
|
-
let
|
|
172
|
+
let B = null;
|
|
173
173
|
Me();
|
|
174
174
|
let F = [];
|
|
175
175
|
const w = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), ne = {};
|
|
176
176
|
for (let e = 0; e < u.length; e++) {
|
|
177
|
-
const
|
|
177
|
+
const i = u[e], l = i.replace(/^-{3,}/, "---");
|
|
178
178
|
let o, t, p, c, d, v;
|
|
179
|
-
if (
|
|
180
|
-
K(
|
|
179
|
+
if (i !== "--" && /^-/.test(i) && H(i))
|
|
180
|
+
K(i);
|
|
181
181
|
else if (l.match(/^---+(=|$)/)) {
|
|
182
|
-
K(
|
|
182
|
+
K(i);
|
|
183
183
|
continue;
|
|
184
|
-
} else if (
|
|
185
|
-
c =
|
|
186
|
-
else if (
|
|
187
|
-
c =
|
|
188
|
-
else if (
|
|
189
|
-
c =
|
|
190
|
-
else if (
|
|
191
|
-
c =
|
|
192
|
-
else if (
|
|
193
|
-
d = u[e + 1], c =
|
|
194
|
-
else if (
|
|
195
|
-
p =
|
|
184
|
+
} else if (i.match(/^--.+=/) || !h["short-option-groups"] && i.match(/^-.+=/))
|
|
185
|
+
c = i.match(/^--?([^=]+)=([\s\S]*)$/), c !== null && Array.isArray(c) && c.length >= 3 && (g(c[1], r.arrays) ? e = V(e, c[1], u, c[2]) : g(c[1], r.nargs) !== !1 ? e = D(e, c[1], u, c[2]) : q(c[1], c[2], !0));
|
|
186
|
+
else if (i.match(U) && h["boolean-negation"])
|
|
187
|
+
c = i.match(U), c !== null && Array.isArray(c) && c.length >= 2 && (t = c[1], q(t, g(t, r.arrays) ? [!1] : !1));
|
|
188
|
+
else if (i.match(/^--.+/) || !h["short-option-groups"] && i.match(/^-[^-]+/))
|
|
189
|
+
c = i.match(/^--?(.+)/), c !== null && Array.isArray(c) && c.length >= 2 && (t = c[1], g(t, r.arrays) ? e = V(e, t, u) : g(t, r.nargs) !== !1 ? e = D(e, t, u) : (d = u[e + 1], d !== void 0 && (!d.match(/^-/) || d.match(L)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, R(t))));
|
|
190
|
+
else if (i.match(/^-.\..+=/))
|
|
191
|
+
c = i.match(/^-([^=]+)=([\s\S]*)$/), c !== null && Array.isArray(c) && c.length >= 3 && q(c[1], c[2]);
|
|
192
|
+
else if (i.match(/^-.\..+/) && !i.match(L))
|
|
193
|
+
d = u[e + 1], c = i.match(/^-(.\..+)/), c !== null && Array.isArray(c) && c.length >= 2 && (t = c[1], d !== void 0 && !d.match(/^-/) && !g(t, r.bools) && !g(t, r.counts) ? (q(t, d), e++) : q(t, R(t)));
|
|
194
|
+
else if (i.match(/^-[^-]+/) && !i.match(L)) {
|
|
195
|
+
p = i.slice(1, -1).split(""), o = !1;
|
|
196
196
|
for (let x = 0; x < p.length; x++) {
|
|
197
|
-
if (d =
|
|
198
|
-
v =
|
|
197
|
+
if (d = i.slice(x + 2), p[x + 1] && p[x + 1] === "=") {
|
|
198
|
+
v = i.slice(x + 3), t = p[x], g(t, r.arrays) ? e = V(e, t, u, v) : g(t, r.nargs) !== !1 ? e = D(e, t, u, v) : q(t, v), o = !0;
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
201
|
if (d === "-") {
|
|
@@ -210,75 +210,75 @@ class Ee {
|
|
|
210
210
|
q(p[x], d), o = !0;
|
|
211
211
|
break;
|
|
212
212
|
} else
|
|
213
|
-
q(p[x],
|
|
213
|
+
q(p[x], R(p[x]));
|
|
214
214
|
}
|
|
215
|
-
t =
|
|
216
|
-
} else if (
|
|
217
|
-
t =
|
|
218
|
-
else if (
|
|
215
|
+
t = i.slice(-1)[0], !o && t !== "-" && (g(t, r.arrays) ? e = V(e, t, u) : g(t, r.nargs) !== !1 ? e = D(e, t, u) : (d = u[e + 1], d !== void 0 && (!/^(-|--)[^-]/.test(d) || d.match(L)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, R(t))));
|
|
216
|
+
} else if (i.match(/^-[0-9]$/) && i.match(L) && g(i.slice(1), r.bools))
|
|
217
|
+
t = i.slice(1), q(t, R(t));
|
|
218
|
+
else if (i === "--") {
|
|
219
219
|
F = u.slice(e + 1);
|
|
220
220
|
break;
|
|
221
221
|
} else if (h["halt-at-non-option"]) {
|
|
222
222
|
F = u.slice(e);
|
|
223
223
|
break;
|
|
224
224
|
} else
|
|
225
|
-
K(
|
|
225
|
+
K(i);
|
|
226
226
|
}
|
|
227
227
|
re(w, !0), re(w, !1), _e(w), ge(), me(w, r.aliases, f, !0), fe(w), h["set-placeholder-key"] && be(w), Object.keys(r.counts).forEach(function(e) {
|
|
228
|
-
|
|
229
|
-
}),
|
|
230
|
-
w[
|
|
228
|
+
E(w, e.split(".")) || q(e, 0);
|
|
229
|
+
}), S && F.length && (w[G] = []), F.forEach(function(e) {
|
|
230
|
+
w[G].push(e);
|
|
231
231
|
}), h["camel-case-expansion"] && h["strip-dashed"] && Object.keys(w).filter((e) => e !== "--" && e.includes("-")).forEach((e) => {
|
|
232
232
|
delete w[e];
|
|
233
233
|
}), h["strip-aliased"] && [].concat(...Object.keys(k).map((e) => k[e])).forEach((e) => {
|
|
234
|
-
h["camel-case-expansion"] && e.includes("-") && delete w[e.split(".").map((
|
|
234
|
+
h["camel-case-expansion"] && e.includes("-") && delete w[e.split(".").map((i) => W(i)).join(".")], delete w[e];
|
|
235
235
|
});
|
|
236
236
|
function K(e) {
|
|
237
|
-
const
|
|
238
|
-
(typeof
|
|
237
|
+
const i = $("_", e);
|
|
238
|
+
(typeof i == "string" || typeof i == "number") && w._.push(i);
|
|
239
239
|
}
|
|
240
|
-
function D(e,
|
|
241
|
-
let t, p = g(
|
|
240
|
+
function D(e, i, l, o) {
|
|
241
|
+
let t, p = g(i, r.nargs);
|
|
242
242
|
if (p = typeof p != "number" || isNaN(p) ? 1 : p, p === 0)
|
|
243
|
-
return
|
|
244
|
-
let c =
|
|
243
|
+
return T(o) || (B = Error(C("Argument unexpected for: %s", i))), q(i, R(i)), e;
|
|
244
|
+
let c = T(o) ? 0 : 1;
|
|
245
245
|
if (h["nargs-eats-options"])
|
|
246
|
-
l.length - (e + 1) + c < p && (
|
|
246
|
+
l.length - (e + 1) + c < p && (B = Error(C("Not enough arguments following: %s", i))), c = p;
|
|
247
247
|
else {
|
|
248
|
-
for (t = e + 1; t < l.length && (!l[t].match(/^-[^0-9]/) || l[t].match(
|
|
248
|
+
for (t = e + 1; t < l.length && (!l[t].match(/^-[^0-9]/) || l[t].match(L) || H(l[t])); t++)
|
|
249
249
|
c++;
|
|
250
|
-
c < p && (
|
|
250
|
+
c < p && (B = Error(C("Not enough arguments following: %s", i)));
|
|
251
251
|
}
|
|
252
252
|
let d = Math.min(c, p);
|
|
253
|
-
for (!
|
|
254
|
-
q(
|
|
253
|
+
for (!T(o) && d > 0 && (q(i, o), d--), t = e + 1; t < d + e + 1; t++)
|
|
254
|
+
q(i, l[t]);
|
|
255
255
|
return e + d;
|
|
256
256
|
}
|
|
257
|
-
function V(e,
|
|
257
|
+
function V(e, i, l, o) {
|
|
258
258
|
let t = [], p = o || l[e + 1];
|
|
259
|
-
const c = g(
|
|
260
|
-
if (g(
|
|
259
|
+
const c = g(i, r.nargs);
|
|
260
|
+
if (g(i, r.bools) && !/^(true|false)$/.test(p))
|
|
261
261
|
t.push(!0);
|
|
262
|
-
else if (
|
|
263
|
-
if (f[
|
|
264
|
-
const d = f[
|
|
262
|
+
else if (T(p) || T(o) && /^-/.test(p) && !L.test(p) && !H(p)) {
|
|
263
|
+
if (f[i] !== void 0) {
|
|
264
|
+
const d = f[i];
|
|
265
265
|
t = Array.isArray(d) ? d : [d];
|
|
266
266
|
}
|
|
267
267
|
} else {
|
|
268
|
-
|
|
269
|
-
for (let d = e + 1; d < l.length && !(!h["greedy-arrays"] && t.length > 0 || c && typeof c == "number" && t.length >= c || (p = l[d], /^-/.test(p) && !
|
|
270
|
-
e = d, t.push(Y(
|
|
268
|
+
T(o) || t.push(Y(i, o, !0));
|
|
269
|
+
for (let d = e + 1; d < l.length && !(!h["greedy-arrays"] && t.length > 0 || c && typeof c == "number" && t.length >= c || (p = l[d], /^-/.test(p) && !L.test(p) && !H(p))); d++)
|
|
270
|
+
e = d, t.push(Y(i, p, _));
|
|
271
271
|
}
|
|
272
|
-
return typeof c == "number" && (c && t.length < c || isNaN(c) && t.length === 0) && (
|
|
272
|
+
return typeof c == "number" && (c && t.length < c || isNaN(c) && t.length === 0) && (B = Error(C("Not enough arguments following: %s", i))), q(i, t), e;
|
|
273
273
|
}
|
|
274
|
-
function q(e,
|
|
274
|
+
function q(e, i, l = _) {
|
|
275
275
|
if (/-/.test(e) && h["camel-case-expansion"]) {
|
|
276
276
|
const p = e.split(".").map(function(c) {
|
|
277
277
|
return W(c);
|
|
278
278
|
}).join(".");
|
|
279
279
|
se(e, p);
|
|
280
280
|
}
|
|
281
|
-
const o = Y(e,
|
|
281
|
+
const o = Y(e, i, l), t = e.split(".");
|
|
282
282
|
N(w, t, o), r.aliases[e] && r.aliases[e].forEach(function(p) {
|
|
283
283
|
const c = p.split(".");
|
|
284
284
|
N(w, c, o);
|
|
@@ -290,35 +290,35 @@ class Ee {
|
|
|
290
290
|
Object.defineProperty(ne, c, {
|
|
291
291
|
enumerable: !0,
|
|
292
292
|
get() {
|
|
293
|
-
return
|
|
293
|
+
return i;
|
|
294
294
|
},
|
|
295
295
|
set(d) {
|
|
296
|
-
|
|
296
|
+
i = typeof d == "string" ? A.normalize(d) : d;
|
|
297
297
|
}
|
|
298
298
|
});
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
function se(e,
|
|
302
|
-
r.aliases[e] && r.aliases[e].length || (r.aliases[e] = [
|
|
301
|
+
function se(e, i) {
|
|
302
|
+
r.aliases[e] && r.aliases[e].length || (r.aliases[e] = [i], Q[i] = !0), r.aliases[i] && r.aliases[i].length || se(i, e);
|
|
303
303
|
}
|
|
304
|
-
function Y(e,
|
|
305
|
-
l && (
|
|
306
|
-
let o = Array.isArray(
|
|
304
|
+
function Y(e, i, l) {
|
|
305
|
+
l && (i = je(i)), (g(e, r.bools) || g(e, r.counts)) && typeof i == "string" && (i = i === "true");
|
|
306
|
+
let o = Array.isArray(i) ? i.map(function(t) {
|
|
307
307
|
return $(e, t);
|
|
308
|
-
}) : $(e,
|
|
309
|
-
return g(e, r.counts) && (
|
|
308
|
+
}) : $(e, i);
|
|
309
|
+
return g(e, r.counts) && (T(o) || typeof o == "boolean") && (o = Z()), g(e, r.normalize) && g(e, r.arrays) && (Array.isArray(i) ? o = i.map((t) => A.normalize(t)) : o = A.normalize(i)), o;
|
|
310
310
|
}
|
|
311
|
-
function $(e,
|
|
312
|
-
return !h["parse-positional-numbers"] && e === "_" || !g(e, r.strings) && !g(e, r.bools) && !Array.isArray(
|
|
311
|
+
function $(e, i) {
|
|
312
|
+
return !h["parse-positional-numbers"] && e === "_" || !g(e, r.strings) && !g(e, r.bools) && !Array.isArray(i) && (Re(i) && h["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${i}`))) || !T(i) && g(e, r.numbers)) && (i = Number(i)), i;
|
|
313
313
|
}
|
|
314
314
|
function _e(e) {
|
|
315
|
-
const
|
|
316
|
-
me(
|
|
317
|
-
const o = e[l] ||
|
|
315
|
+
const i = /* @__PURE__ */ Object.create(null);
|
|
316
|
+
me(i, r.aliases, f), Object.keys(r.configs).forEach(function(l) {
|
|
317
|
+
const o = e[l] || i[l];
|
|
318
318
|
if (o)
|
|
319
319
|
try {
|
|
320
320
|
let t = null;
|
|
321
|
-
const p =
|
|
321
|
+
const p = A.resolve(A.cwd(), o), c = r.configs[l];
|
|
322
322
|
if (typeof c == "function") {
|
|
323
323
|
try {
|
|
324
324
|
t = c(p);
|
|
@@ -326,88 +326,88 @@ class Ee {
|
|
|
326
326
|
t = d;
|
|
327
327
|
}
|
|
328
328
|
if (t instanceof Error) {
|
|
329
|
-
|
|
329
|
+
B = t;
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
332
|
} else
|
|
333
|
-
t =
|
|
333
|
+
t = A.require(p);
|
|
334
334
|
J(t);
|
|
335
335
|
} catch (t) {
|
|
336
|
-
t.name === "PermissionDenied" ?
|
|
336
|
+
t.name === "PermissionDenied" ? B = t : e[l] && (B = Error(C("Invalid JSON config file: %s", o)));
|
|
337
337
|
}
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
|
-
function J(e,
|
|
340
|
+
function J(e, i) {
|
|
341
341
|
Object.keys(e).forEach(function(l) {
|
|
342
|
-
const o = e[l], t =
|
|
343
|
-
typeof o == "object" && o !== null && !Array.isArray(o) && h["dot-notation"] ? J(o, t) : (!
|
|
342
|
+
const o = e[l], t = i ? i + "." + l : l;
|
|
343
|
+
typeof o == "object" && o !== null && !Array.isArray(o) && h["dot-notation"] ? J(o, t) : (!E(w, t.split(".")) || g(t, r.arrays) && h["combine-arrays"]) && q(t, o);
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
346
|
function ge() {
|
|
347
|
-
typeof
|
|
347
|
+
typeof y < "u" && y.forEach(function(e) {
|
|
348
348
|
J(e);
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
|
-
function re(e,
|
|
352
|
-
if (typeof
|
|
351
|
+
function re(e, i) {
|
|
352
|
+
if (typeof P > "u")
|
|
353
353
|
return;
|
|
354
|
-
const l = typeof
|
|
354
|
+
const l = typeof P == "string" ? P : "", o = A.env();
|
|
355
355
|
Object.keys(o).forEach(function(t) {
|
|
356
356
|
if (l === "" || t.lastIndexOf(l, 0) === 0) {
|
|
357
357
|
const p = t.split("__").map(function(c, d) {
|
|
358
358
|
return d === 0 && (c = c.substring(l.length)), W(c);
|
|
359
359
|
});
|
|
360
|
-
(
|
|
360
|
+
(i && r.configs[p.join(".")] || !i) && !E(e, p) && q(p.join("."), o[t]);
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
364
|
function fe(e) {
|
|
365
|
-
let
|
|
365
|
+
let i;
|
|
366
366
|
const l = /* @__PURE__ */ new Set();
|
|
367
367
|
Object.keys(e).forEach(function(o) {
|
|
368
|
-
if (!l.has(o) && (
|
|
368
|
+
if (!l.has(o) && (i = g(o, r.coercions), typeof i == "function"))
|
|
369
369
|
try {
|
|
370
|
-
const t = $(o,
|
|
370
|
+
const t = $(o, i(e[o]));
|
|
371
371
|
[].concat(r.aliases[o] || [], o).forEach((p) => {
|
|
372
372
|
l.add(p), e[p] = t;
|
|
373
373
|
});
|
|
374
374
|
} catch (t) {
|
|
375
|
-
|
|
375
|
+
B = t;
|
|
376
376
|
}
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
function be(e) {
|
|
380
|
-
return r.keys.forEach((
|
|
381
|
-
~
|
|
380
|
+
return r.keys.forEach((i) => {
|
|
381
|
+
~i.indexOf(".") || typeof e[i] > "u" && (e[i] = void 0);
|
|
382
382
|
}), e;
|
|
383
383
|
}
|
|
384
|
-
function me(e,
|
|
384
|
+
function me(e, i, l, o = !1) {
|
|
385
385
|
Object.keys(l).forEach(function(t) {
|
|
386
|
-
|
|
387
|
-
|
|
386
|
+
E(e, t.split(".")) || (N(e, t.split("."), l[t]), o && (oe[t] = !0), (i[t] || []).forEach(function(p) {
|
|
387
|
+
E(e, p.split(".")) || N(e, p.split("."), l[t]);
|
|
388
388
|
}));
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function E(e, i) {
|
|
392
392
|
let l = e;
|
|
393
|
-
h["dot-notation"] || (
|
|
393
|
+
h["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(t) {
|
|
394
394
|
l = l[t] || {};
|
|
395
395
|
});
|
|
396
|
-
const o =
|
|
396
|
+
const o = i[i.length - 1];
|
|
397
397
|
return typeof l != "object" ? !1 : o in l;
|
|
398
398
|
}
|
|
399
|
-
function N(e,
|
|
399
|
+
function N(e, i, l) {
|
|
400
400
|
let o = e;
|
|
401
|
-
h["dot-notation"] || (
|
|
401
|
+
h["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(v) {
|
|
402
402
|
v = le(v), typeof o == "object" && o[v] === void 0 && (o[v] = {}), typeof o[v] != "object" || Array.isArray(o[v]) ? (Array.isArray(o[v]) ? o[v].push({}) : o[v] = [o[v], {}], o = o[v][o[v].length - 1]) : o = o[v];
|
|
403
403
|
});
|
|
404
|
-
const t = le(
|
|
404
|
+
const t = le(i[i.length - 1]), p = g(i.join("."), r.arrays), c = Array.isArray(l);
|
|
405
405
|
let d = h["duplicate-arguments-array"];
|
|
406
|
-
!d && g(t, r.nargs) && (d = !0, (!
|
|
406
|
+
!d && g(t, r.nargs) && (d = !0, (!T(o[t]) && r.nargs[t] === 1 || Array.isArray(o[t]) && o[t].length === r.nargs[t]) && (o[t] = void 0)), l === Z() ? o[t] = Z(o[t]) : Array.isArray(o[t]) ? d && p && c ? o[t] = h["flatten-duplicate-arrays"] ? o[t].concat(l) : (Array.isArray(o[t][0]) ? o[t] : [o[t]]).concat([l]) : !d && !!p == !!c ? o[t] = l : o[t] = o[t].concat([l]) : o[t] === void 0 && p ? o[t] = c ? l : [l] : d && !(o[t] === void 0 || g(t, r.counts) || g(t, r.bools)) ? o[t] = [o[t], l] : o[t] = l;
|
|
407
407
|
}
|
|
408
408
|
function qe(...e) {
|
|
409
|
-
e.forEach(function(
|
|
410
|
-
Object.keys(
|
|
409
|
+
e.forEach(function(i) {
|
|
410
|
+
Object.keys(i || {}).forEach(function(l) {
|
|
411
411
|
r.aliases[l] || (r.aliases[l] = [].concat(k[l] || []), r.aliases[l].concat(l).forEach(function(o) {
|
|
412
412
|
if (/-/.test(o) && h["camel-case-expansion"]) {
|
|
413
413
|
const t = W(o);
|
|
@@ -426,79 +426,79 @@ class Ee {
|
|
|
426
426
|
});
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
|
-
function g(e,
|
|
430
|
-
const l = [].concat(r.aliases[e] || [], e), o = Object.keys(
|
|
431
|
-
return t ?
|
|
429
|
+
function g(e, i) {
|
|
430
|
+
const l = [].concat(r.aliases[e] || [], e), o = Object.keys(i), t = l.find((p) => o.includes(p));
|
|
431
|
+
return t ? i[t] : !1;
|
|
432
432
|
}
|
|
433
433
|
function ue(e) {
|
|
434
|
-
const
|
|
435
|
-
return [].concat(
|
|
434
|
+
const i = Object.keys(r);
|
|
435
|
+
return [].concat(i.map((o) => r[o])).some(function(o) {
|
|
436
436
|
return Array.isArray(o) ? o.includes(e) : o[e];
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
|
-
function we(e, ...
|
|
440
|
-
return [].concat(...
|
|
439
|
+
function we(e, ...i) {
|
|
440
|
+
return [].concat(...i).some(function(o) {
|
|
441
441
|
const t = e.match(o);
|
|
442
442
|
return t && ue(t[1]);
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
445
|
function ve(e) {
|
|
446
|
-
if (e.match(
|
|
446
|
+
if (e.match(L) || !e.match(/^-[^-]+/))
|
|
447
447
|
return !1;
|
|
448
|
-
let
|
|
448
|
+
let i = !0, l;
|
|
449
449
|
const o = e.slice(1).split("");
|
|
450
450
|
for (let t = 0; t < o.length; t++) {
|
|
451
451
|
if (l = e.slice(t + 2), !ue(o[t])) {
|
|
452
|
-
|
|
452
|
+
i = !1;
|
|
453
453
|
break;
|
|
454
454
|
}
|
|
455
455
|
if (o[t + 1] && o[t + 1] === "=" || l === "-" || /[A-Za-z]/.test(o[t]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(l) || o[t + 1] && o[t + 1].match(/\W/))
|
|
456
456
|
break;
|
|
457
457
|
}
|
|
458
|
-
return
|
|
458
|
+
return i;
|
|
459
459
|
}
|
|
460
460
|
function H(e) {
|
|
461
461
|
return h["unknown-options-as-args"] && xe(e);
|
|
462
462
|
}
|
|
463
463
|
function xe(e) {
|
|
464
|
-
return e = e.replace(/^-{3,}/, "--"), e.match(
|
|
464
|
+
return e = e.replace(/^-{3,}/, "--"), e.match(L) || ve(e) ? !1 : !we(e, /^-+([^=]+?)=[\s\S]*$/, U, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/);
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function R(e) {
|
|
467
467
|
return !g(e, r.bools) && !g(e, r.counts) && `${e}` in f ? f[e] : ye(Be(e));
|
|
468
468
|
}
|
|
469
469
|
function ye(e) {
|
|
470
470
|
return {
|
|
471
|
-
[
|
|
472
|
-
[
|
|
473
|
-
[
|
|
474
|
-
[
|
|
471
|
+
[I.BOOLEAN]: !0,
|
|
472
|
+
[I.STRING]: "",
|
|
473
|
+
[I.NUMBER]: void 0,
|
|
474
|
+
[I.ARRAY]: []
|
|
475
475
|
}[e];
|
|
476
476
|
}
|
|
477
477
|
function Be(e) {
|
|
478
|
-
let
|
|
479
|
-
return g(e, r.strings) ?
|
|
478
|
+
let i = I.BOOLEAN;
|
|
479
|
+
return g(e, r.strings) ? i = I.STRING : g(e, r.numbers) ? i = I.NUMBER : g(e, r.bools) ? i = I.BOOLEAN : g(e, r.arrays) && (i = I.ARRAY), i;
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function T(e) {
|
|
482
482
|
return e === void 0;
|
|
483
483
|
}
|
|
484
484
|
function Me() {
|
|
485
|
-
Object.keys(r.counts).find((e) => g(e, r.arrays) ? (
|
|
485
|
+
Object.keys(r.counts).find((e) => g(e, r.arrays) ? (B = Error(C("Invalid configuration: %s, opts.count excludes opts.array.", e)), !0) : g(e, r.nargs) ? (B = Error(C("Invalid configuration: %s, opts.count excludes opts.narg.", e)), !0) : !1);
|
|
486
486
|
}
|
|
487
487
|
return {
|
|
488
488
|
aliases: Object.assign({}, r.aliases),
|
|
489
489
|
argv: Object.assign(ne, w),
|
|
490
490
|
configuration: h,
|
|
491
491
|
defaulted: Object.assign({}, oe),
|
|
492
|
-
error:
|
|
492
|
+
error: B,
|
|
493
493
|
newAliases: Object.assign({}, Q)
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
function ze(
|
|
497
|
+
function ze(a) {
|
|
498
498
|
const n = [], m = /* @__PURE__ */ Object.create(null);
|
|
499
499
|
let s = !0;
|
|
500
|
-
for (Object.keys(
|
|
501
|
-
n.push([].concat(
|
|
500
|
+
for (Object.keys(a).forEach(function(u) {
|
|
501
|
+
n.push([].concat(a[u], u));
|
|
502
502
|
}); s; ) {
|
|
503
503
|
s = !1;
|
|
504
504
|
for (let u = 0; u < n.length; u++)
|
|
@@ -518,14 +518,14 @@ function ze(i) {
|
|
|
518
518
|
_ !== void 0 && typeof _ == "string" && (m[_] = u);
|
|
519
519
|
}), m;
|
|
520
520
|
}
|
|
521
|
-
function Z(
|
|
522
|
-
return
|
|
521
|
+
function Z(a) {
|
|
522
|
+
return a !== void 0 ? a + 1 : 1;
|
|
523
523
|
}
|
|
524
|
-
function le(
|
|
525
|
-
return
|
|
524
|
+
function le(a) {
|
|
525
|
+
return a === "__proto__" ? "___proto___" : a;
|
|
526
526
|
}
|
|
527
|
-
function je(
|
|
528
|
-
return typeof
|
|
527
|
+
function je(a) {
|
|
528
|
+
return typeof a == "string" && (a[0] === "'" || a[0] === '"') && a[a.length - 1] === a[0] ? a.substring(1, a.length - 1) : a;
|
|
529
529
|
}
|
|
530
530
|
/**
|
|
531
531
|
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
|
@@ -540,19 +540,19 @@ const ce = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number
|
|
|
540
540
|
if (pe && Number(pe.match(/^([^.]+)/)[1]) < ce)
|
|
541
541
|
throw Error(`yargs parser supports a minimum Node.js version of ${ce}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
|
|
542
542
|
const Qe = process ? process.env : {};
|
|
543
|
-
new
|
|
543
|
+
new Ne({
|
|
544
544
|
cwd: process.cwd,
|
|
545
545
|
env: () => Qe,
|
|
546
546
|
format: he,
|
|
547
547
|
normalize: Ie,
|
|
548
|
-
resolve:
|
|
548
|
+
resolve: ie,
|
|
549
549
|
// TODO: figure out a way to combine ESM and CJS coverage, such that
|
|
550
550
|
// we can exercise all the lines below:
|
|
551
|
-
require: (
|
|
551
|
+
require: (a) => {
|
|
552
552
|
if (typeof require < "u")
|
|
553
|
-
return require(
|
|
554
|
-
if (
|
|
555
|
-
return JSON.parse(ke(
|
|
553
|
+
return require(a);
|
|
554
|
+
if (a.match(/\.json$/))
|
|
555
|
+
return JSON.parse(ke(a, "utf8"));
|
|
556
556
|
throw Error("only .json config files are supported in ESM");
|
|
557
557
|
}
|
|
558
558
|
});
|
|
@@ -562,16 +562,16 @@ const Fe = {
|
|
|
562
562
|
writeFile: Le
|
|
563
563
|
},
|
|
564
564
|
format: he,
|
|
565
|
-
resolve:
|
|
566
|
-
exists: (
|
|
565
|
+
resolve: ie,
|
|
566
|
+
exists: (a) => {
|
|
567
567
|
try {
|
|
568
|
-
return Pe(
|
|
568
|
+
return Pe(a).isFile();
|
|
569
569
|
} catch {
|
|
570
570
|
return !1;
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
};
|
|
574
|
-
let
|
|
574
|
+
let M;
|
|
575
575
|
class De {
|
|
576
576
|
constructor(n) {
|
|
577
577
|
n = n || {}, this.directory = n.directory || "./locales", this.updateFiles = typeof n.updateFiles == "boolean" ? n.updateFiles : !0, this.locale = n.locale || "en", this.fallbackToLanguage = typeof n.fallbackToLanguage == "boolean" ? n.fallbackToLanguage : !0, this.cache = /* @__PURE__ */ Object.create(null), this.writeQueue = [];
|
|
@@ -587,7 +587,7 @@ class De {
|
|
|
587
587
|
directory: this.directory,
|
|
588
588
|
locale: this.locale,
|
|
589
589
|
cb: s
|
|
590
|
-
})) : s(),
|
|
590
|
+
})) : s(), M.format.apply(M.format, [this.cache[this.locale][m] || m].concat(n));
|
|
591
591
|
}
|
|
592
592
|
__n() {
|
|
593
593
|
const n = Array.prototype.slice.call(arguments), m = n.shift(), s = n.shift(), u = n.shift();
|
|
@@ -604,7 +604,7 @@ class De {
|
|
|
604
604
|
cb: _
|
|
605
605
|
})) : _();
|
|
606
606
|
const h = [k];
|
|
607
|
-
return ~k.indexOf("%d") && h.push(u),
|
|
607
|
+
return ~k.indexOf("%d") && h.push(u), M.format.apply(M.format, h.concat(n));
|
|
608
608
|
}
|
|
609
609
|
setLocale(n) {
|
|
610
610
|
this.locale = n;
|
|
@@ -629,7 +629,7 @@ class De {
|
|
|
629
629
|
}
|
|
630
630
|
_processWriteQueue() {
|
|
631
631
|
const n = this, m = this.writeQueue[0], s = m.directory, u = m.locale, _ = m.cb, k = this._resolveLocaleFile(s, u), h = JSON.stringify(this.cache[u], null, 2);
|
|
632
|
-
|
|
632
|
+
M.fs.writeFile(k, h, "utf-8", function(f) {
|
|
633
633
|
n.writeQueue.shift(), n.writeQueue.length > 0 && n._processWriteQueue(), _(f);
|
|
634
634
|
});
|
|
635
635
|
}
|
|
@@ -637,7 +637,7 @@ class De {
|
|
|
637
637
|
let n = {};
|
|
638
638
|
const m = this._resolveLocaleFile(this.directory, this.locale);
|
|
639
639
|
try {
|
|
640
|
-
|
|
640
|
+
M.fs.readFileSync && (n = JSON.parse(M.fs.readFileSync(m, "utf-8")));
|
|
641
641
|
} catch (s) {
|
|
642
642
|
if (s instanceof SyntaxError && (s.message = "syntax error in " + m), s.code === "ENOENT")
|
|
643
643
|
n = {};
|
|
@@ -647,20 +647,20 @@ class De {
|
|
|
647
647
|
this.cache[this.locale] = n;
|
|
648
648
|
}
|
|
649
649
|
_resolveLocaleFile(n, m) {
|
|
650
|
-
let s =
|
|
650
|
+
let s = M.resolve(n, "./", m + ".json");
|
|
651
651
|
if (this.fallbackToLanguage && !this._fileExistsSync(s) && ~m.lastIndexOf("_")) {
|
|
652
|
-
const u =
|
|
652
|
+
const u = M.resolve(n, "./", m.split("_")[0] + ".json");
|
|
653
653
|
this._fileExistsSync(u) && (s = u);
|
|
654
654
|
}
|
|
655
655
|
return s;
|
|
656
656
|
}
|
|
657
657
|
_fileExistsSync(n) {
|
|
658
|
-
return
|
|
658
|
+
return M.exists(n);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
function Ve(
|
|
662
|
-
|
|
663
|
-
const m = new De(
|
|
661
|
+
function Ve(a, n) {
|
|
662
|
+
M = n;
|
|
663
|
+
const m = new De(a);
|
|
664
664
|
return {
|
|
665
665
|
__: m.__.bind(m),
|
|
666
666
|
__n: m.__n.bind(m),
|
|
@@ -670,19 +670,19 @@ function Ve(i, n) {
|
|
|
670
670
|
locale: m.locale
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
const $e = (
|
|
674
|
-
let
|
|
673
|
+
const $e = (a) => Ve(a, Fe);
|
|
674
|
+
let z;
|
|
675
675
|
try {
|
|
676
|
-
|
|
676
|
+
z = Te(import.meta.url);
|
|
677
677
|
} catch {
|
|
678
|
-
|
|
678
|
+
z = process.cwd();
|
|
679
679
|
}
|
|
680
|
-
const He =
|
|
680
|
+
const He = z.substring(0, z.lastIndexOf("node_modules"));
|
|
681
681
|
He || process.cwd(), process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, $e({
|
|
682
|
-
directory:
|
|
682
|
+
directory: ie(z, "../../../locales"),
|
|
683
683
|
updateFiles: !1
|
|
684
684
|
});
|
|
685
|
-
const
|
|
685
|
+
const ae = [
|
|
686
686
|
{
|
|
687
687
|
id: "anthropic",
|
|
688
688
|
name: "Anthropic",
|
|
@@ -881,6 +881,12 @@ const ie = [
|
|
|
881
881
|
{
|
|
882
882
|
starts_with: "claude-haiku-4-5"
|
|
883
883
|
},
|
|
884
|
+
{
|
|
885
|
+
starts_with: "claude-haiku-4.5"
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
starts_with: "claude-4-5-haiku"
|
|
889
|
+
},
|
|
884
890
|
{
|
|
885
891
|
starts_with: "claude-4.5-haiku"
|
|
886
892
|
}
|
|
@@ -894,6 +900,28 @@ const ie = [
|
|
|
894
900
|
output_mtok: 5
|
|
895
901
|
}
|
|
896
902
|
},
|
|
903
|
+
{
|
|
904
|
+
id: "claude-instant-1",
|
|
905
|
+
description: "Retired, here to match price sources",
|
|
906
|
+
match: {
|
|
907
|
+
equals: "claude-instant-1"
|
|
908
|
+
},
|
|
909
|
+
prices: {
|
|
910
|
+
input_mtok: 1.63,
|
|
911
|
+
output_mtok: 55.1
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
id: "claude-instant-1.2",
|
|
916
|
+
description: "Retired, here to match price sources",
|
|
917
|
+
match: {
|
|
918
|
+
equals: "claude-instant-1.2"
|
|
919
|
+
},
|
|
920
|
+
prices: {
|
|
921
|
+
input_mtok: 1.63,
|
|
922
|
+
output_mtok: 5.51
|
|
923
|
+
}
|
|
924
|
+
},
|
|
897
925
|
{
|
|
898
926
|
id: "claude-opus-4-0",
|
|
899
927
|
name: "Claude Opus 4",
|
|
@@ -906,6 +934,9 @@ const ie = [
|
|
|
906
934
|
{
|
|
907
935
|
starts_with: "claude-4-opus"
|
|
908
936
|
},
|
|
937
|
+
{
|
|
938
|
+
equals: "claude-opus-4"
|
|
939
|
+
},
|
|
909
940
|
{
|
|
910
941
|
equals: "claude-opus-4-20250514"
|
|
911
942
|
}
|
|
@@ -924,7 +955,14 @@ const ie = [
|
|
|
924
955
|
name: "Claude Opus 4.1",
|
|
925
956
|
description: "Most intelligent model for complex tasks",
|
|
926
957
|
match: {
|
|
927
|
-
|
|
958
|
+
or: [
|
|
959
|
+
{
|
|
960
|
+
starts_with: "claude-opus-4-1"
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
starts_with: "claude-opus-4.1"
|
|
964
|
+
}
|
|
965
|
+
]
|
|
928
966
|
},
|
|
929
967
|
context_window: 2e5,
|
|
930
968
|
prices: {
|
|
@@ -970,7 +1008,14 @@ const ie = [
|
|
|
970
1008
|
name: "Claude Sonnet 4.5",
|
|
971
1009
|
description: "Most intelligent model for building agents and coding",
|
|
972
1010
|
match: {
|
|
973
|
-
|
|
1011
|
+
or: [
|
|
1012
|
+
{
|
|
1013
|
+
starts_with: "claude-sonnet-4-5"
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
starts_with: "claude-sonnet-4.5"
|
|
1017
|
+
}
|
|
1018
|
+
]
|
|
974
1019
|
},
|
|
975
1020
|
context_window: 1e6,
|
|
976
1021
|
prices: {
|
|
@@ -1011,6 +1056,17 @@ const ie = [
|
|
|
1011
1056
|
]
|
|
1012
1057
|
}
|
|
1013
1058
|
}
|
|
1059
|
+
},
|
|
1060
|
+
{
|
|
1061
|
+
id: "claude-v1",
|
|
1062
|
+
description: "Retired, here to match price sources",
|
|
1063
|
+
match: {
|
|
1064
|
+
equals: "claude-v1"
|
|
1065
|
+
},
|
|
1066
|
+
prices: {
|
|
1067
|
+
input_mtok: 8,
|
|
1068
|
+
output_mtok: 24
|
|
1069
|
+
}
|
|
1014
1070
|
}
|
|
1015
1071
|
]
|
|
1016
1072
|
},
|
|
@@ -2670,15 +2726,39 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2670
2726
|
},
|
|
2671
2727
|
{
|
|
2672
2728
|
equals: "gemini-2.5-flash-latest"
|
|
2729
|
+
},
|
|
2730
|
+
{
|
|
2731
|
+
equals: "gemini-2.5-flash-preview-09-2025"
|
|
2673
2732
|
}
|
|
2674
2733
|
]
|
|
2675
2734
|
},
|
|
2676
2735
|
prices: {
|
|
2677
2736
|
input_mtok: 0.3,
|
|
2678
|
-
cache_read_mtok: 0.
|
|
2737
|
+
cache_read_mtok: 0.03,
|
|
2679
2738
|
output_mtok: 2.5,
|
|
2680
2739
|
input_audio_mtok: 1,
|
|
2681
|
-
cache_audio_read_mtok: 0.
|
|
2740
|
+
cache_audio_read_mtok: 0.1
|
|
2741
|
+
}
|
|
2742
|
+
},
|
|
2743
|
+
{
|
|
2744
|
+
id: "gemini-2.5-flash-image",
|
|
2745
|
+
name: "Gemini 2.5 Flash Image",
|
|
2746
|
+
description: "Google's specialized image generation model optimized for fast, high-quality image generation. Outputs images at 1024x1024 resolution, with each image consuming 1290 output tokens.",
|
|
2747
|
+
match: {
|
|
2748
|
+
or: [
|
|
2749
|
+
{
|
|
2750
|
+
equals: "gemini-2.5-flash-image"
|
|
2751
|
+
},
|
|
2752
|
+
{
|
|
2753
|
+
equals: "gemini-2.5-flash-image-preview"
|
|
2754
|
+
}
|
|
2755
|
+
]
|
|
2756
|
+
},
|
|
2757
|
+
context_window: 1e6,
|
|
2758
|
+
price_comments: "See https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-flash-image. Image output is priced at $30 per 1M tokens, with each 1024x1024 image = 1290 tokens = $0.039/image. Cache pricing is not available for this model.",
|
|
2759
|
+
prices: {
|
|
2760
|
+
input_mtok: 0.3,
|
|
2761
|
+
output_mtok: 30
|
|
2682
2762
|
}
|
|
2683
2763
|
},
|
|
2684
2764
|
{
|
|
@@ -2698,10 +2778,10 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2698
2778
|
context_window: 1e6,
|
|
2699
2779
|
prices: {
|
|
2700
2780
|
input_mtok: 0.1,
|
|
2701
|
-
cache_read_mtok: 0.
|
|
2781
|
+
cache_read_mtok: 0.01,
|
|
2702
2782
|
output_mtok: 0.4,
|
|
2703
|
-
input_audio_mtok: 0.
|
|
2704
|
-
cache_audio_read_mtok: 0.
|
|
2783
|
+
input_audio_mtok: 0.3,
|
|
2784
|
+
cache_audio_read_mtok: 0.03
|
|
2705
2785
|
}
|
|
2706
2786
|
},
|
|
2707
2787
|
{
|
|
@@ -2711,10 +2791,10 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2711
2791
|
match: {
|
|
2712
2792
|
or: [
|
|
2713
2793
|
{
|
|
2714
|
-
contains: "gemini-2.5-flash-preview"
|
|
2794
|
+
contains: "gemini-2.5-flash-preview-05-20"
|
|
2715
2795
|
},
|
|
2716
2796
|
{
|
|
2717
|
-
|
|
2797
|
+
contains: "gemini-2.5-flash-preview-04-17"
|
|
2718
2798
|
},
|
|
2719
2799
|
{
|
|
2720
2800
|
equals: "gemini-2.5-flash-preview-05-20:thinking"
|
|
@@ -2752,11 +2832,11 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2752
2832
|
]
|
|
2753
2833
|
},
|
|
2754
2834
|
cache_read_mtok: {
|
|
2755
|
-
base: 0.
|
|
2835
|
+
base: 0.125,
|
|
2756
2836
|
tiers: [
|
|
2757
2837
|
{
|
|
2758
2838
|
start: 2e5,
|
|
2759
|
-
price: 0.
|
|
2839
|
+
price: 0.25
|
|
2760
2840
|
}
|
|
2761
2841
|
]
|
|
2762
2842
|
},
|
|
@@ -2771,6 +2851,15 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2771
2851
|
}
|
|
2772
2852
|
}
|
|
2773
2853
|
},
|
|
2854
|
+
{
|
|
2855
|
+
id: "gemini-embedding-001",
|
|
2856
|
+
match: {
|
|
2857
|
+
equals: "gemini-embedding-001"
|
|
2858
|
+
},
|
|
2859
|
+
prices: {
|
|
2860
|
+
input_mtok: 0.15
|
|
2861
|
+
}
|
|
2862
|
+
},
|
|
2774
2863
|
{
|
|
2775
2864
|
id: "gemini-flash-1.5",
|
|
2776
2865
|
name: "Gemini 1.5 Flash",
|
|
@@ -2848,6 +2937,25 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2848
2937
|
}
|
|
2849
2938
|
}
|
|
2850
2939
|
},
|
|
2940
|
+
{
|
|
2941
|
+
id: "gemini-live-2.5-flash-preview",
|
|
2942
|
+
match: {
|
|
2943
|
+
or: [
|
|
2944
|
+
{
|
|
2945
|
+
starts_with: "gemini-live-2.5-flash-preview"
|
|
2946
|
+
},
|
|
2947
|
+
{
|
|
2948
|
+
starts_with: "gemini-2.5-flash-native-audio-preview"
|
|
2949
|
+
}
|
|
2950
|
+
]
|
|
2951
|
+
},
|
|
2952
|
+
prices: {
|
|
2953
|
+
input_mtok: 0.5,
|
|
2954
|
+
output_mtok: 2,
|
|
2955
|
+
input_audio_mtok: 3,
|
|
2956
|
+
output_audio_mtok: 12
|
|
2957
|
+
}
|
|
2958
|
+
},
|
|
2851
2959
|
{
|
|
2852
2960
|
id: "gemini-pro",
|
|
2853
2961
|
name: "gemini 1.0 pro",
|
|
@@ -3999,7 +4107,14 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3999
4107
|
name: "Codex Mini",
|
|
4000
4108
|
description: "codex-mini-latest is a fine-tuned version of o4-mini specifically for use in Codex CLI. For direct use in the API, we recommend starting with gpt-4.1.",
|
|
4001
4109
|
match: {
|
|
4002
|
-
|
|
4110
|
+
or: [
|
|
4111
|
+
{
|
|
4112
|
+
equals: "codex-mini"
|
|
4113
|
+
},
|
|
4114
|
+
{
|
|
4115
|
+
equals: "codex-mini-latest"
|
|
4116
|
+
}
|
|
4117
|
+
]
|
|
4003
4118
|
},
|
|
4004
4119
|
prices: {
|
|
4005
4120
|
input_mtok: 1.5,
|
|
@@ -4045,7 +4160,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4045
4160
|
id: "ft:gpt-3.5-turbo-",
|
|
4046
4161
|
description: "GPT-3.5 Turbo fine tuned.",
|
|
4047
4162
|
match: {
|
|
4048
|
-
starts_with: "ft:gpt-3.5-turbo
|
|
4163
|
+
starts_with: "ft:gpt-3.5-turbo"
|
|
4049
4164
|
},
|
|
4050
4165
|
prices: {
|
|
4051
4166
|
input_mtok: 3,
|
|
@@ -4053,10 +4168,10 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4053
4168
|
}
|
|
4054
4169
|
},
|
|
4055
4170
|
{
|
|
4056
|
-
id: "ft:gpt-4o
|
|
4171
|
+
id: "ft:gpt-4o",
|
|
4057
4172
|
description: "GPT-4o fine tuned.",
|
|
4058
4173
|
match: {
|
|
4059
|
-
starts_with: "ft:gpt-4o-2024-
|
|
4174
|
+
starts_with: "ft:gpt-4o-2024-"
|
|
4060
4175
|
},
|
|
4061
4176
|
prices: {
|
|
4062
4177
|
input_mtok: 3.75,
|
|
@@ -4064,16 +4179,33 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4064
4179
|
}
|
|
4065
4180
|
},
|
|
4066
4181
|
{
|
|
4067
|
-
id: "ft:gpt-4o-mini
|
|
4182
|
+
id: "ft:gpt-4o-mini",
|
|
4068
4183
|
description: "GPT-4o Mini fine tuned.",
|
|
4069
4184
|
match: {
|
|
4070
|
-
starts_with: "ft:gpt-4o-mini-2024-
|
|
4185
|
+
starts_with: "ft:gpt-4o-mini-2024-"
|
|
4071
4186
|
},
|
|
4072
4187
|
prices: {
|
|
4073
4188
|
input_mtok: 0.3,
|
|
4074
4189
|
output_mtok: 1.2
|
|
4075
4190
|
}
|
|
4076
4191
|
},
|
|
4192
|
+
{
|
|
4193
|
+
id: "gpt-3.5-0301",
|
|
4194
|
+
match: {
|
|
4195
|
+
or: [
|
|
4196
|
+
{
|
|
4197
|
+
equals: "gpt-3.5-turbo-0301"
|
|
4198
|
+
},
|
|
4199
|
+
{
|
|
4200
|
+
equals: "gpt-3.5-0301"
|
|
4201
|
+
}
|
|
4202
|
+
]
|
|
4203
|
+
},
|
|
4204
|
+
prices: {
|
|
4205
|
+
input_mtok: 1.5,
|
|
4206
|
+
output_mtok: 2
|
|
4207
|
+
}
|
|
4208
|
+
},
|
|
4077
4209
|
{
|
|
4078
4210
|
id: "gpt-3.5-turbo",
|
|
4079
4211
|
name: "gpt 3.5 turbo",
|
|
@@ -4088,9 +4220,6 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4088
4220
|
},
|
|
4089
4221
|
{
|
|
4090
4222
|
equals: "gpt-3.5-turbo-0125"
|
|
4091
|
-
},
|
|
4092
|
-
{
|
|
4093
|
-
equals: "gpt-3.5-turbo-1106"
|
|
4094
4223
|
}
|
|
4095
4224
|
]
|
|
4096
4225
|
},
|
|
@@ -4100,6 +4229,28 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4100
4229
|
output_mtok: 1.5
|
|
4101
4230
|
}
|
|
4102
4231
|
},
|
|
4232
|
+
{
|
|
4233
|
+
id: "gpt-3.5-turbo-0613",
|
|
4234
|
+
match: {
|
|
4235
|
+
equals: "gpt-3.5-turbo-0613"
|
|
4236
|
+
},
|
|
4237
|
+
context_window: 16385,
|
|
4238
|
+
prices: {
|
|
4239
|
+
input_mtok: 1.5,
|
|
4240
|
+
output_mtok: 2
|
|
4241
|
+
}
|
|
4242
|
+
},
|
|
4243
|
+
{
|
|
4244
|
+
id: "gpt-3.5-turbo-1106",
|
|
4245
|
+
match: {
|
|
4246
|
+
equals: "gpt-3.5-turbo-1106"
|
|
4247
|
+
},
|
|
4248
|
+
context_window: 16385,
|
|
4249
|
+
prices: {
|
|
4250
|
+
input_mtok: 1,
|
|
4251
|
+
output_mtok: 2
|
|
4252
|
+
}
|
|
4253
|
+
},
|
|
4103
4254
|
{
|
|
4104
4255
|
id: "gpt-3.5-turbo-16k",
|
|
4105
4256
|
name: "GPT-3.5 Turbo 16k",
|
|
@@ -4114,6 +4265,9 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4114
4265
|
},
|
|
4115
4266
|
{
|
|
4116
4267
|
equals: "gpt-35-turbo-16k-0613"
|
|
4268
|
+
},
|
|
4269
|
+
{
|
|
4270
|
+
equals: "gpt-35-turbo-16k"
|
|
4117
4271
|
}
|
|
4118
4272
|
]
|
|
4119
4273
|
},
|
|
@@ -4157,6 +4311,9 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4157
4311
|
},
|
|
4158
4312
|
{
|
|
4159
4313
|
equals: "gpt-4-0613"
|
|
4314
|
+
},
|
|
4315
|
+
{
|
|
4316
|
+
starts_with: "ft:gpt-4-0"
|
|
4160
4317
|
}
|
|
4161
4318
|
]
|
|
4162
4319
|
},
|
|
@@ -4372,6 +4529,9 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4372
4529
|
},
|
|
4373
4530
|
{
|
|
4374
4531
|
equals: "gpt-4o-mini-search-preview"
|
|
4532
|
+
},
|
|
4533
|
+
{
|
|
4534
|
+
equals: "gpt-4o-mini-search-preview-2025-03-11"
|
|
4375
4535
|
}
|
|
4376
4536
|
]
|
|
4377
4537
|
},
|
|
@@ -4413,7 +4573,31 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4413
4573
|
prices: {
|
|
4414
4574
|
input_mtok: 0.6,
|
|
4415
4575
|
cache_read_mtok: 0.3,
|
|
4416
|
-
output_mtok: 2.4
|
|
4576
|
+
output_mtok: 2.4,
|
|
4577
|
+
input_audio_mtok: 10,
|
|
4578
|
+
cache_audio_read_mtok: 0.3,
|
|
4579
|
+
output_audio_mtok: 20
|
|
4580
|
+
}
|
|
4581
|
+
},
|
|
4582
|
+
{
|
|
4583
|
+
id: "gpt-4o-mini-transcribe",
|
|
4584
|
+
match: {
|
|
4585
|
+
equals: "gpt-4o-mini-transcribe"
|
|
4586
|
+
},
|
|
4587
|
+
prices: {
|
|
4588
|
+
input_mtok: 1.25,
|
|
4589
|
+
output_mtok: 5,
|
|
4590
|
+
input_audio_mtok: 3
|
|
4591
|
+
}
|
|
4592
|
+
},
|
|
4593
|
+
{
|
|
4594
|
+
id: "gpt-4o-mini-tts",
|
|
4595
|
+
match: {
|
|
4596
|
+
equals: "gpt-4o-mini-tts"
|
|
4597
|
+
},
|
|
4598
|
+
prices: {
|
|
4599
|
+
input_mtok: 0.6,
|
|
4600
|
+
output_audio_mtok: 12
|
|
4417
4601
|
}
|
|
4418
4602
|
},
|
|
4419
4603
|
{
|
|
@@ -4435,13 +4619,38 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4435
4619
|
name: "GPT-4o Search Preview",
|
|
4436
4620
|
description: "GPT-4o Search Previewis a specialized model for web search in Chat Completions. It is trained to understand and execute web search queries.",
|
|
4437
4621
|
match: {
|
|
4438
|
-
|
|
4622
|
+
or: [
|
|
4623
|
+
{
|
|
4624
|
+
equals: "gpt-4o-search-preview"
|
|
4625
|
+
},
|
|
4626
|
+
{
|
|
4627
|
+
equals: "gpt-4o-search-preview-2025-03-11"
|
|
4628
|
+
}
|
|
4629
|
+
]
|
|
4439
4630
|
},
|
|
4440
4631
|
prices: {
|
|
4441
4632
|
input_mtok: 2.5,
|
|
4442
4633
|
output_mtok: 10
|
|
4443
4634
|
}
|
|
4444
4635
|
},
|
|
4636
|
+
{
|
|
4637
|
+
id: "gpt-4o-transcribe",
|
|
4638
|
+
match: {
|
|
4639
|
+
or: [
|
|
4640
|
+
{
|
|
4641
|
+
equals: "gpt-4o-transcribe"
|
|
4642
|
+
},
|
|
4643
|
+
{
|
|
4644
|
+
equals: "gpt-4o-transcribe-diarize"
|
|
4645
|
+
}
|
|
4646
|
+
]
|
|
4647
|
+
},
|
|
4648
|
+
prices: {
|
|
4649
|
+
input_mtok: 2.5,
|
|
4650
|
+
output_mtok: 10,
|
|
4651
|
+
input_audio_mtok: 6
|
|
4652
|
+
}
|
|
4653
|
+
},
|
|
4445
4654
|
{
|
|
4446
4655
|
id: "gpt-4o:extended",
|
|
4447
4656
|
name: "GPT-4o (extended)",
|
|
@@ -4471,6 +4680,9 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4471
4680
|
},
|
|
4472
4681
|
{
|
|
4473
4682
|
equals: "gpt-5-chat-latest"
|
|
4683
|
+
},
|
|
4684
|
+
{
|
|
4685
|
+
equals: "gpt-5-codex"
|
|
4474
4686
|
}
|
|
4475
4687
|
]
|
|
4476
4688
|
},
|
|
@@ -4481,6 +4693,30 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4481
4693
|
output_mtok: 10
|
|
4482
4694
|
}
|
|
4483
4695
|
},
|
|
4696
|
+
{
|
|
4697
|
+
id: "gpt-5-image",
|
|
4698
|
+
match: {
|
|
4699
|
+
equals: "gpt-5-image"
|
|
4700
|
+
},
|
|
4701
|
+
price_comments: "Seen on OpenRouter before OpenAI",
|
|
4702
|
+
prices: {
|
|
4703
|
+
input_mtok: 10,
|
|
4704
|
+
cache_read_mtok: 1.25,
|
|
4705
|
+
output_mtok: 10
|
|
4706
|
+
}
|
|
4707
|
+
},
|
|
4708
|
+
{
|
|
4709
|
+
id: "gpt-5-image-mini",
|
|
4710
|
+
match: {
|
|
4711
|
+
equals: "gpt-5-image-mini"
|
|
4712
|
+
},
|
|
4713
|
+
price_comments: "Seen on OpenRouter before OpenAI",
|
|
4714
|
+
prices: {
|
|
4715
|
+
input_mtok: 2.5,
|
|
4716
|
+
cache_read_mtok: 0.25,
|
|
4717
|
+
output_mtok: 2
|
|
4718
|
+
}
|
|
4719
|
+
},
|
|
4484
4720
|
{
|
|
4485
4721
|
id: "gpt-5-mini",
|
|
4486
4722
|
name: "GPT-5 mini",
|
|
@@ -4523,6 +4759,68 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4523
4759
|
output_mtok: 0.4
|
|
4524
4760
|
}
|
|
4525
4761
|
},
|
|
4762
|
+
{
|
|
4763
|
+
id: "gpt-5-pro",
|
|
4764
|
+
match: {
|
|
4765
|
+
or: [
|
|
4766
|
+
{
|
|
4767
|
+
equals: "gpt-5-pro"
|
|
4768
|
+
},
|
|
4769
|
+
{
|
|
4770
|
+
equals: "gpt-5-pro-2025-10-06"
|
|
4771
|
+
}
|
|
4772
|
+
]
|
|
4773
|
+
},
|
|
4774
|
+
prices: {
|
|
4775
|
+
input_mtok: 15,
|
|
4776
|
+
output_mtok: 120
|
|
4777
|
+
}
|
|
4778
|
+
},
|
|
4779
|
+
{
|
|
4780
|
+
id: "gpt-realtime",
|
|
4781
|
+
match: {
|
|
4782
|
+
or: [
|
|
4783
|
+
{
|
|
4784
|
+
equals: "gpt-realtime"
|
|
4785
|
+
},
|
|
4786
|
+
{
|
|
4787
|
+
equals: "gpt-realtime-2025-08-28"
|
|
4788
|
+
}
|
|
4789
|
+
]
|
|
4790
|
+
},
|
|
4791
|
+
price_comments: "Missing image token prices which we don't support yet",
|
|
4792
|
+
prices: {
|
|
4793
|
+
input_mtok: 4,
|
|
4794
|
+
cache_read_mtok: 0.4,
|
|
4795
|
+
output_mtok: 16,
|
|
4796
|
+
input_audio_mtok: 32,
|
|
4797
|
+
cache_audio_read_mtok: 0.4,
|
|
4798
|
+
output_audio_mtok: 64
|
|
4799
|
+
}
|
|
4800
|
+
},
|
|
4801
|
+
{
|
|
4802
|
+
id: "gpt-realtime-mini",
|
|
4803
|
+
match: {
|
|
4804
|
+
equals: "gpt-realtime-mini"
|
|
4805
|
+
},
|
|
4806
|
+
price_comments: "Missing image token prices which we don't support yet",
|
|
4807
|
+
prices: {
|
|
4808
|
+
input_mtok: 0.6,
|
|
4809
|
+
cache_read_mtok: 0.06,
|
|
4810
|
+
output_mtok: 2.4,
|
|
4811
|
+
input_audio_mtok: 10,
|
|
4812
|
+
cache_audio_read_mtok: 0.3,
|
|
4813
|
+
output_audio_mtok: 20
|
|
4814
|
+
}
|
|
4815
|
+
},
|
|
4816
|
+
{
|
|
4817
|
+
id: "moderation",
|
|
4818
|
+
description: "All OpenAI moderation models and endpoints are free of charge",
|
|
4819
|
+
match: {
|
|
4820
|
+
contains: "moderation"
|
|
4821
|
+
},
|
|
4822
|
+
prices: {}
|
|
4823
|
+
},
|
|
4526
4824
|
{
|
|
4527
4825
|
id: "o1",
|
|
4528
4826
|
name: "o1",
|
|
@@ -4576,7 +4874,14 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4576
4874
|
name: "o1-pro",
|
|
4577
4875
|
description: "The o1 series of models are trained with reinforcement learning to think before they answer and perform complex reasoning. The o1-pro model uses more compute to think harder and provide consistently better answers.",
|
|
4578
4876
|
match: {
|
|
4579
|
-
|
|
4877
|
+
or: [
|
|
4878
|
+
{
|
|
4879
|
+
equals: "o1-pro"
|
|
4880
|
+
},
|
|
4881
|
+
{
|
|
4882
|
+
equals: "o1-pro-2025-03-19"
|
|
4883
|
+
}
|
|
4884
|
+
]
|
|
4580
4885
|
},
|
|
4581
4886
|
prices: {
|
|
4582
4887
|
input_mtok: 150,
|
|
@@ -4618,6 +4923,24 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4618
4923
|
}
|
|
4619
4924
|
]
|
|
4620
4925
|
},
|
|
4926
|
+
{
|
|
4927
|
+
id: "o3-deep-research",
|
|
4928
|
+
match: {
|
|
4929
|
+
or: [
|
|
4930
|
+
{
|
|
4931
|
+
equals: "o3-deep-research"
|
|
4932
|
+
},
|
|
4933
|
+
{
|
|
4934
|
+
equals: "o3-deep-research-2025-06-26"
|
|
4935
|
+
}
|
|
4936
|
+
]
|
|
4937
|
+
},
|
|
4938
|
+
prices: {
|
|
4939
|
+
input_mtok: 10,
|
|
4940
|
+
cache_read_mtok: 2.5,
|
|
4941
|
+
output_mtok: 40
|
|
4942
|
+
}
|
|
4943
|
+
},
|
|
4621
4944
|
{
|
|
4622
4945
|
id: "o3-mini",
|
|
4623
4946
|
name: "o3 Mini",
|
|
@@ -4646,7 +4969,14 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4646
4969
|
name: "o3 Pro",
|
|
4647
4970
|
description: "The o-series of models are trained with reinforcement learning to think before they answer and perform complex reasoning. The o3-pro model uses more compute to think harder and provide consistently better answers.",
|
|
4648
4971
|
match: {
|
|
4649
|
-
|
|
4972
|
+
or: [
|
|
4973
|
+
{
|
|
4974
|
+
equals: "o3-pro"
|
|
4975
|
+
},
|
|
4976
|
+
{
|
|
4977
|
+
equals: "o3-pro-2025-06-10"
|
|
4978
|
+
}
|
|
4979
|
+
]
|
|
4650
4980
|
},
|
|
4651
4981
|
prices: {
|
|
4652
4982
|
input_mtok: 20,
|
|
@@ -4659,9 +4989,6 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4659
4989
|
description: "OpenAI o4-mini-high is the same model as o4-mini with reasoning_effort set to high.",
|
|
4660
4990
|
match: {
|
|
4661
4991
|
or: [
|
|
4662
|
-
{
|
|
4663
|
-
starts_with: "o4-mini"
|
|
4664
|
-
},
|
|
4665
4992
|
{
|
|
4666
4993
|
equals: "o4-mini-2025-04-16"
|
|
4667
4994
|
},
|
|
@@ -4679,6 +5006,24 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4679
5006
|
output_mtok: 4.4
|
|
4680
5007
|
}
|
|
4681
5008
|
},
|
|
5009
|
+
{
|
|
5010
|
+
id: "o4-mini-deep-research",
|
|
5011
|
+
match: {
|
|
5012
|
+
or: [
|
|
5013
|
+
{
|
|
5014
|
+
equals: "o4-mini-deep-research"
|
|
5015
|
+
},
|
|
5016
|
+
{
|
|
5017
|
+
equals: "o4-mini-deep-research-2025-06-26"
|
|
5018
|
+
}
|
|
5019
|
+
]
|
|
5020
|
+
},
|
|
5021
|
+
prices: {
|
|
5022
|
+
input_mtok: 2,
|
|
5023
|
+
cache_read_mtok: 0.5,
|
|
5024
|
+
output_mtok: 8
|
|
5025
|
+
}
|
|
5026
|
+
},
|
|
4682
5027
|
{
|
|
4683
5028
|
id: "text-davinci-002",
|
|
4684
5029
|
match: {
|
|
@@ -5867,6 +6212,18 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
5867
6212
|
},
|
|
5868
6213
|
prices: {}
|
|
5869
6214
|
},
|
|
6215
|
+
{
|
|
6216
|
+
id: "deepseek-v3.1-terminus",
|
|
6217
|
+
name: "DeepSeek V3.1 Terminus",
|
|
6218
|
+
match: {
|
|
6219
|
+
equals: "deepseek-v3.1-terminus"
|
|
6220
|
+
},
|
|
6221
|
+
context_window: 163840,
|
|
6222
|
+
prices: {
|
|
6223
|
+
input_mtok: 0.23,
|
|
6224
|
+
output_mtok: 0.9
|
|
6225
|
+
}
|
|
6226
|
+
},
|
|
5870
6227
|
{
|
|
5871
6228
|
id: "deepseek/deepseek-chat",
|
|
5872
6229
|
match: {
|
|
@@ -5894,6 +6251,18 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
5894
6251
|
},
|
|
5895
6252
|
prices: {}
|
|
5896
6253
|
},
|
|
6254
|
+
{
|
|
6255
|
+
id: "deepseek/deepseek-chat-v3.1",
|
|
6256
|
+
name: "DeepSeek Chat V3.1",
|
|
6257
|
+
match: {
|
|
6258
|
+
equals: "deepseek/deepseek-chat-v3.1"
|
|
6259
|
+
},
|
|
6260
|
+
context_window: 163840,
|
|
6261
|
+
prices: {
|
|
6262
|
+
input_mtok: 0.2,
|
|
6263
|
+
output_mtok: 0.8
|
|
6264
|
+
}
|
|
6265
|
+
},
|
|
5897
6266
|
{
|
|
5898
6267
|
id: "deepseek/deepseek-chat:free",
|
|
5899
6268
|
match: {
|
|
@@ -6003,6 +6372,17 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
6003
6372
|
},
|
|
6004
6373
|
prices: {}
|
|
6005
6374
|
},
|
|
6375
|
+
{
|
|
6376
|
+
id: "deepseek/deepseek-v3.2-exp",
|
|
6377
|
+
name: "DeepSeek V3.2 Experimental",
|
|
6378
|
+
match: {
|
|
6379
|
+
equals: "deepseek/deepseek-v3.2-exp"
|
|
6380
|
+
},
|
|
6381
|
+
prices: {
|
|
6382
|
+
input_mtok: 0.27,
|
|
6383
|
+
output_mtok: 0.4
|
|
6384
|
+
}
|
|
6385
|
+
},
|
|
6006
6386
|
{
|
|
6007
6387
|
id: "devstral-small",
|
|
6008
6388
|
name: "Devstral Small",
|
|
@@ -6187,7 +6567,14 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
6187
6567
|
id: "gemini-2.5-flash",
|
|
6188
6568
|
name: "Gemini 2.5 Flash",
|
|
6189
6569
|
match: {
|
|
6190
|
-
|
|
6570
|
+
or: [
|
|
6571
|
+
{
|
|
6572
|
+
equals: "gemini-2.5-flash"
|
|
6573
|
+
},
|
|
6574
|
+
{
|
|
6575
|
+
equals: "google/gemini-2.5-flash"
|
|
6576
|
+
}
|
|
6577
|
+
]
|
|
6191
6578
|
},
|
|
6192
6579
|
prices: {
|
|
6193
6580
|
input_mtok: 0.3,
|
|
@@ -6526,6 +6913,48 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
6526
6913
|
},
|
|
6527
6914
|
prices: {}
|
|
6528
6915
|
},
|
|
6916
|
+
{
|
|
6917
|
+
id: "google/gemini-2.5-flash-image",
|
|
6918
|
+
name: "Gemini 2.5 Flash Image (Nano Banana)",
|
|
6919
|
+
match: {
|
|
6920
|
+
or: [
|
|
6921
|
+
{
|
|
6922
|
+
equals: "google/gemini-2.5-flash-image"
|
|
6923
|
+
},
|
|
6924
|
+
{
|
|
6925
|
+
equals: "google/gemini-2.5-flash-image-preview"
|
|
6926
|
+
}
|
|
6927
|
+
]
|
|
6928
|
+
},
|
|
6929
|
+
prices: {
|
|
6930
|
+
input_mtok: 0.3,
|
|
6931
|
+
output_mtok: 2.5
|
|
6932
|
+
}
|
|
6933
|
+
},
|
|
6934
|
+
{
|
|
6935
|
+
id: "google/gemini-2.5-flash-lite",
|
|
6936
|
+
name: "Gemini 2.5 Flash Lite",
|
|
6937
|
+
match: {
|
|
6938
|
+
equals: "google/gemini-2.5-flash-lite"
|
|
6939
|
+
},
|
|
6940
|
+
prices: {
|
|
6941
|
+
input_mtok: 0.1,
|
|
6942
|
+
cache_write_mtok: 0.183,
|
|
6943
|
+
cache_read_mtok: 0.025,
|
|
6944
|
+
output_mtok: 0.4
|
|
6945
|
+
}
|
|
6946
|
+
},
|
|
6947
|
+
{
|
|
6948
|
+
id: "google/gemini-2.5-flash-lite-preview-09-2025",
|
|
6949
|
+
name: "Gemini 2.5 Flash Lite Preview 09-2025",
|
|
6950
|
+
match: {
|
|
6951
|
+
equals: "google/gemini-2.5-flash-lite-preview-09-2025"
|
|
6952
|
+
},
|
|
6953
|
+
prices: {
|
|
6954
|
+
input_mtok: 0.1,
|
|
6955
|
+
output_mtok: 0.4
|
|
6956
|
+
}
|
|
6957
|
+
},
|
|
6529
6958
|
{
|
|
6530
6959
|
id: "google/gemini-2.5-flash-preview",
|
|
6531
6960
|
match: {
|
|
@@ -6536,6 +6965,19 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
6536
6965
|
output_mtok: 0.6
|
|
6537
6966
|
}
|
|
6538
6967
|
},
|
|
6968
|
+
{
|
|
6969
|
+
id: "google/gemini-2.5-flash-preview-09-2025",
|
|
6970
|
+
name: "Gemini 2.5 Flash Preview 09-2025",
|
|
6971
|
+
match: {
|
|
6972
|
+
equals: "google/gemini-2.5-flash-preview-09-2025"
|
|
6973
|
+
},
|
|
6974
|
+
prices: {
|
|
6975
|
+
input_mtok: 0.3,
|
|
6976
|
+
cache_write_mtok: 0.383,
|
|
6977
|
+
cache_read_mtok: 0.075,
|
|
6978
|
+
output_mtok: 2.5
|
|
6979
|
+
}
|
|
6980
|
+
},
|
|
6539
6981
|
{
|
|
6540
6982
|
id: "google/gemini-2.5-flash-preview:thinking",
|
|
6541
6983
|
match: {
|
|
@@ -10635,6 +11077,28 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
10635
11077
|
input_mtok: 3,
|
|
10636
11078
|
output_mtok: 3
|
|
10637
11079
|
}
|
|
11080
|
+
},
|
|
11081
|
+
{
|
|
11082
|
+
id: "z-ai/glm-4.5",
|
|
11083
|
+
match: {
|
|
11084
|
+
equals: "z-ai/glm-4.5"
|
|
11085
|
+
},
|
|
11086
|
+
context_window: 131072,
|
|
11087
|
+
prices: {
|
|
11088
|
+
input_mtok: 0.35,
|
|
11089
|
+
output_mtok: 1.55
|
|
11090
|
+
}
|
|
11091
|
+
},
|
|
11092
|
+
{
|
|
11093
|
+
id: "z-ai/glm-4.6",
|
|
11094
|
+
match: {
|
|
11095
|
+
equals: "z-ai/glm-4.6"
|
|
11096
|
+
},
|
|
11097
|
+
context_window: 202752,
|
|
11098
|
+
prices: {
|
|
11099
|
+
input_mtok: 0.4,
|
|
11100
|
+
output_mtok: 1.75
|
|
11101
|
+
}
|
|
10638
11102
|
}
|
|
10639
11103
|
]
|
|
10640
11104
|
},
|
|
@@ -11754,35 +12218,49 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
11754
12218
|
]
|
|
11755
12219
|
}
|
|
11756
12220
|
];
|
|
11757
|
-
function We(
|
|
12221
|
+
function We(a, n) {
|
|
11758
12222
|
if (n <= 0) return 0;
|
|
11759
12223
|
let m = 0;
|
|
11760
|
-
const s = [...
|
|
11761
|
-
m += _ *
|
|
12224
|
+
const s = [...a.tiers].sort((k, h) => k.start - h.start), u = s[0]?.start ?? n, _ = Math.min(n, u);
|
|
12225
|
+
m += _ * a.base / 1e6;
|
|
11762
12226
|
for (let k = 0; k < s.length; k++) {
|
|
11763
|
-
const h = s[k], f = s[k + 1]?.start ?? 1 / 0,
|
|
11764
|
-
|
|
12227
|
+
const h = s[k], f = s[k + 1]?.start ?? 1 / 0, y = Math.max(0, Math.min(n, f) - h.start);
|
|
12228
|
+
y > 0 && (m += y * h.price / 1e6);
|
|
11765
12229
|
}
|
|
11766
12230
|
return m;
|
|
11767
12231
|
}
|
|
11768
|
-
function
|
|
11769
|
-
return
|
|
12232
|
+
function O(a, n, m) {
|
|
12233
|
+
return a === void 0 || n === void 0 ? 0 : typeof a == "number" ? a * n / 1e6 : We(a, n);
|
|
11770
12234
|
}
|
|
11771
|
-
function Ue(
|
|
12235
|
+
function Ue(a, n) {
|
|
11772
12236
|
let m = 0, s = 0;
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
12237
|
+
const u = a.cache_read_tokens ?? 0, _ = a.cache_write_tokens ?? 0, k = a.cache_audio_read_tokens ?? 0, h = a.output_audio_tokens ?? 0;
|
|
12238
|
+
let f = a.input_audio_tokens ?? 0;
|
|
12239
|
+
if (f -= k, f < 0)
|
|
12240
|
+
throw new Error("cache_audio_read_tokens cannot be greater than input_audio_tokens");
|
|
12241
|
+
let y = a.input_tokens ?? 0;
|
|
12242
|
+
if (y -= u, y -= _, y -= f, y < 0)
|
|
12243
|
+
throw new Error("Uncached text input tokens cannot be negative");
|
|
12244
|
+
let P = u;
|
|
12245
|
+
if (P -= k, P < 0)
|
|
12246
|
+
throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
|
|
12247
|
+
m += O(n.input_mtok, y), m += O(n.cache_read_mtok, P), m += O(n.cache_write_mtok, _), m += O(n.input_audio_mtok, f), m += O(n.cache_audio_read_mtok, k);
|
|
12248
|
+
let S = a.output_tokens ?? 0;
|
|
12249
|
+
if (S -= h, S < 0)
|
|
12250
|
+
throw new Error("output_audio_tokens cannot be greater than output_tokens");
|
|
12251
|
+
s += O(n.output_mtok, S), s += O(n.output_audio_mtok, a.output_audio_tokens);
|
|
12252
|
+
let G = m + s;
|
|
12253
|
+
return n.requests_kcount !== void 0 && (G += n.requests_kcount / 1e3), {
|
|
11776
12254
|
input_price: m,
|
|
11777
12255
|
output_price: s,
|
|
11778
|
-
total_price:
|
|
12256
|
+
total_price: G
|
|
11779
12257
|
};
|
|
11780
12258
|
}
|
|
11781
|
-
function Ke(
|
|
11782
|
-
if (!Array.isArray(
|
|
11783
|
-
return
|
|
11784
|
-
for (let m =
|
|
11785
|
-
const s =
|
|
12259
|
+
function Ke(a, n) {
|
|
12260
|
+
if (!Array.isArray(a.prices))
|
|
12261
|
+
return a.prices;
|
|
12262
|
+
for (let m = a.prices.length - 1; m >= 0; m--) {
|
|
12263
|
+
const s = a.prices[m], u = s.constraint;
|
|
11786
12264
|
if (u === void 0)
|
|
11787
12265
|
return s.prices;
|
|
11788
12266
|
if (u.type === "start_date") {
|
|
@@ -11797,34 +12275,34 @@ function Ke(i, n) {
|
|
|
11797
12275
|
return s.prices;
|
|
11798
12276
|
}
|
|
11799
12277
|
}
|
|
11800
|
-
return
|
|
12278
|
+
return a.prices[0].prices;
|
|
11801
12279
|
}
|
|
11802
|
-
function
|
|
11803
|
-
return "or" in
|
|
12280
|
+
function j(a, n) {
|
|
12281
|
+
return "or" in a ? a.or.some((m) => j(m, n)) : "and" in a ? a.and.every((m) => j(m, n)) : "equals" in a ? n === a.equals : "starts_with" in a ? n.startsWith(a.starts_with) : "ends_with" in a ? n.endsWith(a.ends_with) : "contains" in a ? n.includes(a.contains) : "regex" in a ? new RegExp(a.regex).test(n) : !1;
|
|
11804
12282
|
}
|
|
11805
|
-
function Ye(
|
|
11806
|
-
const m = n.toLowerCase().trim(), s =
|
|
11807
|
-
return s ||
|
|
12283
|
+
function Ye(a, n) {
|
|
12284
|
+
const m = n.toLowerCase().trim(), s = a.find((u) => u.id === m);
|
|
12285
|
+
return s || a.find((u) => u.provider_match && j(u.provider_match, m));
|
|
11808
12286
|
}
|
|
11809
|
-
function Je(
|
|
12287
|
+
function Je(a, { modelId: n, providerApiUrl: m, providerId: s }) {
|
|
11810
12288
|
if (s)
|
|
11811
|
-
return Ye(
|
|
12289
|
+
return Ye(a, s);
|
|
11812
12290
|
if (m)
|
|
11813
|
-
return
|
|
12291
|
+
return a.find((u) => new RegExp(u.api_pattern).test(m));
|
|
11814
12292
|
if (n)
|
|
11815
|
-
return
|
|
12293
|
+
return a.find((u) => u.model_match && j(u.model_match, n));
|
|
11816
12294
|
}
|
|
11817
|
-
function Ze(
|
|
11818
|
-
return
|
|
12295
|
+
function Ze(a, n) {
|
|
12296
|
+
return a.find((m) => j(m.match, n));
|
|
11819
12297
|
}
|
|
11820
|
-
let Xe =
|
|
11821
|
-
Promise.resolve(
|
|
11822
|
-
function et(
|
|
12298
|
+
let Xe = ae;
|
|
12299
|
+
Promise.resolve(ae);
|
|
12300
|
+
function et(a, n, m) {
|
|
11823
12301
|
const s = n.toLowerCase().trim(), u = m?.provider ?? Je(Xe, { modelId: s, providerApiUrl: m?.providerApiUrl, providerId: m?.providerId });
|
|
11824
12302
|
if (!u) return null;
|
|
11825
12303
|
const _ = Ze(u.models, s);
|
|
11826
12304
|
if (!_) return null;
|
|
11827
|
-
const k = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Ke(_, k), f = Ue(
|
|
12305
|
+
const k = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Ke(_, k), f = Ue(a, h);
|
|
11828
12306
|
return {
|
|
11829
12307
|
auto_update_timestamp: void 0,
|
|
11830
12308
|
model: _,
|
|
@@ -11836,15 +12314,15 @@ function et(i, n, m) {
|
|
|
11836
12314
|
const b = de(Ce(process.argv)).scriptName("genai-prices").command(
|
|
11837
12315
|
"list [provider]",
|
|
11838
12316
|
"List providers and models",
|
|
11839
|
-
(
|
|
12317
|
+
(a) => a.positional("provider", { describe: "Provider ID to filter", type: "string" })
|
|
11840
12318
|
).command(
|
|
11841
12319
|
"calc <model...>",
|
|
11842
12320
|
"Calculate price",
|
|
11843
|
-
(
|
|
12321
|
+
(a) => a.positional("model", { array: !0, describe: "Model(s) (optionally provider:model)", type: "string" }).option("input-tokens", { type: "number" }).option("cache-write-tokens", { type: "number" }).option("cache-read-tokens", { type: "number" }).option("output-tokens", { type: "number" }).option("input-audio-tokens", { type: "number" }).option("cache-audio-read-tokens", { type: "number" }).option("output-audio-tokens", { type: "number" }).option("requests", { type: "number" }).option("provider", { type: "string" }).option("auto-update", { default: !1, type: "boolean" }).option("timestamp", { describe: "RFC3339 timestamp", type: "string" })
|
|
11844
12322
|
).option("auto-update", { describe: "Enable auto-update from GitHub", type: "boolean" }).option("input-tokens", { type: "number" }).option("cache-write-tokens", { type: "number" }).option("cache-read-tokens", { type: "number" }).option("output-tokens", { type: "number" }).option("input-audio-tokens", { type: "number" }).option("cache-audio-read-tokens", { type: "number" }).option("output-audio-tokens", { type: "number" }).option("requests", { type: "number" }).option("provider", { type: "string" }).option("timestamp", { describe: "RFC3339 timestamp", type: "string" }).version("0.1.0").help().parseSync();
|
|
11845
12323
|
function tt() {
|
|
11846
12324
|
if (b._[0] === "list") {
|
|
11847
|
-
const m =
|
|
12325
|
+
const m = ae;
|
|
11848
12326
|
if (b.provider) {
|
|
11849
12327
|
const s = m.find((u) => u.id === b.provider);
|
|
11850
12328
|
s || (console.error(`Provider ${b.provider} not found.`), process.exit(1)), console.log(`${s.name}: (${s.models.length} models)`);
|
|
@@ -11880,17 +12358,17 @@ function tt() {
|
|
|
11880
12358
|
u = !0, console.error(`No price found for model ${_}`);
|
|
11881
12359
|
continue;
|
|
11882
12360
|
}
|
|
11883
|
-
const
|
|
12361
|
+
const y = f.model.context_window, P = [
|
|
11884
12362
|
["Provider", f.provider.name],
|
|
11885
12363
|
["Model", f.model.name ?? f.model.id],
|
|
11886
12364
|
["Model Prices", JSON.stringify(f.model_price)],
|
|
11887
|
-
["Context Window",
|
|
12365
|
+
["Context Window", y !== void 0 ? y.toLocaleString() : void 0],
|
|
11888
12366
|
["Total Price", `$${f.total_price}`],
|
|
11889
12367
|
["Input Price", `$${f.input_price}`],
|
|
11890
12368
|
["Output Price", `$${f.output_price}`]
|
|
11891
12369
|
];
|
|
11892
|
-
for (const [
|
|
11893
|
-
|
|
12370
|
+
for (const [S, G] of P)
|
|
12371
|
+
G !== void 0 && console.log(`${S.padStart(14)}: ${G}`);
|
|
11894
12372
|
console.log("");
|
|
11895
12373
|
} catch (f) {
|
|
11896
12374
|
u = !0, f instanceof Error && console.error(`Error for model ${_}:`, f.message);
|