@pydantic/genai-prices 0.0.56 → 0.0.60
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 +597 -191
- package/dist/index.cjs +4 -4
- package/dist/index.js +597 -191
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import he from "yargs";
|
|
3
3
|
import { format as ke } from "util";
|
|
4
|
-
import { resolve as
|
|
4
|
+
import { resolve as oe, normalize as Pe } from "path";
|
|
5
5
|
import { readFileSync as ge, writeFile as Qe, statSync as Te } from "fs";
|
|
6
6
|
import "assert";
|
|
7
7
|
import { fileURLToPath as Se } from "url";
|
|
@@ -22,7 +22,7 @@ function Re(i) {
|
|
|
22
22
|
* Copyright (c) 2016, Contributors
|
|
23
23
|
* SPDX-License-Identifier: ISC
|
|
24
24
|
*/
|
|
25
|
-
function
|
|
25
|
+
function W(i) {
|
|
26
26
|
if (i !== i.toLowerCase() && i !== i.toUpperCase() || (i = i.toLowerCase()), i.indexOf("-") === -1 && i.indexOf("_") === -1)
|
|
27
27
|
return i;
|
|
28
28
|
{
|
|
@@ -35,7 +35,7 @@ function $(i) {
|
|
|
35
35
|
return u;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Oe(i, o) {
|
|
39
39
|
const u = i.toLowerCase();
|
|
40
40
|
o = o || "-";
|
|
41
41
|
let s = "";
|
|
@@ -45,7 +45,7 @@ function Ee(i, o) {
|
|
|
45
45
|
}
|
|
46
46
|
return s;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function Ne(i) {
|
|
49
49
|
return i == null ? !1 : typeof i == "number" || /^0x[0-9a-f]+$/i.test(i) ? !0 : /^0[^.]/.test(i) ? !1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(i);
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
@@ -53,7 +53,7 @@ function Oe(i) {
|
|
|
53
53
|
* Copyright (c) 2016, Contributors
|
|
54
54
|
* SPDX-License-Identifier: ISC
|
|
55
55
|
*/
|
|
56
|
-
function
|
|
56
|
+
function Ee(i) {
|
|
57
57
|
if (Array.isArray(i))
|
|
58
58
|
return i.map((_) => typeof _ != "string" ? _ + "" : _);
|
|
59
59
|
i = i.trim();
|
|
@@ -82,10 +82,10 @@ var P;
|
|
|
82
82
|
* Copyright (c) 2016, Contributors
|
|
83
83
|
* SPDX-License-Identifier: ISC
|
|
84
84
|
*/
|
|
85
|
-
let
|
|
85
|
+
let C;
|
|
86
86
|
class De {
|
|
87
87
|
constructor(o) {
|
|
88
|
-
|
|
88
|
+
C = o;
|
|
89
89
|
}
|
|
90
90
|
parse(o, u) {
|
|
91
91
|
const s = Object.assign({
|
|
@@ -105,7 +105,7 @@ class De {
|
|
|
105
105
|
number: void 0,
|
|
106
106
|
__: void 0,
|
|
107
107
|
key: void 0
|
|
108
|
-
}, u), r =
|
|
108
|
+
}, u), r = Ee(o), h = typeof o == "string", _ = Fe(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), k = Object.assign({
|
|
109
109
|
"boolean-negation": !0,
|
|
110
110
|
"camel-case-expansion": !0,
|
|
111
111
|
"combine-arrays": !1,
|
|
@@ -124,7 +124,7 @@ class De {
|
|
|
124
124
|
"strip-aliased": !1,
|
|
125
125
|
"strip-dashed": !1,
|
|
126
126
|
"unknown-options-as-args": !1
|
|
127
|
-
}, s.configuration), q = Object.assign(/* @__PURE__ */ Object.create(null), s.default),
|
|
127
|
+
}, s.configuration), q = Object.assign(/* @__PURE__ */ Object.create(null), s.default), T = s.configObjects || [], B = s.envPrefix, Q = k["populate--"], y = Q ? "--" : "_", S = /* @__PURE__ */ Object.create(null), O = /* @__PURE__ */ Object.create(null), M = s.__ || C.format, m = {
|
|
128
128
|
aliases: /* @__PURE__ */ Object.create(null),
|
|
129
129
|
arrays: /* @__PURE__ */ Object.create(null),
|
|
130
130
|
bools: /* @__PURE__ */ Object.create(null),
|
|
@@ -136,7 +136,7 @@ class De {
|
|
|
136
136
|
nargs: /* @__PURE__ */ Object.create(null),
|
|
137
137
|
coercions: /* @__PURE__ */ Object.create(null),
|
|
138
138
|
keys: []
|
|
139
|
-
},
|
|
139
|
+
}, I = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, U = new RegExp("^--" + k["negation-prefix"] + "(.+)");
|
|
140
140
|
[].concat(s.array || []).filter(Boolean).forEach(function(e) {
|
|
141
141
|
const a = typeof e == "object" ? e.key : e, c = Object.keys(e).map(function(n) {
|
|
142
142
|
return {
|
|
@@ -169,33 +169,33 @@ class De {
|
|
|
169
169
|
q[a] = q[e];
|
|
170
170
|
});
|
|
171
171
|
});
|
|
172
|
-
let
|
|
172
|
+
let L = null;
|
|
173
173
|
Ae();
|
|
174
|
-
let
|
|
174
|
+
let V = [];
|
|
175
175
|
const w = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), se = {};
|
|
176
176
|
for (let e = 0; e < r.length; e++) {
|
|
177
177
|
const a = r[e], c = a.replace(/^-{3,}/, "---");
|
|
178
178
|
let n, t, l, p, d, v;
|
|
179
|
-
if (a !== "--" && /^-/.test(a) &&
|
|
180
|
-
|
|
179
|
+
if (a !== "--" && /^-/.test(a) && $(a))
|
|
180
|
+
Y(a);
|
|
181
181
|
else if (c.match(/^---+(=|$)/)) {
|
|
182
|
-
|
|
182
|
+
Y(a);
|
|
183
183
|
continue;
|
|
184
184
|
} else if (a.match(/^--.+=/) || !k["short-option-groups"] && a.match(/^-.+=/))
|
|
185
|
-
p = a.match(/^--?([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && (g(p[1], m.arrays) ? e =
|
|
186
|
-
else if (a.match(
|
|
187
|
-
p = a.match(
|
|
185
|
+
p = a.match(/^--?([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && (g(p[1], m.arrays) ? e = K(e, p[1], r, p[2]) : g(p[1], m.nargs) !== !1 ? e = j(e, p[1], r, p[2]) : b(p[1], p[2], !0));
|
|
186
|
+
else if (a.match(U) && k["boolean-negation"])
|
|
187
|
+
p = a.match(U), p !== null && Array.isArray(p) && p.length >= 2 && (t = p[1], b(t, g(t, m.arrays) ? [!1] : !1));
|
|
188
188
|
else if (a.match(/^--.+/) || !k["short-option-groups"] && a.match(/^-[^-]+/))
|
|
189
|
-
p = a.match(/^--?(.+)/), p !== null && Array.isArray(p) && p.length >= 2 && (t = p[1], g(t, m.arrays) ? e =
|
|
189
|
+
p = a.match(/^--?(.+)/), p !== null && Array.isArray(p) && p.length >= 2 && (t = p[1], g(t, m.arrays) ? e = K(e, t, r) : g(t, m.nargs) !== !1 ? e = j(e, t, r) : (d = r[e + 1], d !== void 0 && (!d.match(/^-/) || d.match(I)) && !g(t, m.bools) && !g(t, m.counts) || /^(true|false)$/.test(d) ? (b(t, d), e++) : b(t, R(t))));
|
|
190
190
|
else if (a.match(/^-.\..+=/))
|
|
191
191
|
p = a.match(/^-([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && b(p[1], p[2]);
|
|
192
|
-
else if (a.match(/^-.\..+/) && !a.match(
|
|
192
|
+
else if (a.match(/^-.\..+/) && !a.match(I))
|
|
193
193
|
d = r[e + 1], p = a.match(/^-(.\..+)/), p !== null && Array.isArray(p) && p.length >= 2 && (t = p[1], d !== void 0 && !d.match(/^-/) && !g(t, m.bools) && !g(t, m.counts) ? (b(t, d), e++) : b(t, R(t)));
|
|
194
|
-
else if (a.match(/^-[^-]+/) && !a.match(
|
|
194
|
+
else if (a.match(/^-[^-]+/) && !a.match(I)) {
|
|
195
195
|
l = a.slice(1, -1).split(""), n = !1;
|
|
196
196
|
for (let x = 0; x < l.length; x++) {
|
|
197
197
|
if (d = a.slice(x + 2), l[x + 1] && l[x + 1] === "=") {
|
|
198
|
-
v = a.slice(x + 3), t = l[x], g(t, m.arrays) ? e =
|
|
198
|
+
v = a.slice(x + 3), t = l[x], g(t, m.arrays) ? e = K(e, t, r, v) : g(t, m.nargs) !== !1 ? e = j(e, t, r, v) : b(t, v), n = !0;
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
201
|
if (d === "-") {
|
|
@@ -212,80 +212,80 @@ class De {
|
|
|
212
212
|
} else
|
|
213
213
|
b(l[x], R(l[x]));
|
|
214
214
|
}
|
|
215
|
-
t = a.slice(-1)[0], !n && t !== "-" && (g(t, m.arrays) ? e =
|
|
216
|
-
} else if (a.match(/^-[0-9]$/) && a.match(
|
|
215
|
+
t = a.slice(-1)[0], !n && t !== "-" && (g(t, m.arrays) ? e = K(e, t, r) : g(t, m.nargs) !== !1 ? e = j(e, t, r) : (d = r[e + 1], d !== void 0 && (!/^(-|--)[^-]/.test(d) || d.match(I)) && !g(t, m.bools) && !g(t, m.counts) || /^(true|false)$/.test(d) ? (b(t, d), e++) : b(t, R(t))));
|
|
216
|
+
} else if (a.match(/^-[0-9]$/) && a.match(I) && g(a.slice(1), m.bools))
|
|
217
217
|
t = a.slice(1), b(t, R(t));
|
|
218
218
|
else if (a === "--") {
|
|
219
|
-
|
|
219
|
+
V = r.slice(e + 1);
|
|
220
220
|
break;
|
|
221
221
|
} else if (k["halt-at-non-option"]) {
|
|
222
|
-
|
|
222
|
+
V = r.slice(e);
|
|
223
223
|
break;
|
|
224
224
|
} else
|
|
225
|
-
|
|
225
|
+
Y(a);
|
|
226
226
|
}
|
|
227
227
|
me(w, !0), me(w, !1), fe(w), be(), ue(w, m.aliases, q, !0), we(w), k["set-placeholder-key"] && ve(w), Object.keys(m.counts).forEach(function(e) {
|
|
228
|
-
|
|
229
|
-
}),
|
|
230
|
-
w[
|
|
228
|
+
N(w, e.split(".")) || b(e, 0);
|
|
229
|
+
}), Q && V.length && (w[y] = []), V.forEach(function(e) {
|
|
230
|
+
w[y].push(e);
|
|
231
231
|
}), k["camel-case-expansion"] && k["strip-dashed"] && Object.keys(w).filter((e) => e !== "--" && e.includes("-")).forEach((e) => {
|
|
232
232
|
delete w[e];
|
|
233
233
|
}), k["strip-aliased"] && [].concat(...Object.keys(_).map((e) => _[e])).forEach((e) => {
|
|
234
|
-
k["camel-case-expansion"] && e.includes("-") && delete w[e.split(".").map((a) =>
|
|
234
|
+
k["camel-case-expansion"] && e.includes("-") && delete w[e.split(".").map((a) => W(a)).join(".")], delete w[e];
|
|
235
235
|
});
|
|
236
|
-
function
|
|
237
|
-
const a =
|
|
236
|
+
function Y(e) {
|
|
237
|
+
const a = H("_", e);
|
|
238
238
|
(typeof a == "string" || typeof a == "number") && w._.push(a);
|
|
239
239
|
}
|
|
240
240
|
function j(e, a, c, n) {
|
|
241
241
|
let t, l = g(a, m.nargs);
|
|
242
242
|
if (l = typeof l != "number" || isNaN(l) ? 1 : l, l === 0)
|
|
243
|
-
return
|
|
244
|
-
let p =
|
|
243
|
+
return G(n) || (L = Error(M("Argument unexpected for: %s", a))), b(a, R(a)), e;
|
|
244
|
+
let p = G(n) ? 0 : 1;
|
|
245
245
|
if (k["nargs-eats-options"])
|
|
246
|
-
c.length - (e + 1) + p < l && (
|
|
246
|
+
c.length - (e + 1) + p < l && (L = Error(M("Not enough arguments following: %s", a))), p = l;
|
|
247
247
|
else {
|
|
248
|
-
for (t = e + 1; t < c.length && (!c[t].match(/^-[^0-9]/) || c[t].match(
|
|
248
|
+
for (t = e + 1; t < c.length && (!c[t].match(/^-[^0-9]/) || c[t].match(I) || $(c[t])); t++)
|
|
249
249
|
p++;
|
|
250
|
-
p < l && (
|
|
250
|
+
p < l && (L = Error(M("Not enough arguments following: %s", a)));
|
|
251
251
|
}
|
|
252
252
|
let d = Math.min(p, l);
|
|
253
|
-
for (!
|
|
253
|
+
for (!G(n) && d > 0 && (b(a, n), d--), t = e + 1; t < d + e + 1; t++)
|
|
254
254
|
b(a, c[t]);
|
|
255
255
|
return e + d;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function K(e, a, c, n) {
|
|
258
258
|
let t = [], l = n || c[e + 1];
|
|
259
259
|
const p = g(a, m.nargs);
|
|
260
260
|
if (g(a, m.bools) && !/^(true|false)$/.test(l))
|
|
261
261
|
t.push(!0);
|
|
262
|
-
else if (
|
|
262
|
+
else if (G(l) || G(n) && /^-/.test(l) && !I.test(l) && !$(l)) {
|
|
263
263
|
if (q[a] !== void 0) {
|
|
264
264
|
const d = q[a];
|
|
265
265
|
t = Array.isArray(d) ? d : [d];
|
|
266
266
|
}
|
|
267
267
|
} else {
|
|
268
|
-
|
|
269
|
-
for (let d = e + 1; d < c.length && !(!k["greedy-arrays"] && t.length > 0 || p && typeof p == "number" && t.length >= p || (l = c[d], /^-/.test(l) && !
|
|
270
|
-
e = d, t.push(
|
|
268
|
+
G(n) || t.push(J(a, n, !0));
|
|
269
|
+
for (let d = e + 1; d < c.length && !(!k["greedy-arrays"] && t.length > 0 || p && typeof p == "number" && t.length >= p || (l = c[d], /^-/.test(l) && !I.test(l) && !$(l))); d++)
|
|
270
|
+
e = d, t.push(J(a, l, h));
|
|
271
271
|
}
|
|
272
|
-
return typeof p == "number" && (p && t.length < p || isNaN(p) && t.length === 0) && (
|
|
272
|
+
return typeof p == "number" && (p && t.length < p || isNaN(p) && t.length === 0) && (L = Error(M("Not enough arguments following: %s", a))), b(a, t), e;
|
|
273
273
|
}
|
|
274
274
|
function b(e, a, c = h) {
|
|
275
275
|
if (/-/.test(e) && k["camel-case-expansion"]) {
|
|
276
276
|
const l = e.split(".").map(function(p) {
|
|
277
|
-
return
|
|
277
|
+
return W(p);
|
|
278
278
|
}).join(".");
|
|
279
279
|
re(e, l);
|
|
280
280
|
}
|
|
281
|
-
const n =
|
|
282
|
-
|
|
281
|
+
const n = J(e, a, c), t = e.split(".");
|
|
282
|
+
E(w, t, n), m.aliases[e] && m.aliases[e].forEach(function(l) {
|
|
283
283
|
const p = l.split(".");
|
|
284
|
-
|
|
284
|
+
E(w, p, n);
|
|
285
285
|
}), t.length > 1 && k["dot-notation"] && (m.aliases[t[0]] || []).forEach(function(l) {
|
|
286
286
|
let p = l.split(".");
|
|
287
287
|
const d = [].concat(t);
|
|
288
|
-
d.shift(), p = p.concat(d), (m.aliases[e] || []).includes(p.join(".")) ||
|
|
288
|
+
d.shift(), p = p.concat(d), (m.aliases[e] || []).includes(p.join(".")) || E(w, p, n);
|
|
289
289
|
}), g(e, m.normalize) && !g(e, m.arrays) && [e].concat(m.aliases[e] || []).forEach(function(p) {
|
|
290
290
|
Object.defineProperty(se, p, {
|
|
291
291
|
enumerable: !0,
|
|
@@ -293,23 +293,23 @@ class De {
|
|
|
293
293
|
return a;
|
|
294
294
|
},
|
|
295
295
|
set(d) {
|
|
296
|
-
a = typeof d == "string" ?
|
|
296
|
+
a = typeof d == "string" ? C.normalize(d) : d;
|
|
297
297
|
}
|
|
298
298
|
});
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
function re(e, a) {
|
|
302
|
-
m.aliases[e] && m.aliases[e].length || (m.aliases[e] = [a],
|
|
302
|
+
m.aliases[e] && m.aliases[e].length || (m.aliases[e] = [a], S[a] = !0), m.aliases[a] && m.aliases[a].length || re(a, e);
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
c && (a =
|
|
304
|
+
function J(e, a, c) {
|
|
305
|
+
c && (a = Ve(a)), (g(e, m.bools) || g(e, m.counts)) && typeof a == "string" && (a = a === "true");
|
|
306
306
|
let n = Array.isArray(a) ? a.map(function(t) {
|
|
307
|
-
return
|
|
308
|
-
}) :
|
|
309
|
-
return g(e, m.counts) && (
|
|
307
|
+
return H(e, t);
|
|
308
|
+
}) : H(e, a);
|
|
309
|
+
return g(e, m.counts) && (G(n) || typeof n == "boolean") && (n = X()), g(e, m.normalize) && g(e, m.arrays) && (Array.isArray(a) ? n = a.map((t) => C.normalize(t)) : n = C.normalize(a)), n;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
return !k["parse-positional-numbers"] && e === "_" || !g(e, m.strings) && !g(e, m.bools) && !Array.isArray(a) && (
|
|
311
|
+
function H(e, a) {
|
|
312
|
+
return !k["parse-positional-numbers"] && e === "_" || !g(e, m.strings) && !g(e, m.bools) && !Array.isArray(a) && (Ne(a) && k["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${a}`))) || !G(a) && g(e, m.numbers)) && (a = Number(a)), a;
|
|
313
313
|
}
|
|
314
314
|
function fe(e) {
|
|
315
315
|
const a = /* @__PURE__ */ Object.create(null);
|
|
@@ -318,7 +318,7 @@ class De {
|
|
|
318
318
|
if (n)
|
|
319
319
|
try {
|
|
320
320
|
let t = null;
|
|
321
|
-
const l =
|
|
321
|
+
const l = C.resolve(C.cwd(), n), p = m.configs[c];
|
|
322
322
|
if (typeof p == "function") {
|
|
323
323
|
try {
|
|
324
324
|
t = p(l);
|
|
@@ -326,38 +326,38 @@ class De {
|
|
|
326
326
|
t = d;
|
|
327
327
|
}
|
|
328
328
|
if (t instanceof Error) {
|
|
329
|
-
|
|
329
|
+
L = t;
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
332
|
} else
|
|
333
|
-
t =
|
|
334
|
-
|
|
333
|
+
t = C.require(l);
|
|
334
|
+
Z(t);
|
|
335
335
|
} catch (t) {
|
|
336
|
-
t.name === "PermissionDenied" ?
|
|
336
|
+
t.name === "PermissionDenied" ? L = t : e[c] && (L = Error(M("Invalid JSON config file: %s", n)));
|
|
337
337
|
}
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function Z(e, a) {
|
|
341
341
|
Object.keys(e).forEach(function(c) {
|
|
342
342
|
const n = e[c], t = a ? a + "." + c : c;
|
|
343
|
-
typeof n == "object" && n !== null && !Array.isArray(n) && k["dot-notation"] ?
|
|
343
|
+
typeof n == "object" && n !== null && !Array.isArray(n) && k["dot-notation"] ? Z(n, t) : (!N(w, t.split(".")) || g(t, m.arrays) && k["combine-arrays"]) && b(t, n);
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
346
|
function be() {
|
|
347
|
-
typeof
|
|
348
|
-
|
|
347
|
+
typeof T < "u" && T.forEach(function(e) {
|
|
348
|
+
Z(e);
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
351
|
function me(e, a) {
|
|
352
352
|
if (typeof B > "u")
|
|
353
353
|
return;
|
|
354
|
-
const c = typeof B == "string" ? B : "", n =
|
|
354
|
+
const c = typeof B == "string" ? B : "", n = C.env();
|
|
355
355
|
Object.keys(n).forEach(function(t) {
|
|
356
356
|
if (c === "" || t.lastIndexOf(c, 0) === 0) {
|
|
357
357
|
const l = t.split("__").map(function(p, d) {
|
|
358
|
-
return d === 0 && (p = p.substring(c.length)),
|
|
358
|
+
return d === 0 && (p = p.substring(c.length)), W(p);
|
|
359
359
|
});
|
|
360
|
-
(a && m.configs[l.join(".")] || !a) && !
|
|
360
|
+
(a && m.configs[l.join(".")] || !a) && !N(e, l) && b(l.join("."), n[t]);
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
363
|
}
|
|
@@ -367,12 +367,12 @@ class De {
|
|
|
367
367
|
Object.keys(e).forEach(function(n) {
|
|
368
368
|
if (!c.has(n) && (a = g(n, m.coercions), typeof a == "function"))
|
|
369
369
|
try {
|
|
370
|
-
const t =
|
|
370
|
+
const t = H(n, a(e[n]));
|
|
371
371
|
[].concat(m.aliases[n] || [], n).forEach((l) => {
|
|
372
372
|
c.add(l), e[l] = t;
|
|
373
373
|
});
|
|
374
374
|
} catch (t) {
|
|
375
|
-
|
|
375
|
+
L = t;
|
|
376
376
|
}
|
|
377
377
|
});
|
|
378
378
|
}
|
|
@@ -383,12 +383,12 @@ class De {
|
|
|
383
383
|
}
|
|
384
384
|
function ue(e, a, c, n = !1) {
|
|
385
385
|
Object.keys(c).forEach(function(t) {
|
|
386
|
-
|
|
387
|
-
|
|
386
|
+
N(e, t.split(".")) || (E(e, t.split("."), c[t]), n && (O[t] = !0), (a[t] || []).forEach(function(l) {
|
|
387
|
+
N(e, l.split(".")) || E(e, l.split("."), c[t]);
|
|
388
388
|
}));
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function N(e, a) {
|
|
392
392
|
let c = e;
|
|
393
393
|
k["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(t) {
|
|
394
394
|
c = c[t] || {};
|
|
@@ -396,27 +396,27 @@ class De {
|
|
|
396
396
|
const n = a[a.length - 1];
|
|
397
397
|
return typeof c != "object" ? !1 : n in c;
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function E(e, a, c) {
|
|
400
400
|
let n = e;
|
|
401
401
|
k["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(v) {
|
|
402
402
|
v = pe(v), typeof n == "object" && n[v] === void 0 && (n[v] = {}), typeof n[v] != "object" || Array.isArray(n[v]) ? (Array.isArray(n[v]) ? n[v].push({}) : n[v] = [n[v], {}], n = n[v][n[v].length - 1]) : n = n[v];
|
|
403
403
|
});
|
|
404
404
|
const t = pe(a[a.length - 1]), l = g(a.join("."), m.arrays), p = Array.isArray(c);
|
|
405
405
|
let d = k["duplicate-arguments-array"];
|
|
406
|
-
!d && g(t, m.nargs) && (d = !0, (!
|
|
406
|
+
!d && g(t, m.nargs) && (d = !0, (!G(n[t]) && m.nargs[t] === 1 || Array.isArray(n[t]) && n[t].length === m.nargs[t]) && (n[t] = void 0)), c === X() ? n[t] = X(n[t]) : Array.isArray(n[t]) ? d && l && p ? n[t] = k["flatten-duplicate-arrays"] ? n[t].concat(c) : (Array.isArray(n[t][0]) ? n[t] : [n[t]]).concat([c]) : !d && !!l == !!p ? n[t] = c : n[t] = n[t].concat([c]) : n[t] === void 0 && l ? n[t] = p ? c : [c] : d && !(n[t] === void 0 || g(t, m.counts) || g(t, m.bools)) ? n[t] = [n[t], c] : n[t] = c;
|
|
407
407
|
}
|
|
408
408
|
function xe(...e) {
|
|
409
409
|
e.forEach(function(a) {
|
|
410
410
|
Object.keys(a || {}).forEach(function(c) {
|
|
411
411
|
m.aliases[c] || (m.aliases[c] = [].concat(_[c] || []), m.aliases[c].concat(c).forEach(function(n) {
|
|
412
412
|
if (/-/.test(n) && k["camel-case-expansion"]) {
|
|
413
|
-
const t =
|
|
414
|
-
t !== c && m.aliases[c].indexOf(t) === -1 && (m.aliases[c].push(t),
|
|
413
|
+
const t = W(n);
|
|
414
|
+
t !== c && m.aliases[c].indexOf(t) === -1 && (m.aliases[c].push(t), S[t] = !0);
|
|
415
415
|
}
|
|
416
416
|
}), m.aliases[c].concat(c).forEach(function(n) {
|
|
417
417
|
if (n.length > 1 && /[A-Z]/.test(n) && k["camel-case-expansion"]) {
|
|
418
|
-
const t =
|
|
419
|
-
t !== c && m.aliases[c].indexOf(t) === -1 && (m.aliases[c].push(t),
|
|
418
|
+
const t = Oe(n, "-");
|
|
419
|
+
t !== c && m.aliases[c].indexOf(t) === -1 && (m.aliases[c].push(t), S[t] = !0);
|
|
420
420
|
}
|
|
421
421
|
}), m.aliases[c].forEach(function(n) {
|
|
422
422
|
m.aliases[n] = [c].concat(m.aliases[c].filter(function(t) {
|
|
@@ -443,7 +443,7 @@ class De {
|
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
445
|
function ye(e) {
|
|
446
|
-
if (e.match(
|
|
446
|
+
if (e.match(I) || !e.match(/^-[^-]+/))
|
|
447
447
|
return !1;
|
|
448
448
|
let a = !0, c;
|
|
449
449
|
const n = e.slice(1).split("");
|
|
@@ -457,16 +457,16 @@ class De {
|
|
|
457
457
|
}
|
|
458
458
|
return a;
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function $(e) {
|
|
461
461
|
return k["unknown-options-as-args"] && Ie(e);
|
|
462
462
|
}
|
|
463
463
|
function Ie(e) {
|
|
464
|
-
return e = e.replace(/^-{3,}/, "--"), e.match(
|
|
464
|
+
return e = e.replace(/^-{3,}/, "--"), e.match(I) || ye(e) ? !1 : !Be(e, /^-+([^=]+?)=[\s\S]*$/, U, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/);
|
|
465
465
|
}
|
|
466
466
|
function R(e) {
|
|
467
|
-
return !g(e, m.bools) && !g(e, m.counts) && `${e}` in q ? q[e] : Le(
|
|
467
|
+
return !g(e, m.bools) && !g(e, m.counts) && `${e}` in q ? q[e] : Me(Le(e));
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Me(e) {
|
|
470
470
|
return {
|
|
471
471
|
[P.BOOLEAN]: !0,
|
|
472
472
|
[P.STRING]: "",
|
|
@@ -474,23 +474,23 @@ class De {
|
|
|
474
474
|
[P.ARRAY]: []
|
|
475
475
|
}[e];
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function Le(e) {
|
|
478
478
|
let a = P.BOOLEAN;
|
|
479
479
|
return g(e, m.strings) ? a = P.STRING : g(e, m.numbers) ? a = P.NUMBER : g(e, m.bools) ? a = P.BOOLEAN : g(e, m.arrays) && (a = P.ARRAY), a;
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function G(e) {
|
|
482
482
|
return e === void 0;
|
|
483
483
|
}
|
|
484
484
|
function Ae() {
|
|
485
|
-
Object.keys(m.counts).find((e) => g(e, m.arrays) ? (
|
|
485
|
+
Object.keys(m.counts).find((e) => g(e, m.arrays) ? (L = Error(M("Invalid configuration: %s, opts.count excludes opts.array.", e)), !0) : g(e, m.nargs) ? (L = Error(M("Invalid configuration: %s, opts.count excludes opts.narg.", e)), !0) : !1);
|
|
486
486
|
}
|
|
487
487
|
return {
|
|
488
488
|
aliases: Object.assign({}, m.aliases),
|
|
489
489
|
argv: Object.assign(se, w),
|
|
490
490
|
configuration: k,
|
|
491
|
-
defaulted: Object.assign({},
|
|
492
|
-
error:
|
|
493
|
-
newAliases: Object.assign({},
|
|
491
|
+
defaulted: Object.assign({}, O),
|
|
492
|
+
error: L,
|
|
493
|
+
newAliases: Object.assign({}, S)
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
}
|
|
@@ -518,13 +518,13 @@ function Fe(i) {
|
|
|
518
518
|
h !== void 0 && typeof h == "string" && (u[h] = r);
|
|
519
519
|
}), u;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function X(i) {
|
|
522
522
|
return i !== void 0 ? i + 1 : 1;
|
|
523
523
|
}
|
|
524
524
|
function pe(i) {
|
|
525
525
|
return i === "__proto__" ? "___proto___" : i;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function Ve(i) {
|
|
528
528
|
return typeof i == "string" && (i[0] === "'" || i[0] === '"') && i[i.length - 1] === i[0] ? i.substring(1, i.length - 1) : i;
|
|
529
529
|
}
|
|
530
530
|
/**
|
|
@@ -535,17 +535,17 @@ function je(i) {
|
|
|
535
535
|
* Copyright (c) 2016, Contributors
|
|
536
536
|
* SPDX-License-Identifier: ISC
|
|
537
537
|
*/
|
|
538
|
-
var
|
|
539
|
-
const le = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, de = (
|
|
538
|
+
var ee, te, ae;
|
|
539
|
+
const le = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, de = (te = (ee = process == null ? void 0 : process.versions) === null || ee === void 0 ? void 0 : ee.node) !== null && te !== void 0 ? te : (ae = process == null ? void 0 : process.version) === null || ae === void 0 ? void 0 : ae.slice(1);
|
|
540
540
|
if (de && Number(de.match(/^([^.]+)/)[1]) < le)
|
|
541
541
|
throw Error(`yargs parser supports a minimum Node.js version of ${le}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
|
|
542
|
-
const
|
|
542
|
+
const je = process ? process.env : {};
|
|
543
543
|
new De({
|
|
544
544
|
cwd: process.cwd,
|
|
545
|
-
env: () =>
|
|
545
|
+
env: () => je,
|
|
546
546
|
format: ke,
|
|
547
547
|
normalize: Pe,
|
|
548
|
-
resolve:
|
|
548
|
+
resolve: oe,
|
|
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
551
|
require: (i) => {
|
|
@@ -562,7 +562,7 @@ const Ke = {
|
|
|
562
562
|
writeFile: Qe
|
|
563
563
|
},
|
|
564
564
|
format: ke,
|
|
565
|
-
resolve:
|
|
565
|
+
resolve: oe,
|
|
566
566
|
exists: (i) => {
|
|
567
567
|
try {
|
|
568
568
|
return Te(i).isFile();
|
|
@@ -671,18 +671,18 @@ function $e(i, o) {
|
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
673
|
const We = (i) => $e(i, Ke);
|
|
674
|
-
let
|
|
674
|
+
let D;
|
|
675
675
|
try {
|
|
676
|
-
|
|
676
|
+
D = Se(import.meta.url);
|
|
677
677
|
} catch {
|
|
678
|
-
|
|
678
|
+
D = process.cwd();
|
|
679
679
|
}
|
|
680
|
-
const Ue =
|
|
680
|
+
const Ue = D.substring(0, D.lastIndexOf("node_modules"));
|
|
681
681
|
Ue || process.cwd(), process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, We({
|
|
682
|
-
directory:
|
|
682
|
+
directory: oe(D, "../../../locales"),
|
|
683
683
|
updateFiles: !1
|
|
684
684
|
});
|
|
685
|
-
const
|
|
685
|
+
const ne = [
|
|
686
686
|
{
|
|
687
687
|
id: "anthropic",
|
|
688
688
|
name: "Anthropic",
|
|
@@ -1076,6 +1076,35 @@ const oe = [
|
|
|
1076
1076
|
}
|
|
1077
1077
|
]
|
|
1078
1078
|
},
|
|
1079
|
+
{
|
|
1080
|
+
id: "claude-opus-4-7",
|
|
1081
|
+
name: "Claude Opus 4.7",
|
|
1082
|
+
description: "Our most capable model for complex reasoning and agentic coding",
|
|
1083
|
+
match: {
|
|
1084
|
+
or: [
|
|
1085
|
+
{
|
|
1086
|
+
starts_with: "claude-opus-4-7"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
starts_with: "claude-opus-4.7"
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
starts_with: "claude-4-7-opus"
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
starts_with: "claude-4.7-opus"
|
|
1096
|
+
}
|
|
1097
|
+
]
|
|
1098
|
+
},
|
|
1099
|
+
context_window: 1e6,
|
|
1100
|
+
price_comments: "Flat pricing across full 1M context window (no tiered pricing). Ref: https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing",
|
|
1101
|
+
prices: {
|
|
1102
|
+
input_mtok: 5,
|
|
1103
|
+
cache_write_mtok: 6.25,
|
|
1104
|
+
cache_read_mtok: 0.5,
|
|
1105
|
+
output_mtok: 25
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1079
1108
|
{
|
|
1080
1109
|
id: "claude-sonnet-4-0",
|
|
1081
1110
|
name: "Claude Sonnet 4",
|
|
@@ -1532,6 +1561,18 @@ const oe = [
|
|
|
1532
1561
|
}
|
|
1533
1562
|
}
|
|
1534
1563
|
},
|
|
1564
|
+
{
|
|
1565
|
+
id: "global.anthropic.claude-opus-4-7-v1:0",
|
|
1566
|
+
match: {
|
|
1567
|
+
contains: "global.anthropic.claude-opus-4-7"
|
|
1568
|
+
},
|
|
1569
|
+
prices: {
|
|
1570
|
+
input_mtok: 5,
|
|
1571
|
+
cache_write_mtok: 6.25,
|
|
1572
|
+
cache_read_mtok: 0.5,
|
|
1573
|
+
output_mtok: 25
|
|
1574
|
+
}
|
|
1575
|
+
},
|
|
1535
1576
|
{
|
|
1536
1577
|
id: "global.anthropic.claude-sonnet-4-20250514-v1:0",
|
|
1537
1578
|
match: {
|
|
@@ -1776,6 +1817,39 @@ const oe = [
|
|
|
1776
1817
|
output_mtok: 6
|
|
1777
1818
|
}
|
|
1778
1819
|
},
|
|
1820
|
+
{
|
|
1821
|
+
id: "nvidia.nemotron-nano-3-30b:0",
|
|
1822
|
+
name: "Nemotron 3 Nano 30B",
|
|
1823
|
+
match: {
|
|
1824
|
+
contains: "nvidia.nemotron-nano-3-30b"
|
|
1825
|
+
},
|
|
1826
|
+
prices: {
|
|
1827
|
+
input_mtok: 0.06,
|
|
1828
|
+
output_mtok: 0.24
|
|
1829
|
+
}
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
id: "nvidia.nemotron-nano-9b-v2:0",
|
|
1833
|
+
name: "Nemotron 2 Nano 9B",
|
|
1834
|
+
match: {
|
|
1835
|
+
contains: "nvidia.nemotron-nano-9b-v2"
|
|
1836
|
+
},
|
|
1837
|
+
prices: {
|
|
1838
|
+
input_mtok: 0.06,
|
|
1839
|
+
output_mtok: 0.23
|
|
1840
|
+
}
|
|
1841
|
+
},
|
|
1842
|
+
{
|
|
1843
|
+
id: "nvidia.nemotron-super-3-120b:0",
|
|
1844
|
+
name: "Nemotron 3 Super 120B",
|
|
1845
|
+
match: {
|
|
1846
|
+
contains: "nvidia.nemotron-super-3-120b"
|
|
1847
|
+
},
|
|
1848
|
+
prices: {
|
|
1849
|
+
input_mtok: 0.15,
|
|
1850
|
+
output_mtok: 0.65
|
|
1851
|
+
}
|
|
1852
|
+
},
|
|
1779
1853
|
{
|
|
1780
1854
|
id: "openai.gpt-oss-120b-1:0",
|
|
1781
1855
|
name: "gpt-oss-120b",
|
|
@@ -2139,6 +2213,43 @@ const oe = [
|
|
|
2139
2213
|
}
|
|
2140
2214
|
}
|
|
2141
2215
|
},
|
|
2216
|
+
{
|
|
2217
|
+
id: "regional.anthropic.claude-opus-4-7-v1:0",
|
|
2218
|
+
match: {
|
|
2219
|
+
or: [
|
|
2220
|
+
{
|
|
2221
|
+
starts_with: "anthropic.claude-opus-4-7"
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
starts_with: "claude-opus-4-7"
|
|
2225
|
+
},
|
|
2226
|
+
{
|
|
2227
|
+
contains: "us.anthropic.claude-opus-4-7"
|
|
2228
|
+
},
|
|
2229
|
+
{
|
|
2230
|
+
contains: "au.anthropic.claude-opus-4-7"
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
contains: "apac.anthropic.claude-opus-4-7"
|
|
2234
|
+
},
|
|
2235
|
+
{
|
|
2236
|
+
contains: "eu.anthropic.claude-opus-4-7"
|
|
2237
|
+
},
|
|
2238
|
+
{
|
|
2239
|
+
contains: "us-gov.anthropic.claude-opus-4-7"
|
|
2240
|
+
},
|
|
2241
|
+
{
|
|
2242
|
+
contains: "jp.anthropic.claude-opus-4-7"
|
|
2243
|
+
}
|
|
2244
|
+
]
|
|
2245
|
+
},
|
|
2246
|
+
prices: {
|
|
2247
|
+
input_mtok: 5.5,
|
|
2248
|
+
cache_write_mtok: 6.875,
|
|
2249
|
+
cache_read_mtok: 0.55,
|
|
2250
|
+
output_mtok: 27.5
|
|
2251
|
+
}
|
|
2252
|
+
},
|
|
2142
2253
|
{
|
|
2143
2254
|
id: "regional.anthropic.claude-sonnet-4-20250514-v1:0",
|
|
2144
2255
|
match: {
|
|
@@ -3095,6 +3206,43 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3095
3206
|
}
|
|
3096
3207
|
}
|
|
3097
3208
|
]
|
|
3209
|
+
},
|
|
3210
|
+
{
|
|
3211
|
+
id: "deepseek-v4-flash",
|
|
3212
|
+
name: "DeepSeek V4 Flash",
|
|
3213
|
+
description: "DeepSeek-V4-Flash. Supports both non-thinking and thinking (default) modes, JSON output, tool calls, chat prefix completion, and FIM completion (non-thinking only).",
|
|
3214
|
+
match: {
|
|
3215
|
+
or: [
|
|
3216
|
+
{
|
|
3217
|
+
starts_with: "deepseek-v4-flash"
|
|
3218
|
+
}
|
|
3219
|
+
]
|
|
3220
|
+
},
|
|
3221
|
+
context_window: 1e6,
|
|
3222
|
+
prices: {
|
|
3223
|
+
input_mtok: 0.14,
|
|
3224
|
+
cache_read_mtok: 28e-4,
|
|
3225
|
+
output_mtok: 0.28
|
|
3226
|
+
}
|
|
3227
|
+
},
|
|
3228
|
+
{
|
|
3229
|
+
id: "deepseek-v4-pro",
|
|
3230
|
+
name: "DeepSeek V4 Pro",
|
|
3231
|
+
description: "DeepSeek-V4-Pro. Supports both non-thinking and thinking (default) modes, JSON output, tool calls, chat prefix completion, and FIM completion (non-thinking only).",
|
|
3232
|
+
match: {
|
|
3233
|
+
or: [
|
|
3234
|
+
{
|
|
3235
|
+
starts_with: "deepseek-v4-pro"
|
|
3236
|
+
}
|
|
3237
|
+
]
|
|
3238
|
+
},
|
|
3239
|
+
context_window: 1e6,
|
|
3240
|
+
price_comments: "Standard (non-promotional) pricing. DeepSeek is offering a temporary 75% promotional discount that is not reflected here.",
|
|
3241
|
+
prices: {
|
|
3242
|
+
input_mtok: 1.74,
|
|
3243
|
+
cache_read_mtok: 0.0145,
|
|
3244
|
+
output_mtok: 3.48
|
|
3245
|
+
}
|
|
3098
3246
|
}
|
|
3099
3247
|
]
|
|
3100
3248
|
},
|
|
@@ -3408,7 +3556,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3408
3556
|
},
|
|
3409
3557
|
{
|
|
3410
3558
|
path: "toolUsePromptTokenCount",
|
|
3411
|
-
dest: "
|
|
3559
|
+
dest: "input_tokens",
|
|
3412
3560
|
required: !1
|
|
3413
3561
|
}
|
|
3414
3562
|
]
|
|
@@ -3656,6 +3804,33 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3656
3804
|
}
|
|
3657
3805
|
}
|
|
3658
3806
|
},
|
|
3807
|
+
{
|
|
3808
|
+
id: "claude-opus-4-7",
|
|
3809
|
+
match: {
|
|
3810
|
+
or: [
|
|
3811
|
+
{
|
|
3812
|
+
contains: "claude-4-7-opus"
|
|
3813
|
+
},
|
|
3814
|
+
{
|
|
3815
|
+
contains: "claude-opus-4-7"
|
|
3816
|
+
},
|
|
3817
|
+
{
|
|
3818
|
+
contains: "claude-4.7-opus"
|
|
3819
|
+
},
|
|
3820
|
+
{
|
|
3821
|
+
contains: "claude-opus-4.7"
|
|
3822
|
+
}
|
|
3823
|
+
]
|
|
3824
|
+
},
|
|
3825
|
+
context_window: 1e6,
|
|
3826
|
+
price_comments: "Flat pricing across full 1M context window. Ref: https://cloud.google.com/vertex-ai/generative-ai/pricing#claude-models",
|
|
3827
|
+
prices: {
|
|
3828
|
+
input_mtok: 5,
|
|
3829
|
+
cache_write_mtok: 6.25,
|
|
3830
|
+
cache_read_mtok: 0.5,
|
|
3831
|
+
output_mtok: 25
|
|
3832
|
+
}
|
|
3833
|
+
},
|
|
3659
3834
|
{
|
|
3660
3835
|
id: "gemini-1.0-pro-vision-001",
|
|
3661
3836
|
name: "gemini 1.0 pro vision",
|
|
@@ -3763,17 +3938,10 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3763
3938
|
context_window: 1e6,
|
|
3764
3939
|
prices: {
|
|
3765
3940
|
input_mtok: 0.1,
|
|
3766
|
-
cache_read_mtok:
|
|
3767
|
-
base: 0.025,
|
|
3768
|
-
tiers: [
|
|
3769
|
-
{
|
|
3770
|
-
start: 1e6,
|
|
3771
|
-
price: 0.175
|
|
3772
|
-
}
|
|
3773
|
-
]
|
|
3774
|
-
},
|
|
3941
|
+
cache_read_mtok: 0.025,
|
|
3775
3942
|
output_mtok: 0.4,
|
|
3776
|
-
input_audio_mtok: 0.7
|
|
3943
|
+
input_audio_mtok: 0.7,
|
|
3944
|
+
cache_audio_read_mtok: 0.175
|
|
3777
3945
|
}
|
|
3778
3946
|
},
|
|
3779
3947
|
{
|
|
@@ -4030,14 +4198,14 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4030
4198
|
}
|
|
4031
4199
|
},
|
|
4032
4200
|
{
|
|
4033
|
-
id: "gemini-3.1-flash-lite
|
|
4034
|
-
name: "Gemini 3.1 Flash Lite
|
|
4201
|
+
id: "gemini-3.1-flash-lite",
|
|
4202
|
+
name: "Gemini 3.1 Flash Lite",
|
|
4035
4203
|
description: "Google's fastest and most cost-efficient Gemini 3 series model, built for intelligence at scale. Optimized for high-volume, low-latency applications while maintaining strong multimodal capabilities.",
|
|
4036
4204
|
match: {
|
|
4037
|
-
starts_with: "gemini-3.1-flash-lite
|
|
4205
|
+
starts_with: "gemini-3.1-flash-lite"
|
|
4038
4206
|
},
|
|
4039
4207
|
context_window: 1e6,
|
|
4040
|
-
price_comments: "See https://ai.google.dev/gemini-api/docs/pricing.
|
|
4208
|
+
price_comments: "See https://ai.google.dev/gemini-api/docs/pricing.",
|
|
4041
4209
|
prices: {
|
|
4042
4210
|
input_mtok: 0.25,
|
|
4043
4211
|
cache_read_mtok: 0.025,
|
|
@@ -10027,6 +10195,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
10027
10195
|
},
|
|
10028
10196
|
context_window: 128e3,
|
|
10029
10197
|
prices: {
|
|
10198
|
+
input_mtok: 2.5,
|
|
10030
10199
|
output_mtok: 10,
|
|
10031
10200
|
input_audio_mtok: 2.5
|
|
10032
10201
|
}
|
|
@@ -10077,6 +10246,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
10077
10246
|
starts_with: "gpt-4o-mini-audio"
|
|
10078
10247
|
},
|
|
10079
10248
|
prices: {
|
|
10249
|
+
input_mtok: 0.15,
|
|
10080
10250
|
output_mtok: 0.6,
|
|
10081
10251
|
input_audio_mtok: 0.15
|
|
10082
10252
|
}
|
|
@@ -10113,6 +10283,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
10113
10283
|
},
|
|
10114
10284
|
prices: {
|
|
10115
10285
|
input_mtok: 0.6,
|
|
10286
|
+
output_mtok: 12,
|
|
10116
10287
|
output_audio_mtok: 12
|
|
10117
10288
|
}
|
|
10118
10289
|
},
|
|
@@ -10437,6 +10608,39 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
10437
10608
|
output_mtok: 168
|
|
10438
10609
|
}
|
|
10439
10610
|
},
|
|
10611
|
+
{
|
|
10612
|
+
id: "gpt-5.3",
|
|
10613
|
+
name: "GPT-5.3 Chat",
|
|
10614
|
+
description: "GPT-5.3 Instant model used in ChatGPT",
|
|
10615
|
+
match: {
|
|
10616
|
+
or: [
|
|
10617
|
+
{
|
|
10618
|
+
equals: "gpt-5.3"
|
|
10619
|
+
},
|
|
10620
|
+
{
|
|
10621
|
+
equals: "gpt-5-3"
|
|
10622
|
+
},
|
|
10623
|
+
{
|
|
10624
|
+
equals: "gpt-5.3-chat"
|
|
10625
|
+
},
|
|
10626
|
+
{
|
|
10627
|
+
equals: "gpt-5.3-chat-latest"
|
|
10628
|
+
},
|
|
10629
|
+
{
|
|
10630
|
+
equals: "gpt-5-3-chat"
|
|
10631
|
+
},
|
|
10632
|
+
{
|
|
10633
|
+
equals: "gpt-5-3-chat-latest"
|
|
10634
|
+
}
|
|
10635
|
+
]
|
|
10636
|
+
},
|
|
10637
|
+
context_window: 128e3,
|
|
10638
|
+
prices: {
|
|
10639
|
+
input_mtok: 1.75,
|
|
10640
|
+
cache_read_mtok: 0.175,
|
|
10641
|
+
output_mtok: 14
|
|
10642
|
+
}
|
|
10643
|
+
},
|
|
10440
10644
|
{
|
|
10441
10645
|
id: "gpt-5.3-codex",
|
|
10442
10646
|
name: "GPT-5.3-Codex",
|
|
@@ -10605,6 +10809,77 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
10605
10809
|
}
|
|
10606
10810
|
}
|
|
10607
10811
|
},
|
|
10812
|
+
{
|
|
10813
|
+
id: "gpt-5.5",
|
|
10814
|
+
name: "GPT-5.5",
|
|
10815
|
+
description: "The best model for coding and agentic tasks across industries",
|
|
10816
|
+
match: {
|
|
10817
|
+
or: [
|
|
10818
|
+
{
|
|
10819
|
+
equals: "gpt-5.5"
|
|
10820
|
+
},
|
|
10821
|
+
{
|
|
10822
|
+
equals: "gpt-5.5-2026-04-23"
|
|
10823
|
+
},
|
|
10824
|
+
{
|
|
10825
|
+
equals: "gpt-5-5"
|
|
10826
|
+
},
|
|
10827
|
+
{
|
|
10828
|
+
equals: "gpt-5-5-2026-04-23"
|
|
10829
|
+
},
|
|
10830
|
+
{
|
|
10831
|
+
equals: "gpt-5.5-chat"
|
|
10832
|
+
},
|
|
10833
|
+
{
|
|
10834
|
+
equals: "gpt-5.5-chat-latest"
|
|
10835
|
+
},
|
|
10836
|
+
{
|
|
10837
|
+
equals: "gpt-5-5-chat"
|
|
10838
|
+
},
|
|
10839
|
+
{
|
|
10840
|
+
equals: "gpt-5-5-chat-latest"
|
|
10841
|
+
},
|
|
10842
|
+
{
|
|
10843
|
+
equals: "gpt-5.5-codex"
|
|
10844
|
+
},
|
|
10845
|
+
{
|
|
10846
|
+
equals: "gpt-5-5-codex"
|
|
10847
|
+
}
|
|
10848
|
+
]
|
|
10849
|
+
},
|
|
10850
|
+
context_window: 1e6,
|
|
10851
|
+
prices: {
|
|
10852
|
+
input_mtok: 5,
|
|
10853
|
+
cache_read_mtok: 0.5,
|
|
10854
|
+
output_mtok: 30
|
|
10855
|
+
}
|
|
10856
|
+
},
|
|
10857
|
+
{
|
|
10858
|
+
id: "gpt-5.5-pro",
|
|
10859
|
+
name: "GPT-5.5 Pro",
|
|
10860
|
+
description: "Version of GPT-5.5 that produces smarter and more precise responses.",
|
|
10861
|
+
match: {
|
|
10862
|
+
or: [
|
|
10863
|
+
{
|
|
10864
|
+
equals: "gpt-5.5-pro"
|
|
10865
|
+
},
|
|
10866
|
+
{
|
|
10867
|
+
equals: "gpt-5.5-pro-2026-04-23"
|
|
10868
|
+
},
|
|
10869
|
+
{
|
|
10870
|
+
equals: "gpt-5-5-pro"
|
|
10871
|
+
},
|
|
10872
|
+
{
|
|
10873
|
+
equals: "gpt-5-5-pro-2026-04-23"
|
|
10874
|
+
}
|
|
10875
|
+
]
|
|
10876
|
+
},
|
|
10877
|
+
context_window: 1e6,
|
|
10878
|
+
prices: {
|
|
10879
|
+
input_mtok: 30,
|
|
10880
|
+
output_mtok: 180
|
|
10881
|
+
}
|
|
10882
|
+
},
|
|
10608
10883
|
{
|
|
10609
10884
|
id: "gpt-realtime",
|
|
10610
10885
|
match: {
|
|
@@ -10926,6 +11201,45 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
10926
11201
|
name: "OpenRouter",
|
|
10927
11202
|
pricing_urls: ["https://openrouter.ai/models"],
|
|
10928
11203
|
api_pattern: "https://(api\\.)?openrouter\\.ai",
|
|
11204
|
+
extractors: [
|
|
11205
|
+
{
|
|
11206
|
+
api_flavor: "chat",
|
|
11207
|
+
root: "usage",
|
|
11208
|
+
model_path: "model",
|
|
11209
|
+
mappings: [
|
|
11210
|
+
{
|
|
11211
|
+
path: "prompt_tokens",
|
|
11212
|
+
dest: "input_tokens",
|
|
11213
|
+
required: !0
|
|
11214
|
+
},
|
|
11215
|
+
{
|
|
11216
|
+
path: ["prompt_tokens_details", "cached_tokens"],
|
|
11217
|
+
dest: "cache_read_tokens",
|
|
11218
|
+
required: !1
|
|
11219
|
+
},
|
|
11220
|
+
{
|
|
11221
|
+
path: ["prompt_tokens_details", "cache_write_tokens"],
|
|
11222
|
+
dest: "cache_write_tokens",
|
|
11223
|
+
required: !1
|
|
11224
|
+
},
|
|
11225
|
+
{
|
|
11226
|
+
path: ["prompt_tokens_details", "audio_tokens"],
|
|
11227
|
+
dest: "input_audio_tokens",
|
|
11228
|
+
required: !1
|
|
11229
|
+
},
|
|
11230
|
+
{
|
|
11231
|
+
path: ["completion_tokens_details", "audio_tokens"],
|
|
11232
|
+
dest: "output_audio_tokens",
|
|
11233
|
+
required: !1
|
|
11234
|
+
},
|
|
11235
|
+
{
|
|
11236
|
+
path: "completion_tokens",
|
|
11237
|
+
dest: "output_tokens",
|
|
11238
|
+
required: !0
|
|
11239
|
+
}
|
|
11240
|
+
]
|
|
11241
|
+
}
|
|
11242
|
+
],
|
|
10929
11243
|
models: [
|
|
10930
11244
|
{
|
|
10931
11245
|
id: "01-ai/yi-large",
|
|
@@ -11317,6 +11631,18 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
11317
11631
|
{
|
|
11318
11632
|
equals: "anthropic/claude-haiku-4.5"
|
|
11319
11633
|
},
|
|
11634
|
+
{
|
|
11635
|
+
equals: "anthropic/claude-4.5-haiku-20251001"
|
|
11636
|
+
},
|
|
11637
|
+
{
|
|
11638
|
+
equals: "anthropic/claude-4.5-haiku-20251001:beta"
|
|
11639
|
+
},
|
|
11640
|
+
{
|
|
11641
|
+
equals: "anthropic/claude-haiku-4.5-20251001"
|
|
11642
|
+
},
|
|
11643
|
+
{
|
|
11644
|
+
equals: "anthropic/claude-haiku-4.5-20251001:beta"
|
|
11645
|
+
},
|
|
11320
11646
|
{
|
|
11321
11647
|
equals: "anthropic/claude-haiku-4.5:beta"
|
|
11322
11648
|
}
|
|
@@ -11336,6 +11662,18 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
11336
11662
|
{
|
|
11337
11663
|
equals: "anthropic/claude-opus-4.5"
|
|
11338
11664
|
},
|
|
11665
|
+
{
|
|
11666
|
+
equals: "anthropic/claude-4.5-opus-20251124"
|
|
11667
|
+
},
|
|
11668
|
+
{
|
|
11669
|
+
equals: "anthropic/claude-4.5-opus-20251124:beta"
|
|
11670
|
+
},
|
|
11671
|
+
{
|
|
11672
|
+
equals: "anthropic/claude-opus-4.5-20251124"
|
|
11673
|
+
},
|
|
11674
|
+
{
|
|
11675
|
+
equals: "anthropic/claude-opus-4.5-20251124:beta"
|
|
11676
|
+
},
|
|
11339
11677
|
{
|
|
11340
11678
|
equals: "anthropic/claude-opus-4.5:beta"
|
|
11341
11679
|
}
|
|
@@ -11355,48 +11693,51 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
11355
11693
|
{
|
|
11356
11694
|
equals: "anthropic/claude-opus-4.6"
|
|
11357
11695
|
},
|
|
11696
|
+
{
|
|
11697
|
+
equals: "anthropic/claude-4.6-opus-20260205"
|
|
11698
|
+
},
|
|
11699
|
+
{
|
|
11700
|
+
equals: "anthropic/claude-4.6-opus-20260205:beta"
|
|
11701
|
+
},
|
|
11702
|
+
{
|
|
11703
|
+
equals: "anthropic/claude-opus-4.6-20260205"
|
|
11704
|
+
},
|
|
11705
|
+
{
|
|
11706
|
+
equals: "anthropic/claude-opus-4.6-20260205:beta"
|
|
11707
|
+
},
|
|
11358
11708
|
{
|
|
11359
11709
|
equals: "anthropic/claude-opus-4.6:beta"
|
|
11360
11710
|
}
|
|
11361
11711
|
]
|
|
11362
11712
|
},
|
|
11713
|
+
context_window: 1e6,
|
|
11714
|
+
price_comments: "Flat pricing across full 1M context window (no tiered pricing). Ref: https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing",
|
|
11363
11715
|
prices: {
|
|
11364
|
-
input_mtok:
|
|
11365
|
-
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
]
|
|
11390
|
-
},
|
|
11391
|
-
output_mtok: {
|
|
11392
|
-
base: 25,
|
|
11393
|
-
tiers: [
|
|
11394
|
-
{
|
|
11395
|
-
start: 2e5,
|
|
11396
|
-
price: 37.5
|
|
11397
|
-
}
|
|
11398
|
-
]
|
|
11399
|
-
}
|
|
11716
|
+
input_mtok: 5,
|
|
11717
|
+
cache_write_mtok: 6.25,
|
|
11718
|
+
cache_read_mtok: 0.5,
|
|
11719
|
+
output_mtok: 25
|
|
11720
|
+
}
|
|
11721
|
+
},
|
|
11722
|
+
{
|
|
11723
|
+
id: "anthropic/claude-opus-4.7",
|
|
11724
|
+
match: {
|
|
11725
|
+
or: [
|
|
11726
|
+
{
|
|
11727
|
+
equals: "anthropic/claude-opus-4.7"
|
|
11728
|
+
},
|
|
11729
|
+
{
|
|
11730
|
+
equals: "anthropic/claude-opus-4.7:beta"
|
|
11731
|
+
}
|
|
11732
|
+
]
|
|
11733
|
+
},
|
|
11734
|
+
context_window: 1e6,
|
|
11735
|
+
price_comments: "Flat pricing across full 1M context window (no tiered pricing). Ref: https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing",
|
|
11736
|
+
prices: {
|
|
11737
|
+
input_mtok: 5,
|
|
11738
|
+
cache_write_mtok: 6.25,
|
|
11739
|
+
cache_read_mtok: 0.5,
|
|
11740
|
+
output_mtok: 25
|
|
11400
11741
|
}
|
|
11401
11742
|
},
|
|
11402
11743
|
{
|
|
@@ -11406,12 +11747,25 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
11406
11747
|
{
|
|
11407
11748
|
equals: "anthropic/claude-sonnet-4.5"
|
|
11408
11749
|
},
|
|
11750
|
+
{
|
|
11751
|
+
equals: "anthropic/claude-4.5-sonnet-20250929"
|
|
11752
|
+
},
|
|
11753
|
+
{
|
|
11754
|
+
equals: "anthropic/claude-4.5-sonnet-20250929:beta"
|
|
11755
|
+
},
|
|
11756
|
+
{
|
|
11757
|
+
equals: "anthropic/claude-sonnet-4.5-20250929"
|
|
11758
|
+
},
|
|
11759
|
+
{
|
|
11760
|
+
equals: "anthropic/claude-sonnet-4.5-20250929:beta"
|
|
11761
|
+
},
|
|
11409
11762
|
{
|
|
11410
11763
|
equals: "anthropic/claude-sonnet-4.5:beta"
|
|
11411
11764
|
}
|
|
11412
11765
|
]
|
|
11413
11766
|
},
|
|
11414
11767
|
context_window: 1e6,
|
|
11768
|
+
price_comments: "Tiered pricing: Unlike 4.6 models, Sonnet 4.5 has long-context surcharge. Ref: https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing",
|
|
11415
11769
|
prices: {
|
|
11416
11770
|
input_mtok: {
|
|
11417
11771
|
base: 3,
|
|
@@ -11458,11 +11812,25 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
11458
11812
|
{
|
|
11459
11813
|
equals: "anthropic/claude-sonnet-4.6"
|
|
11460
11814
|
},
|
|
11815
|
+
{
|
|
11816
|
+
equals: "anthropic/claude-4.6-sonnet-20260217"
|
|
11817
|
+
},
|
|
11818
|
+
{
|
|
11819
|
+
equals: "anthropic/claude-4.6-sonnet-20260217:beta"
|
|
11820
|
+
},
|
|
11821
|
+
{
|
|
11822
|
+
equals: "anthropic/claude-sonnet-4.6-20260217"
|
|
11823
|
+
},
|
|
11824
|
+
{
|
|
11825
|
+
equals: "anthropic/claude-sonnet-4.6-20260217:beta"
|
|
11826
|
+
},
|
|
11461
11827
|
{
|
|
11462
11828
|
equals: "anthropic/claude-sonnet-4.6:beta"
|
|
11463
11829
|
}
|
|
11464
11830
|
]
|
|
11465
11831
|
},
|
|
11832
|
+
context_window: 1e6,
|
|
11833
|
+
price_comments: "Flat pricing across full 1M context window (no tiered pricing). Ref: https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing",
|
|
11466
11834
|
prices: {
|
|
11467
11835
|
input_mtok: 3,
|
|
11468
11836
|
cache_write_mtok: 3.75,
|
|
@@ -12361,6 +12729,19 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
12361
12729
|
},
|
|
12362
12730
|
prices: {}
|
|
12363
12731
|
},
|
|
12732
|
+
{
|
|
12733
|
+
id: "deepseek/deepseek-v3.2",
|
|
12734
|
+
name: "DeepSeek V3.2",
|
|
12735
|
+
match: {
|
|
12736
|
+
equals: "deepseek/deepseek-v3.2"
|
|
12737
|
+
},
|
|
12738
|
+
context_window: 131072,
|
|
12739
|
+
prices: {
|
|
12740
|
+
input_mtok: 0.252,
|
|
12741
|
+
cache_read_mtok: 0.0252,
|
|
12742
|
+
output_mtok: 0.378
|
|
12743
|
+
}
|
|
12744
|
+
},
|
|
12364
12745
|
{
|
|
12365
12746
|
id: "deepseek/deepseek-v3.2-exp",
|
|
12366
12747
|
name: "DeepSeek V3.2 Experimental",
|
|
@@ -18885,6 +19266,30 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
18885
19266
|
output_mtok: 0.5
|
|
18886
19267
|
}
|
|
18887
19268
|
},
|
|
19269
|
+
{
|
|
19270
|
+
id: "grok-4.3",
|
|
19271
|
+
name: "Grok 4.3",
|
|
19272
|
+
description: "Most advanced flagship model, leading the industry in non-hallucination rate, agentic tool calling, and instruction following capabilities. Supports text and image inputs with text outputs, function calling, structured outputs, and reasoning.",
|
|
19273
|
+
match: {
|
|
19274
|
+
or: [
|
|
19275
|
+
{
|
|
19276
|
+
equals: "grok-4.3"
|
|
19277
|
+
},
|
|
19278
|
+
{
|
|
19279
|
+
equals: "grok-4.3-latest"
|
|
19280
|
+
},
|
|
19281
|
+
{
|
|
19282
|
+
equals: "grok-latest"
|
|
19283
|
+
}
|
|
19284
|
+
]
|
|
19285
|
+
},
|
|
19286
|
+
context_window: 1e6,
|
|
19287
|
+
prices: {
|
|
19288
|
+
input_mtok: 1.25,
|
|
19289
|
+
cache_read_mtok: 0.2,
|
|
19290
|
+
output_mtok: 2.5
|
|
19291
|
+
}
|
|
19292
|
+
},
|
|
18888
19293
|
{
|
|
18889
19294
|
id: "grok-code-fast-1",
|
|
18890
19295
|
name: "Grok Code Fast 1",
|
|
@@ -18924,26 +19329,27 @@ function z(i, o, u, s) {
|
|
|
18924
19329
|
}
|
|
18925
19330
|
function Je(i, o) {
|
|
18926
19331
|
let u = 0, s = 0;
|
|
18927
|
-
const r = i.input_tokens ?? 0, h = i.cache_read_tokens ?? 0, _ = i.cache_write_tokens ?? 0, k = i.cache_audio_read_tokens ?? 0, q = i.output_audio_tokens ?? 0;
|
|
18928
|
-
let y =
|
|
18929
|
-
if (y
|
|
19332
|
+
const r = i.input_tokens ?? 0, h = i.cache_read_tokens ?? 0, _ = i.cache_write_tokens ?? 0, k = i.cache_audio_read_tokens ?? 0, q = i.input_audio_tokens ?? 0, T = i.output_audio_tokens ?? 0, B = o.cache_audio_read_mtok === void 0 ? 0 : k, Q = o.cache_audio_read_mtok === void 0 && o.cache_read_mtok !== void 0 ? k : 0;
|
|
19333
|
+
let y = 0;
|
|
19334
|
+
if (o.input_audio_mtok !== void 0 && (y = q - B - Q), y < 0)
|
|
18930
19335
|
throw new Error("cache_audio_read_tokens cannot be greater than input_audio_tokens");
|
|
18931
|
-
let
|
|
18932
|
-
if (
|
|
18933
|
-
throw new Error("Uncached text input tokens cannot be negative");
|
|
18934
|
-
let I = h;
|
|
18935
|
-
if (I -= k, I < 0)
|
|
19336
|
+
let S = 0;
|
|
19337
|
+
if (o.cache_read_mtok !== void 0 && (S = h - B), S < 0)
|
|
18936
19338
|
throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
|
|
18937
|
-
|
|
18938
|
-
let
|
|
18939
|
-
if (
|
|
19339
|
+
const O = o.cache_write_mtok === void 0 ? 0 : _;
|
|
19340
|
+
let M = 0;
|
|
19341
|
+
if (o.input_mtok !== void 0 && (M = r - S - O - y - B), M < 0)
|
|
19342
|
+
throw new Error("Uncached text input tokens cannot be negative");
|
|
19343
|
+
u += z(o.input_mtok, M, "input_mtok", r), u += z(o.cache_read_mtok, S, "cache_read_mtok", r), u += z(o.cache_write_mtok, O, "cache_write_mtok", r), u += z(o.input_audio_mtok, y, "input_audio_mtok", r), u += z(o.cache_audio_read_mtok, B, "cache_audio_read_mtok", r);
|
|
19344
|
+
let m = 0;
|
|
19345
|
+
if (o.output_mtok !== void 0 && (m = (i.output_tokens ?? 0) - (o.output_audio_mtok === void 0 ? 0 : T)), m < 0)
|
|
18940
19346
|
throw new Error("output_audio_tokens cannot be greater than output_tokens");
|
|
18941
|
-
s += z(o.output_mtok,
|
|
18942
|
-
let
|
|
18943
|
-
return o.requests_kcount !== void 0 && (
|
|
19347
|
+
s += z(o.output_mtok, m, "output_mtok", r), s += z(o.output_audio_mtok, i.output_audio_tokens, "output_audio_mtok", r);
|
|
19348
|
+
let I = u + s;
|
|
19349
|
+
return o.requests_kcount !== void 0 && (I += o.requests_kcount / 1e3), {
|
|
18944
19350
|
input_price: u,
|
|
18945
19351
|
output_price: s,
|
|
18946
|
-
total_price:
|
|
19352
|
+
total_price: I
|
|
18947
19353
|
};
|
|
18948
19354
|
}
|
|
18949
19355
|
function Ze(i, o) {
|
|
@@ -18967,12 +19373,12 @@ function Ze(i, o) {
|
|
|
18967
19373
|
}
|
|
18968
19374
|
return i.prices[0].prices;
|
|
18969
19375
|
}
|
|
18970
|
-
function
|
|
18971
|
-
return "or" in i ? i.or.some((u) =>
|
|
19376
|
+
function F(i, o) {
|
|
19377
|
+
return "or" in i ? i.or.some((u) => F(u, o)) : "and" in i ? i.and.every((u) => F(u, o)) : "equals" in i ? o === i.equals : "starts_with" in i ? o.startsWith(i.starts_with) : "ends_with" in i ? o.endsWith(i.ends_with) : "contains" in i ? o.includes(i.contains) : "regex" in i ? new RegExp(i.regex).test(o) : !1;
|
|
18972
19378
|
}
|
|
18973
19379
|
function Xe(i, o) {
|
|
18974
19380
|
const u = o.toLowerCase().trim(), s = i.find((r) => r.id === u);
|
|
18975
|
-
return s || i.find((r) => r.provider_match &&
|
|
19381
|
+
return s || i.find((r) => r.provider_match && F(r.provider_match, u));
|
|
18976
19382
|
}
|
|
18977
19383
|
function _e(i, { modelId: o, providerApiUrl: u, providerId: s }) {
|
|
18978
19384
|
if (s) {
|
|
@@ -18983,10 +19389,10 @@ function _e(i, { modelId: o, providerApiUrl: u, providerId: s }) {
|
|
|
18983
19389
|
if (u)
|
|
18984
19390
|
return i.find((r) => new RegExp(r.api_pattern).test(u));
|
|
18985
19391
|
if (o)
|
|
18986
|
-
return i.find((r) => r.model_match &&
|
|
19392
|
+
return i.find((r) => r.model_match && F(r.model_match, o));
|
|
18987
19393
|
}
|
|
18988
19394
|
function et(i, o) {
|
|
18989
|
-
return i.find((u) =>
|
|
19395
|
+
return i.find((u) => F(u.match, o));
|
|
18990
19396
|
}
|
|
18991
19397
|
function qe(i, o, u) {
|
|
18992
19398
|
const s = et(i.models, o);
|
|
@@ -19000,25 +19406,25 @@ function qe(i, o, u) {
|
|
|
19000
19406
|
}
|
|
19001
19407
|
}
|
|
19002
19408
|
}
|
|
19003
|
-
let
|
|
19004
|
-
Promise.resolve(
|
|
19409
|
+
let ie = ne;
|
|
19410
|
+
Promise.resolve(ne);
|
|
19005
19411
|
function tt(i, o, u) {
|
|
19006
19412
|
let s = o.toLowerCase().trim(), r = u?.providerId;
|
|
19007
19413
|
if (r && r.toLowerCase() === "litellm" && s.includes("/")) {
|
|
19008
|
-
const B = s.indexOf("/"),
|
|
19009
|
-
|
|
19414
|
+
const B = s.indexOf("/"), Q = s.slice(0, B), y = s.slice(B + 1);
|
|
19415
|
+
Q && y && _e(ie, { providerId: Q }) && (r = Q, s = y);
|
|
19010
19416
|
}
|
|
19011
|
-
const h = u?.provider ?? _e(
|
|
19417
|
+
const h = u?.provider ?? _e(ie, { modelId: s, providerApiUrl: u?.providerApiUrl, providerId: r });
|
|
19012
19418
|
if (!h) return null;
|
|
19013
|
-
const _ = qe(h, s,
|
|
19419
|
+
const _ = qe(h, s, ie);
|
|
19014
19420
|
if (!_) return null;
|
|
19015
|
-
const k = u?.timestamp ?? /* @__PURE__ */ new Date(), q = Ze(_, k),
|
|
19421
|
+
const k = u?.timestamp ?? /* @__PURE__ */ new Date(), q = Ze(_, k), T = Je(i, q);
|
|
19016
19422
|
return {
|
|
19017
19423
|
auto_update_timestamp: void 0,
|
|
19018
19424
|
model: _,
|
|
19019
19425
|
model_price: q,
|
|
19020
19426
|
provider: h,
|
|
19021
|
-
...
|
|
19427
|
+
...T
|
|
19022
19428
|
};
|
|
19023
19429
|
}
|
|
19024
19430
|
const f = he(Re(process.argv)).scriptName("genai-prices").command(
|
|
@@ -19032,7 +19438,7 @@ const f = he(Re(process.argv)).scriptName("genai-prices").command(
|
|
|
19032
19438
|
).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();
|
|
19033
19439
|
function at() {
|
|
19034
19440
|
if (f._[0] === "list") {
|
|
19035
|
-
const u =
|
|
19441
|
+
const u = ne;
|
|
19036
19442
|
if (f.provider) {
|
|
19037
19443
|
const s = u.find((r) => r.id === f.provider);
|
|
19038
19444
|
s || (console.error(`Provider ${f.provider} not found.`), process.exit(1)), console.log(`${s.name}: (${s.models.length} models)`);
|
|
@@ -19068,17 +19474,17 @@ function at() {
|
|
|
19068
19474
|
r = !0, console.error(`No price found for model ${h}`);
|
|
19069
19475
|
continue;
|
|
19070
19476
|
}
|
|
19071
|
-
const
|
|
19477
|
+
const T = q.model.context_window, B = [
|
|
19072
19478
|
["Provider", q.provider.name],
|
|
19073
19479
|
["Model", q.model.name ?? q.model.id],
|
|
19074
19480
|
["Model Prices", JSON.stringify(q.model_price)],
|
|
19075
|
-
["Context Window",
|
|
19481
|
+
["Context Window", T !== void 0 ? T.toLocaleString() : void 0],
|
|
19076
19482
|
["Total Price", `$${q.total_price}`],
|
|
19077
19483
|
["Input Price", `$${q.input_price}`],
|
|
19078
19484
|
["Output Price", `$${q.output_price}`]
|
|
19079
19485
|
];
|
|
19080
|
-
for (const [
|
|
19081
|
-
|
|
19486
|
+
for (const [Q, y] of B)
|
|
19487
|
+
y !== void 0 && console.log(`${Q.padStart(14)}: ${y}`);
|
|
19082
19488
|
console.log("");
|
|
19083
19489
|
} catch (q) {
|
|
19084
19490
|
r = !0, q instanceof Error && console.error(`Error for model ${h}:`, q.message);
|