@pydantic/genai-prices 0.0.44 → 0.0.45

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 CHANGED
@@ -1,51 +1,51 @@
1
1
  #!/usr/bin/env node
2
2
  import dt from "yargs";
3
- import { format as ht } from "util";
4
- import { resolve as at, normalize as It } from "path";
5
- import { readFileSync as _t, writeFile as Lt, statSync as Pt } from "fs";
3
+ import { format as _t } from "util";
4
+ import { resolve as at, normalize as yt } from "path";
5
+ import { readFileSync as ht, writeFile as Qt, statSync as Mt } from "fs";
6
6
  import "assert";
7
- import { fileURLToPath as Tt } from "url";
8
- function At() {
9
- return St() ? 0 : 1;
10
- }
7
+ import { fileURLToPath as At } from "url";
11
8
  function St() {
12
- return Gt() && !process.defaultApp;
9
+ return Pt() ? 0 : 1;
10
+ }
11
+ function Pt() {
12
+ return Tt() && !process.defaultApp;
13
13
  }
14
- function Gt() {
14
+ function Tt() {
15
15
  return !!process.versions.electron;
16
16
  }
17
- function Ct(i) {
18
- return i.slice(At() + 1);
17
+ function Rt(i) {
18
+ return i.slice(St() + 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(i) {
25
+ function $(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
  {
29
- let m = "", n = !1;
29
+ let m = "", s = !1;
30
30
  const u = i.match(/^-+/);
31
31
  for (let k = u ? u[0].length : 0; k < i.length; k++) {
32
- let _ = i.charAt(k);
33
- n && (n = !1, _ = _.toUpperCase()), k !== 0 && (_ === "-" || _ === "_") ? n = !0 : _ !== "-" && _ !== "_" && (m += _);
32
+ let h = i.charAt(k);
33
+ s && (s = !1, h = h.toUpperCase()), k !== 0 && (h === "-" || h === "_") ? s = !0 : h !== "-" && h !== "_" && (m += h);
34
34
  }
35
35
  return m;
36
36
  }
37
37
  }
38
- function Ot(i, s) {
38
+ function Gt(i, n) {
39
39
  const m = i.toLowerCase();
40
- s = s || "-";
41
- let n = "";
40
+ n = n || "-";
41
+ let s = "";
42
42
  for (let u = 0; u < i.length; u++) {
43
- const k = m.charAt(u), _ = i.charAt(u);
44
- k !== _ && u > 0 ? n += `${s}${m.charAt(u)}` : n += _;
43
+ const k = m.charAt(u), h = i.charAt(u);
44
+ k !== h && u > 0 ? s += `${n}${m.charAt(u)}` : s += h;
45
45
  }
46
- return n;
46
+ return s;
47
47
  }
48
- function Rt(i) {
48
+ function Dt(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,18 +53,18 @@ function Rt(i) {
53
53
  * Copyright (c) 2016, Contributors
54
54
  * SPDX-License-Identifier: ISC
55
55
  */
56
- function Et(i) {
56
+ function Ct(i) {
57
57
  if (Array.isArray(i))
58
- return i.map((_) => typeof _ != "string" ? _ + "" : _);
58
+ return i.map((h) => typeof h != "string" ? h + "" : h);
59
59
  i = i.trim();
60
- let s = 0, m = null, n = null, u = null;
60
+ let n = 0, m = null, s = null, u = null;
61
61
  const k = [];
62
- for (let _ = 0; _ < i.length; _++) {
63
- if (m = n, n = i.charAt(_), n === " " && !u) {
64
- m !== " " && s++;
62
+ for (let h = 0; h < i.length; h++) {
63
+ if (m = s, s = i.charAt(h), s === " " && !u) {
64
+ m !== " " && n++;
65
65
  continue;
66
66
  }
67
- n === u ? u = null : (n === "'" || n === '"') && !u && (u = n), k[s] || (k[s] = ""), k[s] += n;
67
+ s === u ? u = null : (s === "'" || s === '"') && !u && (u = s), k[n] || (k[n] = ""), k[n] += s;
68
68
  }
69
69
  return k;
70
70
  }
@@ -73,22 +73,22 @@ function Et(i) {
73
73
  * Copyright (c) 2016, Contributors
74
74
  * SPDX-License-Identifier: ISC
75
75
  */
76
- var I;
76
+ var y;
77
77
  (function(i) {
78
78
  i.BOOLEAN = "boolean", i.STRING = "string", i.NUMBER = "number", i.ARRAY = "array";
79
- })(I || (I = {}));
79
+ })(y || (y = {}));
80
80
  /**
81
81
  * @license
82
82
  * Copyright (c) 2016, Contributors
83
83
  * SPDX-License-Identifier: ISC
84
84
  */
85
- let A;
86
- class Nt {
87
- constructor(s) {
88
- A = s;
85
+ let S;
86
+ class Et {
87
+ constructor(n) {
88
+ S = n;
89
89
  }
90
- parse(s, m) {
91
- const n = Object.assign({
90
+ parse(n, m) {
91
+ const s = Object.assign({
92
92
  alias: void 0,
93
93
  array: void 0,
94
94
  boolean: void 0,
@@ -105,7 +105,7 @@ class Nt {
105
105
  number: void 0,
106
106
  __: void 0,
107
107
  key: void 0
108
- }, m), u = Et(s), k = typeof s == "string", _ = zt(Object.assign(/* @__PURE__ */ Object.create(null), n.alias)), h = Object.assign({
108
+ }, m), u = Ct(n), k = typeof n == "string", h = Nt(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), _ = Object.assign({
109
109
  "boolean-negation": !0,
110
110
  "camel-case-expansion": !0,
111
111
  "combine-arrays": !1,
@@ -124,7 +124,7 @@ class Nt {
124
124
  "strip-aliased": !1,
125
125
  "strip-dashed": !1,
126
126
  "unknown-options-as-args": !1
127
- }, n.configuration), f = Object.assign(/* @__PURE__ */ Object.create(null), n.default), y = n.configObjects || [], P = n.envPrefix, S = h["populate--"], G = S ? "--" : "_", Q = /* @__PURE__ */ Object.create(null), ot = /* @__PURE__ */ Object.create(null), C = n.__ || A.format, r = {
127
+ }, s.configuration), f = Object.assign(/* @__PURE__ */ Object.create(null), s.default), x = s.configObjects || [], M = s.envPrefix, P = _["populate--"], T = P ? "--" : "_", z = /* @__PURE__ */ Object.create(null), ot = /* @__PURE__ */ Object.create(null), R = s.__ || S.format, r = {
128
128
  aliases: /* @__PURE__ */ Object.create(null),
129
129
  arrays: /* @__PURE__ */ Object.create(null),
130
130
  bools: /* @__PURE__ */ Object.create(null),
@@ -136,8 +136,8 @@ class Nt {
136
136
  nargs: /* @__PURE__ */ Object.create(null),
137
137
  coercions: /* @__PURE__ */ Object.create(null),
138
138
  keys: []
139
- }, L = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, U = new RegExp("^--" + h["negation-prefix"] + "(.+)");
140
- [].concat(n.array || []).filter(Boolean).forEach(function(t) {
139
+ }, Q = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, W = new RegExp("^--" + _["negation-prefix"] + "(.+)");
140
+ [].concat(s.array || []).filter(Boolean).forEach(function(t) {
141
141
  const a = typeof t == "object" ? t.key : t, c = Object.keys(t).map(function(o) {
142
142
  return {
143
143
  boolean: "bools",
@@ -146,170 +146,170 @@ class Nt {
146
146
  }[o];
147
147
  }).filter(Boolean).pop();
148
148
  c && (r[c][a] = !0), r.arrays[a] = !0, r.keys.push(a);
149
- }), [].concat(n.boolean || []).filter(Boolean).forEach(function(t) {
149
+ }), [].concat(s.boolean || []).filter(Boolean).forEach(function(t) {
150
150
  r.bools[t] = !0, r.keys.push(t);
151
- }), [].concat(n.string || []).filter(Boolean).forEach(function(t) {
151
+ }), [].concat(s.string || []).filter(Boolean).forEach(function(t) {
152
152
  r.strings[t] = !0, r.keys.push(t);
153
- }), [].concat(n.number || []).filter(Boolean).forEach(function(t) {
153
+ }), [].concat(s.number || []).filter(Boolean).forEach(function(t) {
154
154
  r.numbers[t] = !0, r.keys.push(t);
155
- }), [].concat(n.count || []).filter(Boolean).forEach(function(t) {
155
+ }), [].concat(s.count || []).filter(Boolean).forEach(function(t) {
156
156
  r.counts[t] = !0, r.keys.push(t);
157
- }), [].concat(n.normalize || []).filter(Boolean).forEach(function(t) {
157
+ }), [].concat(s.normalize || []).filter(Boolean).forEach(function(t) {
158
158
  r.normalize[t] = !0, r.keys.push(t);
159
- }), typeof n.narg == "object" && Object.entries(n.narg).forEach(([t, a]) => {
159
+ }), typeof s.narg == "object" && Object.entries(s.narg).forEach(([t, a]) => {
160
160
  typeof a == "number" && (r.nargs[t] = a, r.keys.push(t));
161
- }), typeof n.coerce == "object" && Object.entries(n.coerce).forEach(([t, a]) => {
161
+ }), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([t, a]) => {
162
162
  typeof a == "function" && (r.coercions[t] = a, r.keys.push(t));
163
- }), typeof n.config < "u" && (Array.isArray(n.config) || typeof n.config == "string" ? [].concat(n.config).filter(Boolean).forEach(function(t) {
163
+ }), typeof s.config < "u" && (Array.isArray(s.config) || typeof s.config == "string" ? [].concat(s.config).filter(Boolean).forEach(function(t) {
164
164
  r.configs[t] = !0;
165
- }) : typeof n.config == "object" && Object.entries(n.config).forEach(([t, a]) => {
165
+ }) : typeof s.config == "object" && Object.entries(s.config).forEach(([t, a]) => {
166
166
  (typeof a == "boolean" || typeof a == "function") && (r.configs[t] = a);
167
- })), qt(n.key, _, n.default, r.arrays), Object.keys(f).forEach(function(t) {
167
+ })), qt(s.key, h, s.default, r.arrays), Object.keys(f).forEach(function(t) {
168
168
  (r.aliases[t] || []).forEach(function(a) {
169
169
  f[a] = f[t];
170
170
  });
171
171
  });
172
- let B = null;
173
- Mt();
174
- let F = [];
175
- const w = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), st = {};
172
+ let I = null;
173
+ Lt();
174
+ let V = [];
175
+ const b = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), nt = {};
176
176
  for (let t = 0; t < u.length; t++) {
177
177
  const a = u[t], c = a.replace(/^-{3,}/, "---");
178
- let o, e, p, l, d, v;
178
+ let o, e, l, p, d, v;
179
179
  if (a !== "--" && /^-/.test(a) && H(a))
180
- K(a);
180
+ U(a);
181
181
  else if (c.match(/^---+(=|$)/)) {
182
- K(a);
182
+ U(a);
183
183
  continue;
184
- } else if (a.match(/^--.+=/) || !h["short-option-groups"] && a.match(/^-.+=/))
185
- l = a.match(/^--?([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && (g(l[1], r.arrays) ? t = V(t, l[1], u, l[2]) : g(l[1], r.nargs) !== !1 ? t = D(t, l[1], u, l[2]) : q(l[1], l[2], !0));
186
- else if (a.match(U) && h["boolean-negation"])
187
- l = a.match(U), l !== null && Array.isArray(l) && l.length >= 2 && (e = l[1], q(e, g(e, r.arrays) ? [!1] : !1));
188
- else if (a.match(/^--.+/) || !h["short-option-groups"] && a.match(/^-[^-]+/))
189
- l = a.match(/^--?(.+)/), l !== null && Array.isArray(l) && l.length >= 2 && (e = l[1], g(e, r.arrays) ? t = V(t, e, u) : g(e, r.nargs) !== !1 ? t = D(t, e, u) : (d = u[t + 1], d !== void 0 && (!d.match(/^-/) || d.match(L)) && !g(e, r.bools) && !g(e, r.counts) || /^(true|false)$/.test(d) ? (q(e, d), t++) : q(e, R(e))));
184
+ } else if (a.match(/^--.+=/) || !_["short-option-groups"] && a.match(/^-.+=/))
185
+ p = a.match(/^--?([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && (g(p[1], r.arrays) ? t = F(t, p[1], u, p[2]) : g(p[1], r.nargs) !== !1 ? t = j(t, p[1], u, p[2]) : q(p[1], p[2], !0));
186
+ else if (a.match(W) && _["boolean-negation"])
187
+ p = a.match(W), p !== null && Array.isArray(p) && p.length >= 2 && (e = p[1], q(e, g(e, r.arrays) ? [!1] : !1));
188
+ else if (a.match(/^--.+/) || !_["short-option-groups"] && a.match(/^-[^-]+/))
189
+ p = a.match(/^--?(.+)/), p !== null && Array.isArray(p) && p.length >= 2 && (e = p[1], g(e, r.arrays) ? t = F(t, e, u) : g(e, r.nargs) !== !1 ? t = j(t, e, u) : (d = u[t + 1], d !== void 0 && (!d.match(/^-/) || d.match(Q)) && !g(e, r.bools) && !g(e, r.counts) || /^(true|false)$/.test(d) ? (q(e, d), t++) : q(e, D(e))));
190
190
  else if (a.match(/^-.\..+=/))
191
- l = a.match(/^-([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && q(l[1], l[2]);
192
- else if (a.match(/^-.\..+/) && !a.match(L))
193
- d = u[t + 1], l = a.match(/^-(.\..+)/), l !== null && Array.isArray(l) && l.length >= 2 && (e = l[1], d !== void 0 && !d.match(/^-/) && !g(e, r.bools) && !g(e, r.counts) ? (q(e, d), t++) : q(e, R(e)));
194
- else if (a.match(/^-[^-]+/) && !a.match(L)) {
195
- p = a.slice(1, -1).split(""), o = !1;
196
- for (let x = 0; x < p.length; x++) {
197
- if (d = a.slice(x + 2), p[x + 1] && p[x + 1] === "=") {
198
- v = a.slice(x + 3), e = p[x], g(e, r.arrays) ? t = V(t, e, u, v) : g(e, r.nargs) !== !1 ? t = D(t, e, u, v) : q(e, v), o = !0;
191
+ p = a.match(/^-([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && q(p[1], p[2]);
192
+ else if (a.match(/^-.\..+/) && !a.match(Q))
193
+ d = u[t + 1], p = a.match(/^-(.\..+)/), p !== null && Array.isArray(p) && p.length >= 2 && (e = p[1], d !== void 0 && !d.match(/^-/) && !g(e, r.bools) && !g(e, r.counts) ? (q(e, d), t++) : q(e, D(e)));
194
+ else if (a.match(/^-[^-]+/) && !a.match(Q)) {
195
+ l = a.slice(1, -1).split(""), o = !1;
196
+ for (let B = 0; B < l.length; B++) {
197
+ if (d = a.slice(B + 2), l[B + 1] && l[B + 1] === "=") {
198
+ v = a.slice(B + 3), e = l[B], g(e, r.arrays) ? t = F(t, e, u, v) : g(e, r.nargs) !== !1 ? t = j(t, e, u, v) : q(e, v), o = !0;
199
199
  break;
200
200
  }
201
201
  if (d === "-") {
202
- q(p[x], d);
202
+ q(l[B], d);
203
203
  continue;
204
204
  }
205
- if (/[A-Za-z]/.test(p[x]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(d) && g(d, r.bools) === !1) {
206
- q(p[x], d), o = !0;
205
+ if (/[A-Za-z]/.test(l[B]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(d) && g(d, r.bools) === !1) {
206
+ q(l[B], d), o = !0;
207
207
  break;
208
208
  }
209
- if (p[x + 1] && p[x + 1].match(/\W/)) {
210
- q(p[x], d), o = !0;
209
+ if (l[B + 1] && l[B + 1].match(/\W/)) {
210
+ q(l[B], d), o = !0;
211
211
  break;
212
212
  } else
213
- q(p[x], R(p[x]));
213
+ q(l[B], D(l[B]));
214
214
  }
215
- e = a.slice(-1)[0], !o && e !== "-" && (g(e, r.arrays) ? t = V(t, e, u) : g(e, r.nargs) !== !1 ? t = D(t, e, u) : (d = u[t + 1], d !== void 0 && (!/^(-|--)[^-]/.test(d) || d.match(L)) && !g(e, r.bools) && !g(e, r.counts) || /^(true|false)$/.test(d) ? (q(e, d), t++) : q(e, R(e))));
216
- } else if (a.match(/^-[0-9]$/) && a.match(L) && g(a.slice(1), r.bools))
217
- e = a.slice(1), q(e, R(e));
215
+ e = a.slice(-1)[0], !o && e !== "-" && (g(e, r.arrays) ? t = F(t, e, u) : g(e, r.nargs) !== !1 ? t = j(t, e, u) : (d = u[t + 1], d !== void 0 && (!/^(-|--)[^-]/.test(d) || d.match(Q)) && !g(e, r.bools) && !g(e, r.counts) || /^(true|false)$/.test(d) ? (q(e, d), t++) : q(e, D(e))));
216
+ } else if (a.match(/^-[0-9]$/) && a.match(Q) && g(a.slice(1), r.bools))
217
+ e = a.slice(1), q(e, D(e));
218
218
  else if (a === "--") {
219
- F = u.slice(t + 1);
219
+ V = u.slice(t + 1);
220
220
  break;
221
- } else if (h["halt-at-non-option"]) {
222
- F = u.slice(t);
221
+ } else if (_["halt-at-non-option"]) {
222
+ V = u.slice(t);
223
223
  break;
224
224
  } else
225
- K(a);
225
+ U(a);
226
226
  }
227
- rt(w, !0), rt(w, !1), kt(w), gt(), mt(w, r.aliases, f, !0), ft(w), h["set-placeholder-key"] && bt(w), Object.keys(r.counts).forEach(function(t) {
228
- E(w, t.split(".")) || q(t, 0);
229
- }), S && F.length && (w[G] = []), F.forEach(function(t) {
230
- w[G].push(t);
231
- }), h["camel-case-expansion"] && h["strip-dashed"] && Object.keys(w).filter((t) => t !== "--" && t.includes("-")).forEach((t) => {
232
- delete w[t];
233
- }), h["strip-aliased"] && [].concat(...Object.keys(_).map((t) => _[t])).forEach((t) => {
234
- h["camel-case-expansion"] && t.includes("-") && delete w[t.split(".").map((a) => W(a)).join(".")], delete w[t];
227
+ rt(b, !0), rt(b, !1), kt(b), gt(), mt(b, r.aliases, f, !0), ft(b), _["set-placeholder-key"] && wt(b), Object.keys(r.counts).forEach(function(t) {
228
+ C(b, t.split(".")) || q(t, 0);
229
+ }), P && V.length && (b[T] = []), V.forEach(function(t) {
230
+ b[T].push(t);
231
+ }), _["camel-case-expansion"] && _["strip-dashed"] && Object.keys(b).filter((t) => t !== "--" && t.includes("-")).forEach((t) => {
232
+ delete b[t];
233
+ }), _["strip-aliased"] && [].concat(...Object.keys(h).map((t) => h[t])).forEach((t) => {
234
+ _["camel-case-expansion"] && t.includes("-") && delete b[t.split(".").map((a) => $(a)).join(".")], delete b[t];
235
235
  });
236
- function K(t) {
237
- const a = $("_", t);
238
- (typeof a == "string" || typeof a == "number") && w._.push(a);
236
+ function U(t) {
237
+ const a = K("_", t);
238
+ (typeof a == "string" || typeof a == "number") && b._.push(a);
239
239
  }
240
- function D(t, a, c, o) {
241
- let e, p = g(a, r.nargs);
242
- if (p = typeof p != "number" || isNaN(p) ? 1 : p, p === 0)
243
- return T(o) || (B = Error(C("Argument unexpected for: %s", a))), q(a, R(a)), t;
244
- let l = T(o) ? 0 : 1;
245
- if (h["nargs-eats-options"])
246
- c.length - (t + 1) + l < p && (B = Error(C("Not enough arguments following: %s", a))), l = p;
240
+ function j(t, a, c, o) {
241
+ let e, l = g(a, r.nargs);
242
+ if (l = typeof l != "number" || isNaN(l) ? 1 : l, l === 0)
243
+ return A(o) || (I = Error(R("Argument unexpected for: %s", a))), q(a, D(a)), t;
244
+ let p = A(o) ? 0 : 1;
245
+ if (_["nargs-eats-options"])
246
+ c.length - (t + 1) + p < l && (I = Error(R("Not enough arguments following: %s", a))), p = l;
247
247
  else {
248
- for (e = t + 1; e < c.length && (!c[e].match(/^-[^0-9]/) || c[e].match(L) || H(c[e])); e++)
249
- l++;
250
- l < p && (B = Error(C("Not enough arguments following: %s", a)));
248
+ for (e = t + 1; e < c.length && (!c[e].match(/^-[^0-9]/) || c[e].match(Q) || H(c[e])); e++)
249
+ p++;
250
+ p < l && (I = Error(R("Not enough arguments following: %s", a)));
251
251
  }
252
- let d = Math.min(l, p);
253
- for (!T(o) && d > 0 && (q(a, o), d--), e = t + 1; e < d + t + 1; e++)
252
+ let d = Math.min(p, l);
253
+ for (!A(o) && d > 0 && (q(a, o), d--), e = t + 1; e < d + t + 1; e++)
254
254
  q(a, c[e]);
255
255
  return t + d;
256
256
  }
257
- function V(t, a, c, o) {
258
- let e = [], p = o || c[t + 1];
259
- const l = g(a, r.nargs);
260
- if (g(a, r.bools) && !/^(true|false)$/.test(p))
257
+ function F(t, a, c, o) {
258
+ let e = [], l = o || c[t + 1];
259
+ const p = g(a, r.nargs);
260
+ if (g(a, r.bools) && !/^(true|false)$/.test(l))
261
261
  e.push(!0);
262
- else if (T(p) || T(o) && /^-/.test(p) && !L.test(p) && !H(p)) {
262
+ else if (A(l) || A(o) && /^-/.test(l) && !Q.test(l) && !H(l)) {
263
263
  if (f[a] !== void 0) {
264
264
  const d = f[a];
265
265
  e = Array.isArray(d) ? d : [d];
266
266
  }
267
267
  } else {
268
- T(o) || e.push(Y(a, o, !0));
269
- for (let d = t + 1; d < c.length && !(!h["greedy-arrays"] && e.length > 0 || l && typeof l == "number" && e.length >= l || (p = c[d], /^-/.test(p) && !L.test(p) && !H(p))); d++)
270
- t = d, e.push(Y(a, p, k));
268
+ A(o) || e.push(Y(a, o, !0));
269
+ for (let d = t + 1; d < c.length && !(!_["greedy-arrays"] && e.length > 0 || p && typeof p == "number" && e.length >= p || (l = c[d], /^-/.test(l) && !Q.test(l) && !H(l))); d++)
270
+ t = d, e.push(Y(a, l, k));
271
271
  }
272
- return typeof l == "number" && (l && e.length < l || isNaN(l) && e.length === 0) && (B = Error(C("Not enough arguments following: %s", a))), q(a, e), t;
272
+ return typeof p == "number" && (p && e.length < p || isNaN(p) && e.length === 0) && (I = Error(R("Not enough arguments following: %s", a))), q(a, e), t;
273
273
  }
274
274
  function q(t, a, c = k) {
275
- if (/-/.test(t) && h["camel-case-expansion"]) {
276
- const p = t.split(".").map(function(l) {
277
- return W(l);
275
+ if (/-/.test(t) && _["camel-case-expansion"]) {
276
+ const l = t.split(".").map(function(p) {
277
+ return $(p);
278
278
  }).join(".");
279
- nt(t, p);
279
+ st(t, l);
280
280
  }
281
281
  const o = Y(t, a, c), e = t.split(".");
282
- N(w, e, o), r.aliases[t] && r.aliases[t].forEach(function(p) {
283
- const l = p.split(".");
284
- N(w, l, o);
285
- }), e.length > 1 && h["dot-notation"] && (r.aliases[e[0]] || []).forEach(function(p) {
286
- let l = p.split(".");
282
+ E(b, e, o), r.aliases[t] && r.aliases[t].forEach(function(l) {
283
+ const p = l.split(".");
284
+ E(b, p, o);
285
+ }), e.length > 1 && _["dot-notation"] && (r.aliases[e[0]] || []).forEach(function(l) {
286
+ let p = l.split(".");
287
287
  const d = [].concat(e);
288
- d.shift(), l = l.concat(d), (r.aliases[t] || []).includes(l.join(".")) || N(w, l, o);
289
- }), g(t, r.normalize) && !g(t, r.arrays) && [t].concat(r.aliases[t] || []).forEach(function(l) {
290
- Object.defineProperty(st, l, {
288
+ d.shift(), p = p.concat(d), (r.aliases[t] || []).includes(p.join(".")) || E(b, p, o);
289
+ }), g(t, r.normalize) && !g(t, r.arrays) && [t].concat(r.aliases[t] || []).forEach(function(p) {
290
+ Object.defineProperty(nt, p, {
291
291
  enumerable: !0,
292
292
  get() {
293
293
  return a;
294
294
  },
295
295
  set(d) {
296
- a = typeof d == "string" ? A.normalize(d) : d;
296
+ a = typeof d == "string" ? S.normalize(d) : d;
297
297
  }
298
298
  });
299
299
  });
300
300
  }
301
- function nt(t, a) {
302
- r.aliases[t] && r.aliases[t].length || (r.aliases[t] = [a], Q[a] = !0), r.aliases[a] && r.aliases[a].length || nt(a, t);
301
+ function st(t, a) {
302
+ r.aliases[t] && r.aliases[t].length || (r.aliases[t] = [a], z[a] = !0), r.aliases[a] && r.aliases[a].length || st(a, t);
303
303
  }
304
304
  function Y(t, a, c) {
305
- c && (a = jt(a)), (g(t, r.bools) || g(t, r.counts)) && typeof a == "string" && (a = a === "true");
305
+ c && (a = Ot(a)), (g(t, r.bools) || g(t, r.counts)) && typeof a == "string" && (a = a === "true");
306
306
  let o = Array.isArray(a) ? a.map(function(e) {
307
- return $(t, e);
308
- }) : $(t, a);
309
- return g(t, r.counts) && (T(o) || typeof o == "boolean") && (o = Z()), g(t, r.normalize) && g(t, r.arrays) && (Array.isArray(a) ? o = a.map((e) => A.normalize(e)) : o = A.normalize(a)), o;
307
+ return K(t, e);
308
+ }) : K(t, a);
309
+ return g(t, r.counts) && (A(o) || typeof o == "boolean") && (o = Z()), g(t, r.normalize) && g(t, r.arrays) && (Array.isArray(a) ? o = a.map((e) => S.normalize(e)) : o = S.normalize(a)), o;
310
310
  }
311
- function $(t, a) {
312
- return !h["parse-positional-numbers"] && t === "_" || !g(t, r.strings) && !g(t, r.bools) && !Array.isArray(a) && (Rt(a) && h["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${a}`))) || !T(a) && g(t, r.numbers)) && (a = Number(a)), a;
311
+ function K(t, a) {
312
+ return !_["parse-positional-numbers"] && t === "_" || !g(t, r.strings) && !g(t, r.bools) && !Array.isArray(a) && (Dt(a) && _["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${a}`))) || !A(a) && g(t, r.numbers)) && (a = Number(a)), a;
313
313
  }
314
314
  function kt(t) {
315
315
  const a = /* @__PURE__ */ Object.create(null);
@@ -318,46 +318,46 @@ class Nt {
318
318
  if (o)
319
319
  try {
320
320
  let e = null;
321
- const p = A.resolve(A.cwd(), o), l = r.configs[c];
322
- if (typeof l == "function") {
321
+ const l = S.resolve(S.cwd(), o), p = r.configs[c];
322
+ if (typeof p == "function") {
323
323
  try {
324
- e = l(p);
324
+ e = p(l);
325
325
  } catch (d) {
326
326
  e = d;
327
327
  }
328
328
  if (e instanceof Error) {
329
- B = e;
329
+ I = e;
330
330
  return;
331
331
  }
332
332
  } else
333
- e = A.require(p);
333
+ e = S.require(l);
334
334
  J(e);
335
335
  } catch (e) {
336
- e.name === "PermissionDenied" ? B = e : t[c] && (B = Error(C("Invalid JSON config file: %s", o)));
336
+ e.name === "PermissionDenied" ? I = e : t[c] && (I = Error(R("Invalid JSON config file: %s", o)));
337
337
  }
338
338
  });
339
339
  }
340
340
  function J(t, a) {
341
341
  Object.keys(t).forEach(function(c) {
342
342
  const o = t[c], e = a ? a + "." + c : c;
343
- typeof o == "object" && o !== null && !Array.isArray(o) && h["dot-notation"] ? J(o, e) : (!E(w, e.split(".")) || g(e, r.arrays) && h["combine-arrays"]) && q(e, o);
343
+ typeof o == "object" && o !== null && !Array.isArray(o) && _["dot-notation"] ? J(o, e) : (!C(b, e.split(".")) || g(e, r.arrays) && _["combine-arrays"]) && q(e, o);
344
344
  });
345
345
  }
346
346
  function gt() {
347
- typeof y < "u" && y.forEach(function(t) {
347
+ typeof x < "u" && x.forEach(function(t) {
348
348
  J(t);
349
349
  });
350
350
  }
351
351
  function rt(t, a) {
352
- if (typeof P > "u")
352
+ if (typeof M > "u")
353
353
  return;
354
- const c = typeof P == "string" ? P : "", o = A.env();
354
+ const c = typeof M == "string" ? M : "", o = S.env();
355
355
  Object.keys(o).forEach(function(e) {
356
356
  if (c === "" || e.lastIndexOf(c, 0) === 0) {
357
- const p = e.split("__").map(function(l, d) {
358
- return d === 0 && (l = l.substring(c.length)), W(l);
357
+ const l = e.split("__").map(function(p, d) {
358
+ return d === 0 && (p = p.substring(c.length)), $(p);
359
359
  });
360
- (a && r.configs[p.join(".")] || !a) && !E(t, p) && q(p.join("."), o[e]);
360
+ (a && r.configs[l.join(".")] || !a) && !C(t, l) && q(l.join("."), o[e]);
361
361
  }
362
362
  });
363
363
  }
@@ -367,56 +367,56 @@ class Nt {
367
367
  Object.keys(t).forEach(function(o) {
368
368
  if (!c.has(o) && (a = g(o, r.coercions), typeof a == "function"))
369
369
  try {
370
- const e = $(o, a(t[o]));
371
- [].concat(r.aliases[o] || [], o).forEach((p) => {
372
- c.add(p), t[p] = e;
370
+ const e = K(o, a(t[o]));
371
+ [].concat(r.aliases[o] || [], o).forEach((l) => {
372
+ c.add(l), t[l] = e;
373
373
  });
374
374
  } catch (e) {
375
- B = e;
375
+ I = e;
376
376
  }
377
377
  });
378
378
  }
379
- function bt(t) {
379
+ function wt(t) {
380
380
  return r.keys.forEach((a) => {
381
381
  ~a.indexOf(".") || typeof t[a] > "u" && (t[a] = void 0);
382
382
  }), t;
383
383
  }
384
384
  function mt(t, a, c, o = !1) {
385
385
  Object.keys(c).forEach(function(e) {
386
- E(t, e.split(".")) || (N(t, e.split("."), c[e]), o && (ot[e] = !0), (a[e] || []).forEach(function(p) {
387
- E(t, p.split(".")) || N(t, p.split("."), c[e]);
386
+ C(t, e.split(".")) || (E(t, e.split("."), c[e]), o && (ot[e] = !0), (a[e] || []).forEach(function(l) {
387
+ C(t, l.split(".")) || E(t, l.split("."), c[e]);
388
388
  }));
389
389
  });
390
390
  }
391
- function E(t, a) {
391
+ function C(t, a) {
392
392
  let c = t;
393
- h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(e) {
393
+ _["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(e) {
394
394
  c = c[e] || {};
395
395
  });
396
396
  const o = a[a.length - 1];
397
397
  return typeof c != "object" ? !1 : o in c;
398
398
  }
399
- function N(t, a, c) {
399
+ function E(t, a, c) {
400
400
  let o = t;
401
- h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(v) {
401
+ _["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(v) {
402
402
  v = ct(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 e = ct(a[a.length - 1]), p = g(a.join("."), r.arrays), l = Array.isArray(c);
405
- let d = h["duplicate-arguments-array"];
406
- !d && g(e, r.nargs) && (d = !0, (!T(o[e]) && r.nargs[e] === 1 || Array.isArray(o[e]) && o[e].length === r.nargs[e]) && (o[e] = void 0)), c === Z() ? o[e] = Z(o[e]) : Array.isArray(o[e]) ? d && p && l ? o[e] = h["flatten-duplicate-arrays"] ? o[e].concat(c) : (Array.isArray(o[e][0]) ? o[e] : [o[e]]).concat([c]) : !d && !!p == !!l ? o[e] = c : o[e] = o[e].concat([c]) : o[e] === void 0 && p ? o[e] = l ? c : [c] : d && !(o[e] === void 0 || g(e, r.counts) || g(e, r.bools)) ? o[e] = [o[e], c] : o[e] = c;
404
+ const e = ct(a[a.length - 1]), l = g(a.join("."), r.arrays), p = Array.isArray(c);
405
+ let d = _["duplicate-arguments-array"];
406
+ !d && g(e, r.nargs) && (d = !0, (!A(o[e]) && r.nargs[e] === 1 || Array.isArray(o[e]) && o[e].length === r.nargs[e]) && (o[e] = void 0)), c === Z() ? o[e] = Z(o[e]) : Array.isArray(o[e]) ? d && l && p ? o[e] = _["flatten-duplicate-arrays"] ? o[e].concat(c) : (Array.isArray(o[e][0]) ? o[e] : [o[e]]).concat([c]) : !d && !!l == !!p ? o[e] = c : o[e] = o[e].concat([c]) : o[e] === void 0 && l ? o[e] = p ? c : [c] : d && !(o[e] === void 0 || g(e, r.counts) || g(e, r.bools)) ? o[e] = [o[e], c] : o[e] = c;
407
407
  }
408
408
  function qt(...t) {
409
409
  t.forEach(function(a) {
410
410
  Object.keys(a || {}).forEach(function(c) {
411
- r.aliases[c] || (r.aliases[c] = [].concat(_[c] || []), r.aliases[c].concat(c).forEach(function(o) {
412
- if (/-/.test(o) && h["camel-case-expansion"]) {
413
- const e = W(o);
414
- e !== c && r.aliases[c].indexOf(e) === -1 && (r.aliases[c].push(e), Q[e] = !0);
411
+ r.aliases[c] || (r.aliases[c] = [].concat(h[c] || []), r.aliases[c].concat(c).forEach(function(o) {
412
+ if (/-/.test(o) && _["camel-case-expansion"]) {
413
+ const e = $(o);
414
+ e !== c && r.aliases[c].indexOf(e) === -1 && (r.aliases[c].push(e), z[e] = !0);
415
415
  }
416
416
  }), r.aliases[c].concat(c).forEach(function(o) {
417
- if (o.length > 1 && /[A-Z]/.test(o) && h["camel-case-expansion"]) {
418
- const e = Ot(o, "-");
419
- e !== c && r.aliases[c].indexOf(e) === -1 && (r.aliases[c].push(e), Q[e] = !0);
417
+ if (o.length > 1 && /[A-Z]/.test(o) && _["camel-case-expansion"]) {
418
+ const e = Gt(o, "-");
419
+ e !== c && r.aliases[c].indexOf(e) === -1 && (r.aliases[c].push(e), z[e] = !0);
420
420
  }
421
421
  }), r.aliases[c].forEach(function(o) {
422
422
  r.aliases[o] = [c].concat(r.aliases[c].filter(function(e) {
@@ -427,7 +427,7 @@ class Nt {
427
427
  });
428
428
  }
429
429
  function g(t, a) {
430
- const c = [].concat(r.aliases[t] || [], t), o = Object.keys(a), e = c.find((p) => o.includes(p));
430
+ const c = [].concat(r.aliases[t] || [], t), o = Object.keys(a), e = c.find((l) => o.includes(l));
431
431
  return e ? a[e] : !1;
432
432
  }
433
433
  function ut(t) {
@@ -436,14 +436,14 @@ class Nt {
436
436
  return Array.isArray(o) ? o.includes(t) : o[t];
437
437
  });
438
438
  }
439
- function wt(t, ...a) {
439
+ function bt(t, ...a) {
440
440
  return [].concat(...a).some(function(o) {
441
441
  const e = t.match(o);
442
442
  return e && ut(e[1]);
443
443
  });
444
444
  }
445
445
  function vt(t) {
446
- if (t.match(L) || !t.match(/^-[^-]+/))
446
+ if (t.match(Q) || !t.match(/^-[^-]+/))
447
447
  return !1;
448
448
  let a = !0, c;
449
449
  const o = t.slice(1).split("");
@@ -458,61 +458,61 @@ class Nt {
458
458
  return a;
459
459
  }
460
460
  function H(t) {
461
- return h["unknown-options-as-args"] && xt(t);
461
+ return _["unknown-options-as-args"] && Bt(t);
462
462
  }
463
- function xt(t) {
464
- return t = t.replace(/^-{3,}/, "--"), t.match(L) || vt(t) ? !1 : !wt(t, /^-+([^=]+?)=[\s\S]*$/, U, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/);
463
+ function Bt(t) {
464
+ return t = t.replace(/^-{3,}/, "--"), t.match(Q) || vt(t) ? !1 : !bt(t, /^-+([^=]+?)=[\s\S]*$/, W, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/);
465
465
  }
466
- function R(t) {
467
- return !g(t, r.bools) && !g(t, r.counts) && `${t}` in f ? f[t] : yt(Bt(t));
466
+ function D(t) {
467
+ return !g(t, r.bools) && !g(t, r.counts) && `${t}` in f ? f[t] : xt(It(t));
468
468
  }
469
- function yt(t) {
469
+ function xt(t) {
470
470
  return {
471
- [I.BOOLEAN]: !0,
472
- [I.STRING]: "",
473
- [I.NUMBER]: void 0,
474
- [I.ARRAY]: []
471
+ [y.BOOLEAN]: !0,
472
+ [y.STRING]: "",
473
+ [y.NUMBER]: void 0,
474
+ [y.ARRAY]: []
475
475
  }[t];
476
476
  }
477
- function Bt(t) {
478
- let a = I.BOOLEAN;
479
- return g(t, r.strings) ? a = I.STRING : g(t, r.numbers) ? a = I.NUMBER : g(t, r.bools) ? a = I.BOOLEAN : g(t, r.arrays) && (a = I.ARRAY), a;
477
+ function It(t) {
478
+ let a = y.BOOLEAN;
479
+ return g(t, r.strings) ? a = y.STRING : g(t, r.numbers) ? a = y.NUMBER : g(t, r.bools) ? a = y.BOOLEAN : g(t, r.arrays) && (a = y.ARRAY), a;
480
480
  }
481
- function T(t) {
481
+ function A(t) {
482
482
  return t === void 0;
483
483
  }
484
- function Mt() {
485
- Object.keys(r.counts).find((t) => g(t, r.arrays) ? (B = Error(C("Invalid configuration: %s, opts.count excludes opts.array.", t)), !0) : g(t, r.nargs) ? (B = Error(C("Invalid configuration: %s, opts.count excludes opts.narg.", t)), !0) : !1);
484
+ function Lt() {
485
+ Object.keys(r.counts).find((t) => g(t, r.arrays) ? (I = Error(R("Invalid configuration: %s, opts.count excludes opts.array.", t)), !0) : g(t, r.nargs) ? (I = Error(R("Invalid configuration: %s, opts.count excludes opts.narg.", t)), !0) : !1);
486
486
  }
487
487
  return {
488
488
  aliases: Object.assign({}, r.aliases),
489
- argv: Object.assign(st, w),
490
- configuration: h,
489
+ argv: Object.assign(nt, b),
490
+ configuration: _,
491
491
  defaulted: Object.assign({}, ot),
492
- error: B,
493
- newAliases: Object.assign({}, Q)
492
+ error: I,
493
+ newAliases: Object.assign({}, z)
494
494
  };
495
495
  }
496
496
  }
497
- function zt(i) {
498
- const s = [], m = /* @__PURE__ */ Object.create(null);
499
- let n = !0;
497
+ function Nt(i) {
498
+ const n = [], m = /* @__PURE__ */ Object.create(null);
499
+ let s = !0;
500
500
  for (Object.keys(i).forEach(function(u) {
501
- s.push([].concat(i[u], u));
502
- }); n; ) {
503
- n = !1;
504
- for (let u = 0; u < s.length; u++)
505
- for (let k = u + 1; k < s.length; k++)
506
- if (s[u].filter(function(h) {
507
- return s[k].indexOf(h) !== -1;
501
+ n.push([].concat(i[u], u));
502
+ }); s; ) {
503
+ s = !1;
504
+ for (let u = 0; u < n.length; u++)
505
+ for (let k = u + 1; k < n.length; k++)
506
+ if (n[u].filter(function(_) {
507
+ return n[k].indexOf(_) !== -1;
508
508
  }).length) {
509
- s[u] = s[u].concat(s[k]), s.splice(k, 1), n = !0;
509
+ n[u] = n[u].concat(n[k]), n.splice(k, 1), s = !0;
510
510
  break;
511
511
  }
512
512
  }
513
- return s.forEach(function(u) {
514
- u = u.filter(function(_, h, f) {
515
- return f.indexOf(_) === h;
513
+ return n.forEach(function(u) {
514
+ u = u.filter(function(h, _, f) {
515
+ return f.indexOf(h) === _;
516
516
  });
517
517
  const k = u.pop();
518
518
  k !== void 0 && typeof k == "string" && (m[k] = u);
@@ -524,7 +524,7 @@ function Z(i) {
524
524
  function ct(i) {
525
525
  return i === "__proto__" ? "___proto___" : i;
526
526
  }
527
- function jt(i) {
527
+ function Ot(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
  /**
@@ -536,15 +536,15 @@ function jt(i) {
536
536
  * SPDX-License-Identifier: ISC
537
537
  */
538
538
  var X, tt, et;
539
- const lt = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, pt = (tt = (X = process == null ? void 0 : process.versions) === null || X === void 0 ? void 0 : X.node) !== null && tt !== void 0 ? tt : (et = process == null ? void 0 : process.version) === null || et === void 0 ? void 0 : et.slice(1);
540
- if (pt && Number(pt.match(/^([^.]+)/)[1]) < lt)
541
- throw Error(`yargs parser supports a minimum Node.js version of ${lt}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
542
- const Qt = process ? process.env : {};
543
- new Nt({
539
+ const pt = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, lt = (tt = (X = process == null ? void 0 : process.versions) === null || X === void 0 ? void 0 : X.node) !== null && tt !== void 0 ? tt : (et = process == null ? void 0 : process.version) === null || et === void 0 ? void 0 : et.slice(1);
540
+ if (lt && Number(lt.match(/^([^.]+)/)[1]) < pt)
541
+ throw Error(`yargs parser supports a minimum Node.js version of ${pt}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
542
+ const zt = process ? process.env : {};
543
+ new Et({
544
544
  cwd: process.cwd,
545
- env: () => Qt,
546
- format: ht,
547
- normalize: It,
545
+ env: () => zt,
546
+ format: _t,
547
+ normalize: yt,
548
548
  resolve: at,
549
549
  // TODO: figure out a way to combine ESM and CJS coverage, such that
550
550
  // we can exercise all the lines below:
@@ -552,115 +552,115 @@ new Nt({
552
552
  if (typeof require < "u")
553
553
  return require(i);
554
554
  if (i.match(/\.json$/))
555
- return JSON.parse(_t(i, "utf8"));
555
+ return JSON.parse(ht(i, "utf8"));
556
556
  throw Error("only .json config files are supported in ESM");
557
557
  }
558
558
  });
559
- const Ft = {
559
+ const Vt = {
560
560
  fs: {
561
- readFileSync: _t,
562
- writeFile: Lt
561
+ readFileSync: ht,
562
+ writeFile: Qt
563
563
  },
564
- format: ht,
564
+ format: _t,
565
565
  resolve: at,
566
566
  exists: (i) => {
567
567
  try {
568
- return Pt(i).isFile();
568
+ return Mt(i).isFile();
569
569
  } catch {
570
570
  return !1;
571
571
  }
572
572
  }
573
573
  };
574
- let M;
575
- class Dt {
576
- constructor(s) {
577
- s = s || {}, this.directory = s.directory || "./locales", this.updateFiles = typeof s.updateFiles == "boolean" ? s.updateFiles : !0, this.locale = s.locale || "en", this.fallbackToLanguage = typeof s.fallbackToLanguage == "boolean" ? s.fallbackToLanguage : !0, this.cache = /* @__PURE__ */ Object.create(null), this.writeQueue = [];
574
+ let L;
575
+ class jt {
576
+ constructor(n) {
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 = [];
578
578
  }
579
- __(...s) {
579
+ __(...n) {
580
580
  if (typeof arguments[0] != "string")
581
581
  return this._taggedLiteral(arguments[0], ...arguments);
582
- const m = s.shift();
583
- let n = function() {
582
+ const m = n.shift();
583
+ let s = function() {
584
584
  };
585
- return typeof s[s.length - 1] == "function" && (n = s.pop()), n = n || function() {
585
+ return typeof n[n.length - 1] == "function" && (s = n.pop()), s = s || function() {
586
586
  }, this.cache[this.locale] || this._readLocaleFile(), !this.cache[this.locale][m] && this.updateFiles ? (this.cache[this.locale][m] = m, this._enqueueWrite({
587
587
  directory: this.directory,
588
588
  locale: this.locale,
589
- cb: n
590
- })) : n(), M.format.apply(M.format, [this.cache[this.locale][m] || m].concat(s));
589
+ cb: s
590
+ })) : s(), L.format.apply(L.format, [this.cache[this.locale][m] || m].concat(n));
591
591
  }
592
592
  __n() {
593
- const s = Array.prototype.slice.call(arguments), m = s.shift(), n = s.shift(), u = s.shift();
593
+ const n = Array.prototype.slice.call(arguments), m = n.shift(), s = n.shift(), u = n.shift();
594
594
  let k = function() {
595
595
  };
596
- typeof s[s.length - 1] == "function" && (k = s.pop()), this.cache[this.locale] || this._readLocaleFile();
597
- let _ = u === 1 ? m : n;
598
- this.cache[this.locale][m] && (_ = this.cache[this.locale][m][u === 1 ? "one" : "other"]), !this.cache[this.locale][m] && this.updateFiles ? (this.cache[this.locale][m] = {
596
+ typeof n[n.length - 1] == "function" && (k = n.pop()), this.cache[this.locale] || this._readLocaleFile();
597
+ let h = u === 1 ? m : s;
598
+ this.cache[this.locale][m] && (h = this.cache[this.locale][m][u === 1 ? "one" : "other"]), !this.cache[this.locale][m] && this.updateFiles ? (this.cache[this.locale][m] = {
599
599
  one: m,
600
- other: n
600
+ other: s
601
601
  }, this._enqueueWrite({
602
602
  directory: this.directory,
603
603
  locale: this.locale,
604
604
  cb: k
605
605
  })) : k();
606
- const h = [_];
607
- return ~_.indexOf("%d") && h.push(u), M.format.apply(M.format, h.concat(s));
606
+ const _ = [h];
607
+ return ~h.indexOf("%d") && _.push(u), L.format.apply(L.format, _.concat(n));
608
608
  }
609
- setLocale(s) {
610
- this.locale = s;
609
+ setLocale(n) {
610
+ this.locale = n;
611
611
  }
612
612
  getLocale() {
613
613
  return this.locale;
614
614
  }
615
- updateLocale(s) {
615
+ updateLocale(n) {
616
616
  this.cache[this.locale] || this._readLocaleFile();
617
- for (const m in s)
618
- Object.prototype.hasOwnProperty.call(s, m) && (this.cache[this.locale][m] = s[m]);
617
+ for (const m in n)
618
+ Object.prototype.hasOwnProperty.call(n, m) && (this.cache[this.locale][m] = n[m]);
619
619
  }
620
- _taggedLiteral(s, ...m) {
621
- let n = "";
622
- return s.forEach(function(u, k) {
623
- const _ = m[k + 1];
624
- n += u, typeof _ < "u" && (n += "%s");
625
- }), this.__.apply(this, [n].concat([].slice.call(m, 1)));
620
+ _taggedLiteral(n, ...m) {
621
+ let s = "";
622
+ return n.forEach(function(u, k) {
623
+ const h = m[k + 1];
624
+ s += u, typeof h < "u" && (s += "%s");
625
+ }), this.__.apply(this, [s].concat([].slice.call(m, 1)));
626
626
  }
627
- _enqueueWrite(s) {
628
- this.writeQueue.push(s), this.writeQueue.length === 1 && this._processWriteQueue();
627
+ _enqueueWrite(n) {
628
+ this.writeQueue.push(n), this.writeQueue.length === 1 && this._processWriteQueue();
629
629
  }
630
630
  _processWriteQueue() {
631
- const s = this, m = this.writeQueue[0], n = m.directory, u = m.locale, k = m.cb, _ = this._resolveLocaleFile(n, u), h = JSON.stringify(this.cache[u], null, 2);
632
- M.fs.writeFile(_, h, "utf-8", function(f) {
633
- s.writeQueue.shift(), s.writeQueue.length > 0 && s._processWriteQueue(), k(f);
631
+ const n = this, m = this.writeQueue[0], s = m.directory, u = m.locale, k = m.cb, h = this._resolveLocaleFile(s, u), _ = JSON.stringify(this.cache[u], null, 2);
632
+ L.fs.writeFile(h, _, "utf-8", function(f) {
633
+ n.writeQueue.shift(), n.writeQueue.length > 0 && n._processWriteQueue(), k(f);
634
634
  });
635
635
  }
636
636
  _readLocaleFile() {
637
- let s = {};
637
+ let n = {};
638
638
  const m = this._resolveLocaleFile(this.directory, this.locale);
639
639
  try {
640
- M.fs.readFileSync && (s = JSON.parse(M.fs.readFileSync(m, "utf-8")));
641
- } catch (n) {
642
- if (n instanceof SyntaxError && (n.message = "syntax error in " + m), n.code === "ENOENT")
643
- s = {};
640
+ L.fs.readFileSync && (n = JSON.parse(L.fs.readFileSync(m, "utf-8")));
641
+ } catch (s) {
642
+ if (s instanceof SyntaxError && (s.message = "syntax error in " + m), s.code === "ENOENT")
643
+ n = {};
644
644
  else
645
- throw n;
645
+ throw s;
646
646
  }
647
- this.cache[this.locale] = s;
647
+ this.cache[this.locale] = n;
648
648
  }
649
- _resolveLocaleFile(s, m) {
650
- let n = M.resolve(s, "./", m + ".json");
651
- if (this.fallbackToLanguage && !this._fileExistsSync(n) && ~m.lastIndexOf("_")) {
652
- const u = M.resolve(s, "./", m.split("_")[0] + ".json");
653
- this._fileExistsSync(u) && (n = u);
649
+ _resolveLocaleFile(n, m) {
650
+ let s = L.resolve(n, "./", m + ".json");
651
+ if (this.fallbackToLanguage && !this._fileExistsSync(s) && ~m.lastIndexOf("_")) {
652
+ const u = L.resolve(n, "./", m.split("_")[0] + ".json");
653
+ this._fileExistsSync(u) && (s = u);
654
654
  }
655
- return n;
655
+ return s;
656
656
  }
657
- _fileExistsSync(s) {
658
- return M.exists(s);
657
+ _fileExistsSync(n) {
658
+ return L.exists(n);
659
659
  }
660
660
  }
661
- function Vt(i, s) {
662
- M = s;
663
- const m = new Dt(i);
661
+ function Ft(i, n) {
662
+ L = n;
663
+ const m = new jt(i);
664
664
  return {
665
665
  __: m.__.bind(m),
666
666
  __n: m.__n.bind(m),
@@ -670,16 +670,16 @@ function Vt(i, s) {
670
670
  locale: m.locale
671
671
  };
672
672
  }
673
- const $t = (i) => Vt(i, Ft);
674
- let z;
673
+ const Kt = (i) => Ft(i, Vt);
674
+ let N;
675
675
  try {
676
- z = Tt(import.meta.url);
676
+ N = At(import.meta.url);
677
677
  } catch {
678
- z = process.cwd();
678
+ N = process.cwd();
679
679
  }
680
- const Ht = z.substring(0, z.lastIndexOf("node_modules"));
681
- Ht || process.cwd(), process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, $t({
682
- directory: at(z, "../../../locales"),
680
+ const Ht = N.substring(0, N.lastIndexOf("node_modules"));
681
+ Ht || process.cwd(), process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, Kt({
682
+ directory: at(N, "../../../locales"),
683
683
  updateFiles: !1
684
684
  });
685
685
  const it = [
@@ -994,6 +994,34 @@ const it = [
994
994
  output_mtok: 75
995
995
  }
996
996
  },
997
+ {
998
+ id: "claude-opus-4-5",
999
+ name: "Claude Opus 4.5",
1000
+ description: "Premium model combining maximum intelligence with practical performance",
1001
+ match: {
1002
+ or: [
1003
+ {
1004
+ starts_with: "claude-opus-4-5"
1005
+ },
1006
+ {
1007
+ starts_with: "claude-opus-4.5"
1008
+ },
1009
+ {
1010
+ starts_with: "claude-4-5-opus"
1011
+ },
1012
+ {
1013
+ starts_with: "claude-4.5-opus"
1014
+ }
1015
+ ]
1016
+ },
1017
+ context_window: 2e5,
1018
+ prices: {
1019
+ input_mtok: 5,
1020
+ cache_write_mtok: 6.25,
1021
+ cache_read_mtok: 0.5,
1022
+ output_mtok: 25
1023
+ }
1024
+ },
997
1025
  {
998
1026
  id: "claude-sonnet-4-0",
999
1027
  name: "Claude Sonnet 4",
@@ -4131,284 +4159,3044 @@ Compared to other leading proprietary and open-weights models Command A delivers
4131
4159
  match: {
4132
4160
  equals: "llama-3.1-70b-versatile"
4133
4161
  },
4134
- prices: {
4135
- input_mtok: 0.59,
4136
- output_mtok: 0.79
4162
+ prices: {
4163
+ input_mtok: 0.59,
4164
+ output_mtok: 0.79
4165
+ }
4166
+ },
4167
+ {
4168
+ id: "llama-3.1-8b-instant",
4169
+ name: "Llama 3.1 8B Instant 128k",
4170
+ match: {
4171
+ equals: "llama-3.1-8b-instant"
4172
+ },
4173
+ prices: {
4174
+ input_mtok: 0.05,
4175
+ output_mtok: 0.08
4176
+ }
4177
+ },
4178
+ {
4179
+ id: "llama-3.2-11b-text-preview",
4180
+ match: {
4181
+ equals: "llama-3.2-11b-text-preview"
4182
+ },
4183
+ prices: {
4184
+ input_mtok: 0.18,
4185
+ output_mtok: 0.18
4186
+ }
4187
+ },
4188
+ {
4189
+ id: "llama-3.2-11b-vision-preview",
4190
+ match: {
4191
+ equals: "llama-3.2-11b-vision-preview"
4192
+ },
4193
+ prices: {
4194
+ input_mtok: 0.18,
4195
+ output_mtok: 0.18
4196
+ }
4197
+ },
4198
+ {
4199
+ id: "llama-3.2-1b-preview",
4200
+ match: {
4201
+ equals: "llama-3.2-1b-preview"
4202
+ },
4203
+ prices: {
4204
+ input_mtok: 0.04,
4205
+ output_mtok: 0.04
4206
+ }
4207
+ },
4208
+ {
4209
+ id: "llama-3.2-3b-preview",
4210
+ match: {
4211
+ equals: "llama-3.2-3b-preview"
4212
+ },
4213
+ prices: {
4214
+ input_mtok: 0.06,
4215
+ output_mtok: 0.06
4216
+ }
4217
+ },
4218
+ {
4219
+ id: "llama-3.2-90b-text-preview",
4220
+ match: {
4221
+ equals: "llama-3.2-90b-text-preview"
4222
+ },
4223
+ prices: {
4224
+ input_mtok: 0.9,
4225
+ output_mtok: 0.9
4226
+ }
4227
+ },
4228
+ {
4229
+ id: "llama-3.2-90b-vision-preview",
4230
+ match: {
4231
+ equals: "llama-3.2-90b-vision-preview"
4232
+ },
4233
+ prices: {
4234
+ input_mtok: 0.9,
4235
+ output_mtok: 0.9
4236
+ }
4237
+ },
4238
+ {
4239
+ id: "llama-3.3-70b-specdec",
4240
+ match: {
4241
+ equals: "llama-3.3-70b-specdec"
4242
+ },
4243
+ prices: {
4244
+ input_mtok: 0.59,
4245
+ output_mtok: 0.99
4246
+ }
4247
+ },
4248
+ {
4249
+ id: "llama-3.3-70b-versatile",
4250
+ name: "Llama 3.3 70B Versatile 128k",
4251
+ match: {
4252
+ equals: "llama-3.3-70b-versatile"
4253
+ },
4254
+ prices: {
4255
+ input_mtok: 0.59,
4256
+ output_mtok: 0.79
4257
+ }
4258
+ },
4259
+ {
4260
+ id: "llama-guard-3-8b",
4261
+ match: {
4262
+ equals: "llama-guard-3-8b"
4263
+ },
4264
+ prices: {
4265
+ input_mtok: 0.2,
4266
+ output_mtok: 0.2
4267
+ }
4268
+ },
4269
+ {
4270
+ id: "llama2-70b-4096",
4271
+ match: {
4272
+ equals: "llama2-70b-4096"
4273
+ },
4274
+ prices: {
4275
+ input_mtok: 0.7,
4276
+ output_mtok: 0.8
4277
+ }
4278
+ },
4279
+ {
4280
+ id: "llama3-70b-8192",
4281
+ match: {
4282
+ equals: "llama3-70b-8192"
4283
+ },
4284
+ prices: {
4285
+ input_mtok: 0.59,
4286
+ output_mtok: 0.79
4287
+ }
4288
+ },
4289
+ {
4290
+ id: "llama3-8b-8192",
4291
+ match: {
4292
+ equals: "llama3-8b-8192"
4293
+ },
4294
+ prices: {
4295
+ input_mtok: 0.05,
4296
+ output_mtok: 0.08
4297
+ }
4298
+ },
4299
+ {
4300
+ id: "llama3-groq-70b-8192-tool-use-preview",
4301
+ match: {
4302
+ equals: "llama3-groq-70b-8192-tool-use-preview"
4303
+ },
4304
+ prices: {
4305
+ input_mtok: 0.89,
4306
+ output_mtok: 0.89
4307
+ }
4308
+ },
4309
+ {
4310
+ id: "llama3-groq-8b-8192-tool-use-preview",
4311
+ match: {
4312
+ equals: "llama3-groq-8b-8192-tool-use-preview"
4313
+ },
4314
+ prices: {
4315
+ input_mtok: 0.19,
4316
+ output_mtok: 0.19
4317
+ }
4318
+ },
4319
+ {
4320
+ id: "meta-llama/llama-4-maverick-17b-128e-instruct",
4321
+ name: "Llama 4 Maverick 17B 128E",
4322
+ match: {
4323
+ equals: "meta-llama/llama-4-maverick-17b-128e-instruct"
4324
+ },
4325
+ context_window: 131072,
4326
+ prices: {
4327
+ input_mtok: 0.2,
4328
+ output_mtok: 0.6
4329
+ }
4330
+ },
4331
+ {
4332
+ id: "meta-llama/llama-4-scout-17b-16e-instruct",
4333
+ name: "Llama 4 Scout (17Bx16E) 128k",
4334
+ match: {
4335
+ equals: "meta-llama/llama-4-scout-17b-16e-instruct"
4336
+ },
4337
+ prices: {
4338
+ input_mtok: 0.11,
4339
+ output_mtok: 0.34
4340
+ }
4341
+ },
4342
+ {
4343
+ id: "meta-llama/llama-guard-4-12b",
4344
+ name: "Llama Guard 4 12B",
4345
+ match: {
4346
+ equals: "meta-llama/llama-guard-4-12b"
4347
+ },
4348
+ context_window: 131072,
4349
+ prices: {
4350
+ input_mtok: 0.2,
4351
+ output_mtok: 0.2
4352
+ }
4353
+ },
4354
+ {
4355
+ id: "mistral-saba-24b",
4356
+ match: {
4357
+ equals: "mistral-saba-24b"
4358
+ },
4359
+ prices: {
4360
+ input_mtok: 0.79,
4361
+ output_mtok: 0.79
4362
+ }
4363
+ },
4364
+ {
4365
+ id: "mixtral-8x7b-32768",
4366
+ match: {
4367
+ equals: "mixtral-8x7b-32768"
4368
+ },
4369
+ prices: {
4370
+ input_mtok: 0.24,
4371
+ output_mtok: 0.24
4372
+ }
4373
+ },
4374
+ {
4375
+ id: "moonshotai/kimi-k2-instruct",
4376
+ name: "Kimi K2 1T 128k",
4377
+ match: {
4378
+ or: [
4379
+ {
4380
+ equals: "moonshotai/kimi-k2-instruct"
4381
+ },
4382
+ {
4383
+ equals: "moonshotai/kimi-k2-instruct-0905"
4384
+ }
4385
+ ]
4386
+ },
4387
+ context_window: 131072,
4388
+ prices: {
4389
+ input_mtok: 1,
4390
+ cache_read_mtok: 0.5,
4391
+ output_mtok: 3
4392
+ }
4393
+ },
4394
+ {
4395
+ id: "openai/gpt-oss-120b",
4396
+ description: `GPT-OSS 120B is OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with
4397
+ 120 billion parameters and 128 experts.
4398
+ `,
4399
+ match: {
4400
+ or: [
4401
+ {
4402
+ equals: "openai/gpt-oss-120b"
4403
+ },
4404
+ {
4405
+ equals: "openai/gpt-oss-safeguard-20b"
4406
+ }
4407
+ ]
4408
+ },
4409
+ context_window: 131072,
4410
+ prices: {
4411
+ input_mtok: 0.15,
4412
+ cache_read_mtok: 0.075,
4413
+ output_mtok: 0.6
4414
+ }
4415
+ },
4416
+ {
4417
+ id: "openai/gpt-oss-20b",
4418
+ description: `GPT-OSS 20B is OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with
4419
+ 20 billion parameters and 32 experts.
4420
+ `,
4421
+ match: {
4422
+ equals: "openai/gpt-oss-20b"
4423
+ },
4424
+ context_window: 131072,
4425
+ prices: {
4426
+ input_mtok: 0.075,
4427
+ cache_read_mtok: 0.0375,
4428
+ output_mtok: 0.3
4429
+ }
4430
+ },
4431
+ {
4432
+ id: "qwen/qwen3-32b",
4433
+ name: "Qwen3 32B 131k",
4434
+ match: {
4435
+ equals: "qwen/qwen3-32b"
4436
+ },
4437
+ prices: {
4438
+ input_mtok: 0.29,
4439
+ output_mtok: 0.59
4440
+ }
4441
+ }
4442
+ ]
4443
+ },
4444
+ {
4445
+ id: "huggingface_cerebras",
4446
+ name: "HuggingFace (cerebras)",
4447
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
4448
+ api_pattern: "https://router\\.huggingface\\.co/cerebras",
4449
+ provider_match: {
4450
+ and: [
4451
+ {
4452
+ contains: "huggingface"
4453
+ },
4454
+ {
4455
+ contains: "cerebras"
4456
+ }
4457
+ ]
4458
+ },
4459
+ extractors: [
4460
+ {
4461
+ api_flavor: "chat",
4462
+ root: "usage",
4463
+ model_path: "model",
4464
+ mappings: [
4465
+ {
4466
+ path: "prompt_tokens",
4467
+ dest: "input_tokens",
4468
+ required: !0
4469
+ },
4470
+ {
4471
+ path: ["prompt_tokens_details", "cached_tokens"],
4472
+ dest: "cache_read_tokens",
4473
+ required: !1
4474
+ },
4475
+ {
4476
+ path: ["prompt_tokens_details", "audio_tokens"],
4477
+ dest: "input_audio_tokens",
4478
+ required: !1
4479
+ },
4480
+ {
4481
+ path: ["completion_tokens_details", "audio_tokens"],
4482
+ dest: "output_audio_tokens",
4483
+ required: !1
4484
+ },
4485
+ {
4486
+ path: "completion_tokens",
4487
+ dest: "output_tokens",
4488
+ required: !0
4489
+ }
4490
+ ]
4491
+ }
4492
+ ],
4493
+ models: [
4494
+ {
4495
+ id: "Qwen/Qwen3-235B-A22B-Instruct-2507",
4496
+ name: "Qwen3-235B-A22B-Instruct-2507",
4497
+ match: {
4498
+ equals: "Qwen/Qwen3-235B-A22B-Instruct-2507"
4499
+ },
4500
+ prices: {
4501
+ input_mtok: 0.6,
4502
+ output_mtok: 1.2
4503
+ }
4504
+ },
4505
+ {
4506
+ id: "Qwen/Qwen3-32B",
4507
+ name: "Qwen3-32B",
4508
+ match: {
4509
+ equals: "Qwen/Qwen3-32B"
4510
+ },
4511
+ prices: {
4512
+ input_mtok: 0.4,
4513
+ output_mtok: 0.8
4514
+ }
4515
+ },
4516
+ {
4517
+ id: "meta-llama/Llama-3.1-8B-Instruct",
4518
+ name: "Llama-3.1-8B-Instruct",
4519
+ match: {
4520
+ equals: "meta-llama/Llama-3.1-8B-Instruct"
4521
+ },
4522
+ prices: {
4523
+ input_mtok: 0.1,
4524
+ output_mtok: 0.1
4525
+ }
4526
+ },
4527
+ {
4528
+ id: "meta-llama/Llama-3.3-70B-Instruct",
4529
+ name: "Llama-3.3-70B-Instruct",
4530
+ match: {
4531
+ equals: "meta-llama/Llama-3.3-70B-Instruct"
4532
+ },
4533
+ prices: {
4534
+ input_mtok: 0.85,
4535
+ output_mtok: 1.2
4536
+ }
4537
+ },
4538
+ {
4539
+ id: "openai/gpt-oss-120b",
4540
+ name: "gpt-oss-120b",
4541
+ match: {
4542
+ equals: "openai/gpt-oss-120b"
4543
+ },
4544
+ prices: {
4545
+ input_mtok: 0.25,
4546
+ output_mtok: 0.69
4547
+ }
4548
+ }
4549
+ ]
4550
+ },
4551
+ {
4552
+ id: "huggingface_fireworks-ai",
4553
+ name: "HuggingFace (fireworks-ai)",
4554
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
4555
+ api_pattern: "https://router\\.huggingface\\.co/fireworks-ai",
4556
+ provider_match: {
4557
+ and: [
4558
+ {
4559
+ contains: "huggingface"
4560
+ },
4561
+ {
4562
+ contains: "fireworks-ai"
4563
+ }
4564
+ ]
4565
+ },
4566
+ extractors: [
4567
+ {
4568
+ api_flavor: "chat",
4569
+ root: "usage",
4570
+ model_path: "model",
4571
+ mappings: [
4572
+ {
4573
+ path: "prompt_tokens",
4574
+ dest: "input_tokens",
4575
+ required: !0
4576
+ },
4577
+ {
4578
+ path: ["prompt_tokens_details", "cached_tokens"],
4579
+ dest: "cache_read_tokens",
4580
+ required: !1
4581
+ },
4582
+ {
4583
+ path: ["prompt_tokens_details", "audio_tokens"],
4584
+ dest: "input_audio_tokens",
4585
+ required: !1
4586
+ },
4587
+ {
4588
+ path: ["completion_tokens_details", "audio_tokens"],
4589
+ dest: "output_audio_tokens",
4590
+ required: !1
4591
+ },
4592
+ {
4593
+ path: "completion_tokens",
4594
+ dest: "output_tokens",
4595
+ required: !0
4596
+ }
4597
+ ]
4598
+ }
4599
+ ],
4600
+ models: [
4601
+ {
4602
+ id: "Qwen/Qwen2.5-VL-32B-Instruct",
4603
+ name: "Qwen2.5-VL-32B-Instruct",
4604
+ match: {
4605
+ equals: "Qwen/Qwen2.5-VL-32B-Instruct"
4606
+ },
4607
+ context_window: 128e3,
4608
+ prices: {
4609
+ input_mtok: 0.22,
4610
+ output_mtok: 0.88
4611
+ }
4612
+ },
4613
+ {
4614
+ id: "Qwen/Qwen3-235B-A22B",
4615
+ name: "Qwen3-235B-A22B",
4616
+ match: {
4617
+ or: [
4618
+ {
4619
+ equals: "Qwen/Qwen3-235B-A22B"
4620
+ },
4621
+ {
4622
+ equals: "Qwen/Qwen3-235B-A22B-Instruct-2507"
4623
+ }
4624
+ ]
4625
+ },
4626
+ context_window: 131072,
4627
+ prices: {
4628
+ input_mtok: 0.22,
4629
+ output_mtok: 0.88
4630
+ }
4631
+ },
4632
+ {
4633
+ id: "Qwen/Qwen3-30B-A3B",
4634
+ name: "Qwen3-30B-A3B",
4635
+ match: {
4636
+ equals: "Qwen/Qwen3-30B-A3B"
4637
+ },
4638
+ context_window: 131072,
4639
+ prices: {
4640
+ input_mtok: 0.15,
4641
+ output_mtok: 0.6
4642
+ }
4643
+ },
4644
+ {
4645
+ id: "Qwen/Qwen3-Coder-480B-A35B-Instruct",
4646
+ name: "Qwen3-Coder-480B-A35B-Instruct",
4647
+ match: {
4648
+ equals: "Qwen/Qwen3-Coder-480B-A35B-Instruct"
4649
+ },
4650
+ context_window: 262144,
4651
+ prices: {
4652
+ input_mtok: 0.45,
4653
+ output_mtok: 1.8
4654
+ }
4655
+ },
4656
+ {
4657
+ id: "SentientAGI/Dobby-Unhinged-Llama-3.3-70B",
4658
+ name: "Dobby-Unhinged-Llama-3.3-70B",
4659
+ match: {
4660
+ equals: "SentientAGI/Dobby-Unhinged-Llama-3.3-70B"
4661
+ },
4662
+ context_window: 131072,
4663
+ prices: {
4664
+ input_mtok: 0.9,
4665
+ output_mtok: 0.9
4666
+ }
4667
+ },
4668
+ {
4669
+ id: "deepseek-ai/DeepSeek-R1-0528",
4670
+ name: "DeepSeek-R1-0528",
4671
+ match: {
4672
+ equals: "deepseek-ai/DeepSeek-R1-0528"
4673
+ },
4674
+ context_window: 163840,
4675
+ prices: {
4676
+ input_mtok: 3,
4677
+ output_mtok: 8
4678
+ }
4679
+ },
4680
+ {
4681
+ id: "deepseek-ai/DeepSeek-V3-0324",
4682
+ name: "DeepSeek-V3-0324",
4683
+ match: {
4684
+ equals: "deepseek-ai/DeepSeek-V3-0324"
4685
+ },
4686
+ context_window: 163840,
4687
+ prices: {
4688
+ input_mtok: 0.9,
4689
+ output_mtok: 0.9
4690
+ }
4691
+ },
4692
+ {
4693
+ id: "meta-llama/Llama-3.1-405B-Instruct",
4694
+ name: "Llama-3.1-405B-Instruct",
4695
+ match: {
4696
+ equals: "meta-llama/Llama-3.1-405B-Instruct"
4697
+ },
4698
+ context_window: 131072,
4699
+ prices: {
4700
+ input_mtok: 3,
4701
+ output_mtok: 3
4702
+ }
4703
+ },
4704
+ {
4705
+ id: "meta-llama/Llama-3.1-70B-Instruct",
4706
+ name: "Llama-3.1-70B-Instruct",
4707
+ match: {
4708
+ equals: "meta-llama/Llama-3.1-70B-Instruct"
4709
+ },
4710
+ context_window: 131072,
4711
+ prices: {
4712
+ input_mtok: 0.9,
4713
+ output_mtok: 0.9
4714
+ }
4715
+ },
4716
+ {
4717
+ id: "meta-llama/Llama-3.1-8B-Instruct",
4718
+ name: "Llama-3.1-8B-Instruct",
4719
+ match: {
4720
+ equals: "meta-llama/Llama-3.1-8B-Instruct"
4721
+ },
4722
+ context_window: 131072,
4723
+ prices: {
4724
+ input_mtok: 0.2,
4725
+ output_mtok: 0.2
4726
+ }
4727
+ },
4728
+ {
4729
+ id: "meta-llama/Llama-3.3-70B-Instruct",
4730
+ name: "Llama-3.3-70B-Instruct",
4731
+ match: {
4732
+ equals: "meta-llama/Llama-3.3-70B-Instruct"
4733
+ },
4734
+ context_window: 131072,
4735
+ prices: {
4736
+ input_mtok: 0.9,
4737
+ output_mtok: 0.9
4738
+ }
4739
+ },
4740
+ {
4741
+ id: "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
4742
+ name: "Llama-4-Maverick-17B-128E-Instruct",
4743
+ match: {
4744
+ equals: "meta-llama/Llama-4-Maverick-17B-128E-Instruct"
4745
+ },
4746
+ context_window: 1048576,
4747
+ prices: {
4748
+ input_mtok: 0.22,
4749
+ output_mtok: 0.88
4750
+ }
4751
+ },
4752
+ {
4753
+ id: "meta-llama/Llama-4-Scout-17B-16E-Instruct",
4754
+ name: "Llama-4-Scout-17B-16E-Instruct",
4755
+ match: {
4756
+ equals: "meta-llama/Llama-4-Scout-17B-16E-Instruct"
4757
+ },
4758
+ context_window: 1048576,
4759
+ prices: {
4760
+ input_mtok: 0.15,
4761
+ output_mtok: 0.6
4762
+ }
4763
+ },
4764
+ {
4765
+ id: "moonshotai/Kimi-K2-Instruct",
4766
+ name: "Kimi-K2-Instruct",
4767
+ match: {
4768
+ equals: "moonshotai/Kimi-K2-Instruct"
4769
+ },
4770
+ context_window: 131072,
4771
+ prices: {
4772
+ input_mtok: 0.6,
4773
+ output_mtok: 2.5
4774
+ }
4775
+ },
4776
+ {
4777
+ id: "openai/gpt-oss-120b",
4778
+ name: "gpt-oss-120b",
4779
+ match: {
4780
+ equals: "openai/gpt-oss-120b"
4781
+ },
4782
+ context_window: 131072,
4783
+ prices: {
4784
+ input_mtok: 0.15,
4785
+ output_mtok: 0.6
4786
+ }
4787
+ },
4788
+ {
4789
+ id: "openai/gpt-oss-20b",
4790
+ name: "gpt-oss-20b",
4791
+ match: {
4792
+ equals: "openai/gpt-oss-20b"
4793
+ },
4794
+ context_window: 131072,
4795
+ prices: {
4796
+ input_mtok: 0.05,
4797
+ output_mtok: 0.2
4798
+ }
4799
+ },
4800
+ {
4801
+ id: "zai-org/GLM-4.5",
4802
+ name: "GLM-4.5",
4803
+ match: {
4804
+ equals: "zai-org/GLM-4.5"
4805
+ },
4806
+ context_window: 131072,
4807
+ prices: {
4808
+ input_mtok: 0.55,
4809
+ output_mtok: 2.19
4810
+ }
4811
+ }
4812
+ ]
4813
+ },
4814
+ {
4815
+ id: "huggingface_groq",
4816
+ name: "HuggingFace (groq)",
4817
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
4818
+ api_pattern: "https://router\\.huggingface\\.co/groq",
4819
+ provider_match: {
4820
+ and: [
4821
+ {
4822
+ contains: "huggingface"
4823
+ },
4824
+ {
4825
+ contains: "groq"
4826
+ }
4827
+ ]
4828
+ },
4829
+ extractors: [
4830
+ {
4831
+ api_flavor: "chat",
4832
+ root: "usage",
4833
+ model_path: "model",
4834
+ mappings: [
4835
+ {
4836
+ path: "prompt_tokens",
4837
+ dest: "input_tokens",
4838
+ required: !0
4839
+ },
4840
+ {
4841
+ path: ["prompt_tokens_details", "cached_tokens"],
4842
+ dest: "cache_read_tokens",
4843
+ required: !1
4844
+ },
4845
+ {
4846
+ path: ["prompt_tokens_details", "audio_tokens"],
4847
+ dest: "input_audio_tokens",
4848
+ required: !1
4849
+ },
4850
+ {
4851
+ path: ["completion_tokens_details", "audio_tokens"],
4852
+ dest: "output_audio_tokens",
4853
+ required: !1
4854
+ },
4855
+ {
4856
+ path: "completion_tokens",
4857
+ dest: "output_tokens",
4858
+ required: !0
4859
+ }
4860
+ ]
4861
+ }
4862
+ ],
4863
+ models: [
4864
+ {
4865
+ id: "Qwen/Qwen3-32B",
4866
+ name: "Qwen3-32B",
4867
+ match: {
4868
+ equals: "Qwen/Qwen3-32B"
4869
+ },
4870
+ context_window: 131072,
4871
+ prices: {
4872
+ input_mtok: 0.29,
4873
+ output_mtok: 0.59
4874
+ }
4875
+ },
4876
+ {
4877
+ id: "meta-llama/Llama-3.3-70B-Instruct",
4878
+ name: "Llama-3.3-70B-Instruct",
4879
+ match: {
4880
+ equals: "meta-llama/Llama-3.3-70B-Instruct"
4881
+ },
4882
+ context_window: 131072,
4883
+ prices: {
4884
+ input_mtok: 0.59,
4885
+ output_mtok: 0.79
4886
+ }
4887
+ },
4888
+ {
4889
+ id: "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
4890
+ name: "Llama-4-Maverick-17B-128E-Instruct",
4891
+ match: {
4892
+ equals: "meta-llama/Llama-4-Maverick-17B-128E-Instruct"
4893
+ },
4894
+ context_window: 131072,
4895
+ prices: {
4896
+ input_mtok: 0.2,
4897
+ output_mtok: 0.6
4898
+ }
4899
+ },
4900
+ {
4901
+ id: "meta-llama/Llama-4-Scout-17B-16E-Instruct",
4902
+ name: "Llama-4-Scout-17B-16E-Instruct",
4903
+ match: {
4904
+ equals: "meta-llama/Llama-4-Scout-17B-16E-Instruct"
4905
+ },
4906
+ context_window: 131072,
4907
+ prices: {
4908
+ input_mtok: 0.11,
4909
+ output_mtok: 0.34
4910
+ }
4911
+ },
4912
+ {
4913
+ id: "meta-llama/Llama-Guard-4-12B",
4914
+ name: "Llama-Guard-4-12B",
4915
+ match: {
4916
+ equals: "meta-llama/Llama-Guard-4-12B"
4917
+ },
4918
+ context_window: 131072,
4919
+ prices: {
4920
+ input_mtok: 0.2,
4921
+ output_mtok: 0.2
4922
+ }
4923
+ },
4924
+ {
4925
+ id: "openai/gpt-oss-120b",
4926
+ name: "gpt-oss-120b",
4927
+ match: {
4928
+ equals: "openai/gpt-oss-120b"
4929
+ },
4930
+ context_window: 131072,
4931
+ prices: {
4932
+ input_mtok: 0.15,
4933
+ output_mtok: 0.75
4934
+ }
4935
+ },
4936
+ {
4937
+ id: "openai/gpt-oss-20b",
4938
+ name: "gpt-oss-20b",
4939
+ match: {
4940
+ equals: "openai/gpt-oss-20b"
4941
+ },
4942
+ context_window: 131072,
4943
+ prices: {
4944
+ input_mtok: 0.1,
4945
+ output_mtok: 0.5
4946
+ }
4947
+ }
4948
+ ]
4949
+ },
4950
+ {
4951
+ id: "huggingface_hyperbolic",
4952
+ name: "HuggingFace (hyperbolic)",
4953
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
4954
+ api_pattern: "https://router\\.huggingface\\.co/hyperbolic",
4955
+ provider_match: {
4956
+ and: [
4957
+ {
4958
+ contains: "huggingface"
4959
+ },
4960
+ {
4961
+ contains: "hyperbolic"
4962
+ }
4963
+ ]
4964
+ },
4965
+ extractors: [
4966
+ {
4967
+ api_flavor: "chat",
4968
+ root: "usage",
4969
+ model_path: "model",
4970
+ mappings: [
4971
+ {
4972
+ path: "prompt_tokens",
4973
+ dest: "input_tokens",
4974
+ required: !0
4975
+ },
4976
+ {
4977
+ path: ["prompt_tokens_details", "cached_tokens"],
4978
+ dest: "cache_read_tokens",
4979
+ required: !1
4980
+ },
4981
+ {
4982
+ path: ["prompt_tokens_details", "audio_tokens"],
4983
+ dest: "input_audio_tokens",
4984
+ required: !1
4985
+ },
4986
+ {
4987
+ path: ["completion_tokens_details", "audio_tokens"],
4988
+ dest: "output_audio_tokens",
4989
+ required: !1
4990
+ },
4991
+ {
4992
+ path: "completion_tokens",
4993
+ dest: "output_tokens",
4994
+ required: !0
4995
+ }
4996
+ ]
4997
+ }
4998
+ ],
4999
+ models: [
5000
+ {
5001
+ id: "Qwen/QwQ-32B",
5002
+ name: "QwQ-32B",
5003
+ match: {
5004
+ equals: "Qwen/QwQ-32B"
5005
+ },
5006
+ context_window: 131072,
5007
+ prices: {
5008
+ input_mtok: 0.4,
5009
+ output_mtok: 0.4
5010
+ }
5011
+ },
5012
+ {
5013
+ id: "Qwen/Qwen2.5-72B-Instruct",
5014
+ name: "Qwen2.5-72B-Instruct",
5015
+ match: {
5016
+ equals: "Qwen/Qwen2.5-72B-Instruct"
5017
+ },
5018
+ context_window: 131072,
5019
+ prices: {
5020
+ input_mtok: 0.4,
5021
+ output_mtok: 0.4
5022
+ }
5023
+ },
5024
+ {
5025
+ id: "Qwen/Qwen2.5-Coder-32B-Instruct",
5026
+ name: "Qwen2.5-Coder-32B-Instruct",
5027
+ match: {
5028
+ equals: "Qwen/Qwen2.5-Coder-32B-Instruct"
5029
+ },
5030
+ context_window: 32768,
5031
+ prices: {
5032
+ input_mtok: 0.2,
5033
+ output_mtok: 0.2
5034
+ }
5035
+ },
5036
+ {
5037
+ id: "Qwen/Qwen2.5-VL-72B-Instruct",
5038
+ name: "Qwen2.5-VL-72B-Instruct",
5039
+ match: {
5040
+ equals: "Qwen/Qwen2.5-VL-72B-Instruct"
5041
+ },
5042
+ context_window: 32768,
5043
+ prices: {
5044
+ input_mtok: 0.6,
5045
+ output_mtok: 0.6
5046
+ }
5047
+ },
5048
+ {
5049
+ id: "Qwen/Qwen2.5-VL-7B-Instruct",
5050
+ name: "Qwen2.5-VL-7B-Instruct",
5051
+ match: {
5052
+ equals: "Qwen/Qwen2.5-VL-7B-Instruct"
5053
+ },
5054
+ context_window: 32768,
5055
+ prices: {
5056
+ input_mtok: 0.2,
5057
+ output_mtok: 0.2
5058
+ }
5059
+ },
5060
+ {
5061
+ id: "Qwen/Qwen3-235B-A22B-Instruct-2507",
5062
+ name: "Qwen3-235B-A22B-Instruct-2507",
5063
+ match: {
5064
+ equals: "Qwen/Qwen3-235B-A22B-Instruct-2507"
5065
+ },
5066
+ context_window: 262144,
5067
+ prices: {
5068
+ input_mtok: 2,
5069
+ output_mtok: 2
5070
+ }
5071
+ },
5072
+ {
5073
+ id: "Qwen/Qwen3-Coder-480B-A35B-Instruct",
5074
+ name: "Qwen3-Coder-480B-A35B-Instruct",
5075
+ match: {
5076
+ equals: "Qwen/Qwen3-Coder-480B-A35B-Instruct"
5077
+ },
5078
+ context_window: 262144,
5079
+ prices: {
5080
+ input_mtok: 2,
5081
+ output_mtok: 2
5082
+ }
5083
+ },
5084
+ {
5085
+ id: "Qwen/Qwen3-Next-80B-A3B-Instruct",
5086
+ name: "Qwen3-Next-80B-A3B-Instruct",
5087
+ match: {
5088
+ equals: "Qwen/Qwen3-Next-80B-A3B-Instruct"
5089
+ },
5090
+ context_window: 262144,
5091
+ prices: {
5092
+ input_mtok: 0.3,
5093
+ output_mtok: 0.3
5094
+ }
5095
+ },
5096
+ {
5097
+ id: "Qwen/Qwen3-Next-80B-A3B-Thinking",
5098
+ name: "Qwen3-Next-80B-A3B-Thinking",
5099
+ match: {
5100
+ equals: "Qwen/Qwen3-Next-80B-A3B-Thinking"
5101
+ },
5102
+ context_window: 262144,
5103
+ prices: {
5104
+ input_mtok: 0.3,
5105
+ output_mtok: 0.3
5106
+ }
5107
+ },
5108
+ {
5109
+ id: "deepseek-ai/DeepSeek-R1",
5110
+ name: "DeepSeek-R1",
5111
+ match: {
5112
+ equals: "deepseek-ai/DeepSeek-R1"
5113
+ },
5114
+ context_window: 163840,
5115
+ prices: {
5116
+ input_mtok: 2,
5117
+ output_mtok: 2
5118
+ }
5119
+ },
5120
+ {
5121
+ id: "deepseek-ai/DeepSeek-R1-0528",
5122
+ name: "DeepSeek-R1-0528",
5123
+ match: {
5124
+ equals: "deepseek-ai/DeepSeek-R1-0528"
5125
+ },
5126
+ context_window: 163840,
5127
+ prices: {
5128
+ input_mtok: 3,
5129
+ output_mtok: 3
5130
+ }
5131
+ },
5132
+ {
5133
+ id: "deepseek-ai/DeepSeek-V3-0324",
5134
+ name: "DeepSeek-V3-0324",
5135
+ match: {
5136
+ equals: "deepseek-ai/DeepSeek-V3-0324"
5137
+ },
5138
+ context_window: 163840,
5139
+ prices: {
5140
+ input_mtok: 1.25,
5141
+ output_mtok: 1.25
5142
+ }
5143
+ },
5144
+ {
5145
+ id: "meta-llama/Llama-3.1-70B-Instruct",
5146
+ name: "Llama-3.1-70B-Instruct",
5147
+ match: {
5148
+ equals: "meta-llama/Llama-3.1-70B-Instruct"
5149
+ },
5150
+ context_window: 131072,
5151
+ prices: {
5152
+ input_mtok: 0.4,
5153
+ output_mtok: 0.4
5154
+ }
5155
+ },
5156
+ {
5157
+ id: "meta-llama/Llama-3.1-8B-Instruct",
5158
+ name: "Llama-3.1-8B-Instruct",
5159
+ match: {
5160
+ equals: "meta-llama/Llama-3.1-8B-Instruct"
5161
+ },
5162
+ context_window: 131072,
5163
+ prices: {
5164
+ input_mtok: 0.1,
5165
+ output_mtok: 0.1
5166
+ }
5167
+ },
5168
+ {
5169
+ id: "meta-llama/Llama-3.2-3B-Instruct",
5170
+ name: "Llama-3.2-3B-Instruct",
5171
+ match: {
5172
+ equals: "meta-llama/Llama-3.2-3B-Instruct"
5173
+ },
5174
+ context_window: 131072,
5175
+ prices: {
5176
+ input_mtok: 0.1,
5177
+ output_mtok: 0.1
5178
+ }
5179
+ },
5180
+ {
5181
+ id: "meta-llama/Llama-3.3-70B-Instruct",
5182
+ name: "Llama-3.3-70B-Instruct",
5183
+ match: {
5184
+ equals: "meta-llama/Llama-3.3-70B-Instruct"
5185
+ },
5186
+ context_window: 131072,
5187
+ prices: {
5188
+ input_mtok: 0.4,
5189
+ output_mtok: 0.4
5190
+ }
5191
+ },
5192
+ {
5193
+ id: "meta-llama/Meta-Llama-3-70B-Instruct",
5194
+ name: "Meta-Llama-3-70B-Instruct",
5195
+ match: {
5196
+ equals: "meta-llama/Meta-Llama-3-70B-Instruct"
5197
+ },
5198
+ context_window: 8192,
5199
+ prices: {
5200
+ input_mtok: 0.4,
5201
+ output_mtok: 0.4
5202
+ }
5203
+ },
5204
+ {
5205
+ id: "openai/gpt-oss-120b",
5206
+ name: "gpt-oss-120b",
5207
+ match: {
5208
+ equals: "openai/gpt-oss-120b"
5209
+ },
5210
+ context_window: 131072,
5211
+ prices: {
5212
+ input_mtok: 0.3,
5213
+ output_mtok: 0.3
5214
+ }
5215
+ },
5216
+ {
5217
+ id: "openai/gpt-oss-20b",
5218
+ name: "gpt-oss-20b",
5219
+ match: {
5220
+ equals: "openai/gpt-oss-20b"
5221
+ },
5222
+ context_window: 131072,
5223
+ prices: {
5224
+ input_mtok: 0.1,
5225
+ output_mtok: 0.1
5226
+ }
5227
+ }
5228
+ ]
5229
+ },
5230
+ {
5231
+ id: "huggingface_nebius",
5232
+ name: "HuggingFace (nebius)",
5233
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
5234
+ api_pattern: "https://router\\.huggingface\\.co/nebius",
5235
+ provider_match: {
5236
+ and: [
5237
+ {
5238
+ contains: "huggingface"
5239
+ },
5240
+ {
5241
+ contains: "nebius"
5242
+ }
5243
+ ]
5244
+ },
5245
+ extractors: [
5246
+ {
5247
+ api_flavor: "chat",
5248
+ root: "usage",
5249
+ model_path: "model",
5250
+ mappings: [
5251
+ {
5252
+ path: "prompt_tokens",
5253
+ dest: "input_tokens",
5254
+ required: !0
5255
+ },
5256
+ {
5257
+ path: ["prompt_tokens_details", "cached_tokens"],
5258
+ dest: "cache_read_tokens",
5259
+ required: !1
5260
+ },
5261
+ {
5262
+ path: ["prompt_tokens_details", "audio_tokens"],
5263
+ dest: "input_audio_tokens",
5264
+ required: !1
5265
+ },
5266
+ {
5267
+ path: ["completion_tokens_details", "audio_tokens"],
5268
+ dest: "output_audio_tokens",
5269
+ required: !1
5270
+ },
5271
+ {
5272
+ path: "completion_tokens",
5273
+ dest: "output_tokens",
5274
+ required: !0
5275
+ }
5276
+ ]
5277
+ }
5278
+ ],
5279
+ models: [
5280
+ {
5281
+ id: "NousResearch/Hermes-4-405B",
5282
+ name: "Hermes-4-405B",
5283
+ match: {
5284
+ equals: "NousResearch/Hermes-4-405B"
5285
+ },
5286
+ context_window: 131072,
5287
+ prices: {
5288
+ input_mtok: 1,
5289
+ output_mtok: 3
5290
+ }
5291
+ },
5292
+ {
5293
+ id: "NousResearch/Hermes-4-70B",
5294
+ name: "Hermes-4-70B",
5295
+ match: {
5296
+ equals: "NousResearch/Hermes-4-70B"
5297
+ },
5298
+ context_window: 131072,
5299
+ prices: {
5300
+ input_mtok: 0.13,
5301
+ output_mtok: 0.4
5302
+ }
5303
+ },
5304
+ {
5305
+ id: "Qwen/Qwen2.5-Coder-7B",
5306
+ name: "Qwen2.5-Coder-7B",
5307
+ match: {
5308
+ equals: "Qwen/Qwen2.5-Coder-7B"
5309
+ },
5310
+ context_window: 32768,
5311
+ prices: {
5312
+ input_mtok: 0.03,
5313
+ output_mtok: 0.09
5314
+ }
5315
+ },
5316
+ {
5317
+ id: "Qwen/Qwen2.5-VL-72B-Instruct",
5318
+ name: "Qwen2.5-VL-72B-Instruct",
5319
+ match: {
5320
+ equals: "Qwen/Qwen2.5-VL-72B-Instruct"
5321
+ },
5322
+ context_window: 32e3,
5323
+ prices: {
5324
+ input_mtok: 0.25,
5325
+ output_mtok: 0.75
5326
+ }
5327
+ },
5328
+ {
5329
+ id: "Qwen/Qwen3-235B-A22B-Instruct-2507",
5330
+ name: "Qwen3-235B-A22B-Instruct-2507",
5331
+ match: {
5332
+ equals: "Qwen/Qwen3-235B-A22B-Instruct-2507"
5333
+ },
5334
+ context_window: 262144,
5335
+ prices: {
5336
+ input_mtok: 0.2,
5337
+ output_mtok: 0.6
5338
+ }
5339
+ },
5340
+ {
5341
+ id: "Qwen/Qwen3-30B-A3B-Instruct-2507",
5342
+ name: "Qwen3-30B-A3B-Instruct-2507",
5343
+ match: {
5344
+ equals: "Qwen/Qwen3-30B-A3B-Instruct-2507"
5345
+ },
5346
+ context_window: 262144,
5347
+ prices: {
5348
+ input_mtok: 0.1,
5349
+ output_mtok: 0.3
5350
+ }
5351
+ },
5352
+ {
5353
+ id: "Qwen/Qwen3-30B-A3B-Thinking-2507",
5354
+ name: "Qwen3-30B-A3B-Thinking-2507",
5355
+ match: {
5356
+ equals: "Qwen/Qwen3-30B-A3B-Thinking-2507"
5357
+ },
5358
+ context_window: 262144,
5359
+ prices: {
5360
+ input_mtok: 0.1,
5361
+ output_mtok: 0.3
5362
+ }
5363
+ },
5364
+ {
5365
+ id: "Qwen/Qwen3-32B",
5366
+ name: "Qwen3-32B",
5367
+ match: {
5368
+ equals: "Qwen/Qwen3-32B"
5369
+ },
5370
+ context_window: 40960,
5371
+ prices: {
5372
+ input_mtok: 0.1,
5373
+ output_mtok: 0.3
5374
+ }
5375
+ },
5376
+ {
5377
+ id: "Qwen/Qwen3-Coder-30B-A3B-Instruct",
5378
+ name: "Qwen3-Coder-30B-A3B-Instruct",
5379
+ match: {
5380
+ equals: "Qwen/Qwen3-Coder-30B-A3B-Instruct"
5381
+ },
5382
+ context_window: 262144,
5383
+ prices: {
5384
+ input_mtok: 0.1,
5385
+ output_mtok: 0.3
5386
+ }
5387
+ },
5388
+ {
5389
+ id: "Qwen/Qwen3-Coder-480B-A35B-Instruct",
5390
+ name: "Qwen3-Coder-480B-A35B-Instruct",
5391
+ match: {
5392
+ equals: "Qwen/Qwen3-Coder-480B-A35B-Instruct"
5393
+ },
5394
+ context_window: 262144,
5395
+ prices: {
5396
+ input_mtok: 0.4,
5397
+ output_mtok: 1.8
5398
+ }
5399
+ },
5400
+ {
5401
+ id: "deepseek-ai/DeepSeek-R1-0528",
5402
+ name: "DeepSeek-R1-0528",
5403
+ match: {
5404
+ equals: "deepseek-ai/DeepSeek-R1-0528"
5405
+ },
5406
+ context_window: 163840,
5407
+ prices: {
5408
+ input_mtok: 0.8,
5409
+ output_mtok: 2.4
5410
+ }
5411
+ },
5412
+ {
5413
+ id: "deepseek-ai/DeepSeek-V3-0324",
5414
+ name: "DeepSeek-V3-0324",
5415
+ match: {
5416
+ equals: "deepseek-ai/DeepSeek-V3-0324"
5417
+ },
5418
+ context_window: 32768,
5419
+ prices: {
5420
+ input_mtok: 0.75,
5421
+ output_mtok: 2.25
5422
+ }
5423
+ },
5424
+ {
5425
+ id: "google/gemma-2-2b-it",
5426
+ name: "gemma-2-2b-it",
5427
+ match: {
5428
+ equals: "google/gemma-2-2b-it"
5429
+ },
5430
+ context_window: 8192,
5431
+ prices: {
5432
+ input_mtok: 0.02,
5433
+ output_mtok: 0.06
5434
+ }
5435
+ },
5436
+ {
5437
+ id: "google/gemma-2-9b-it",
5438
+ name: "gemma-2-9b-it",
5439
+ match: {
5440
+ equals: "google/gemma-2-9b-it"
5441
+ },
5442
+ context_window: 8192,
5443
+ prices: {
5444
+ input_mtok: 0.03,
5445
+ output_mtok: 0.09
5446
+ }
5447
+ },
5448
+ {
5449
+ id: "google/gemma-3-27b-it",
5450
+ name: "gemma-3-27b-it",
5451
+ match: {
5452
+ equals: "google/gemma-3-27b-it"
5453
+ },
5454
+ context_window: 11e4,
5455
+ prices: {
5456
+ input_mtok: 0.2,
5457
+ output_mtok: 0.6
5458
+ }
5459
+ },
5460
+ {
5461
+ id: "meta-llama/Llama-3.1-8B-Instruct",
5462
+ name: "Llama-3.1-8B-Instruct",
5463
+ match: {
5464
+ equals: "meta-llama/Llama-3.1-8B-Instruct"
5465
+ },
5466
+ context_window: 131072,
5467
+ prices: {
5468
+ input_mtok: 0.03,
5469
+ output_mtok: 0.09
5470
+ }
5471
+ },
5472
+ {
5473
+ id: "meta-llama/Llama-3.3-70B-Instruct",
5474
+ name: "Llama-3.3-70B-Instruct",
5475
+ match: {
5476
+ equals: "meta-llama/Llama-3.3-70B-Instruct"
5477
+ },
5478
+ context_window: 131072,
5479
+ prices: {
5480
+ input_mtok: 0.25,
5481
+ output_mtok: 0.75
5482
+ }
5483
+ },
5484
+ {
5485
+ id: "moonshotai/Kimi-K2-Instruct",
5486
+ name: "Kimi-K2-Instruct",
5487
+ match: {
5488
+ equals: "moonshotai/Kimi-K2-Instruct"
5489
+ },
5490
+ context_window: 131072,
5491
+ prices: {
5492
+ input_mtok: 0.5,
5493
+ output_mtok: 2.4
5494
+ }
5495
+ },
5496
+ {
5497
+ id: "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1",
5498
+ name: "Llama-3_1-Nemotron-Ultra-253B-v1",
5499
+ match: {
5500
+ equals: "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1"
5501
+ },
5502
+ context_window: 131072,
5503
+ prices: {
5504
+ input_mtok: 0.6,
5505
+ output_mtok: 1.8
5506
+ }
5507
+ },
5508
+ {
5509
+ id: "nvidia/NVIDIA-Nemotron-Nano-12B-v2",
5510
+ name: "NVIDIA-Nemotron-Nano-12B-v2",
5511
+ match: {
5512
+ equals: "nvidia/NVIDIA-Nemotron-Nano-12B-v2"
5513
+ },
5514
+ context_window: 131072,
5515
+ prices: {
5516
+ input_mtok: 0.07,
5517
+ output_mtok: 0.2
5518
+ }
5519
+ },
5520
+ {
5521
+ id: "openai/gpt-oss-120b",
5522
+ name: "gpt-oss-120b",
5523
+ match: {
5524
+ equals: "openai/gpt-oss-120b"
5525
+ },
5526
+ context_window: 131072,
5527
+ prices: {
5528
+ input_mtok: 0.15,
5529
+ output_mtok: 0.6
5530
+ }
5531
+ },
5532
+ {
5533
+ id: "openai/gpt-oss-20b",
5534
+ name: "gpt-oss-20b",
5535
+ match: {
5536
+ equals: "openai/gpt-oss-20b"
5537
+ },
5538
+ context_window: 131072,
5539
+ prices: {
5540
+ input_mtok: 0.05,
5541
+ output_mtok: 0.2
5542
+ }
5543
+ },
5544
+ {
5545
+ id: "zai-org/GLM-4.5",
5546
+ name: "GLM-4.5",
5547
+ match: {
5548
+ equals: "zai-org/GLM-4.5"
5549
+ },
5550
+ context_window: 131072,
5551
+ prices: {
5552
+ input_mtok: 0.6,
5553
+ output_mtok: 2.2
5554
+ }
5555
+ },
5556
+ {
5557
+ id: "zai-org/GLM-4.5-Air",
5558
+ name: "GLM-4.5-Air",
5559
+ match: {
5560
+ equals: "zai-org/GLM-4.5-Air"
5561
+ },
5562
+ context_window: 131072,
5563
+ prices: {
5564
+ input_mtok: 0.2,
5565
+ output_mtok: 1.2
5566
+ }
5567
+ }
5568
+ ]
5569
+ },
5570
+ {
5571
+ id: "huggingface_novita",
5572
+ name: "HuggingFace (novita)",
5573
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
5574
+ api_pattern: "https://router\\.huggingface\\.co/novita",
5575
+ provider_match: {
5576
+ and: [
5577
+ {
5578
+ contains: "huggingface"
5579
+ },
5580
+ {
5581
+ contains: "novita"
5582
+ }
5583
+ ]
5584
+ },
5585
+ extractors: [
5586
+ {
5587
+ api_flavor: "chat",
5588
+ root: "usage",
5589
+ model_path: "model",
5590
+ mappings: [
5591
+ {
5592
+ path: "prompt_tokens",
5593
+ dest: "input_tokens",
5594
+ required: !0
5595
+ },
5596
+ {
5597
+ path: ["prompt_tokens_details", "cached_tokens"],
5598
+ dest: "cache_read_tokens",
5599
+ required: !1
5600
+ },
5601
+ {
5602
+ path: ["prompt_tokens_details", "audio_tokens"],
5603
+ dest: "input_audio_tokens",
5604
+ required: !1
5605
+ },
5606
+ {
5607
+ path: ["completion_tokens_details", "audio_tokens"],
5608
+ dest: "output_audio_tokens",
5609
+ required: !1
5610
+ },
5611
+ {
5612
+ path: "completion_tokens",
5613
+ dest: "output_tokens",
5614
+ required: !0
5615
+ }
5616
+ ]
5617
+ }
5618
+ ],
5619
+ models: [
5620
+ {
5621
+ id: "MiniMaxAI/MiniMax-M1-80k",
5622
+ name: "MiniMax-M1-80k",
5623
+ match: {
5624
+ equals: "MiniMaxAI/MiniMax-M1-80k"
5625
+ },
5626
+ context_window: 1e6,
5627
+ prices: {
5628
+ input_mtok: 0.44,
5629
+ output_mtok: 1.76
5630
+ }
5631
+ },
5632
+ {
5633
+ id: "MiniMaxAI/MiniMax-M2",
5634
+ name: "MiniMax-M2",
5635
+ match: {
5636
+ equals: "MiniMaxAI/MiniMax-M2"
5637
+ },
5638
+ context_window: 204800,
5639
+ prices: {
5640
+ input_mtok: 0.24,
5641
+ output_mtok: 0.96
5642
+ }
5643
+ },
5644
+ {
5645
+ id: "NousResearch/Hermes-2-Pro-Llama-3-8B",
5646
+ name: "Hermes-2-Pro-Llama-3-8B",
5647
+ match: {
5648
+ equals: "NousResearch/Hermes-2-Pro-Llama-3-8B"
5649
+ },
5650
+ context_window: 8192,
5651
+ prices: {
5652
+ input_mtok: 0.14,
5653
+ output_mtok: 0.14
5654
+ }
5655
+ },
5656
+ {
5657
+ id: "Qwen/Qwen2.5-72B-Instruct",
5658
+ name: "Qwen2.5-72B-Instruct",
5659
+ match: {
5660
+ equals: "Qwen/Qwen2.5-72B-Instruct"
5661
+ },
5662
+ context_window: 32e3,
5663
+ prices: {
5664
+ input_mtok: 0.304,
5665
+ output_mtok: 0.32
5666
+ }
5667
+ },
5668
+ {
5669
+ id: "Qwen/Qwen3-235B-A22B",
5670
+ name: "Qwen3-235B-A22B",
5671
+ match: {
5672
+ equals: "Qwen/Qwen3-235B-A22B"
5673
+ },
5674
+ context_window: 40960,
5675
+ prices: {
5676
+ input_mtok: 0.16,
5677
+ output_mtok: 0.64
5678
+ }
5679
+ },
5680
+ {
5681
+ id: "Qwen/Qwen3-235B-A22B-Instruct-2507",
5682
+ name: "Qwen3-235B-A22B-Instruct-2507",
5683
+ match: {
5684
+ equals: "Qwen/Qwen3-235B-A22B-Instruct-2507"
5685
+ },
5686
+ context_window: 131072,
5687
+ prices: {
5688
+ input_mtok: 0.072,
5689
+ output_mtok: 0.464
5690
+ }
5691
+ },
5692
+ {
5693
+ id: "Qwen/Qwen3-235B-A22B-Thinking-2507",
5694
+ name: "Qwen3-235B-A22B-Thinking-2507",
5695
+ match: {
5696
+ equals: "Qwen/Qwen3-235B-A22B-Thinking-2507"
5697
+ },
5698
+ context_window: 131072,
5699
+ prices: {
5700
+ input_mtok: 0.24,
5701
+ output_mtok: 2.4
5702
+ }
5703
+ },
5704
+ {
5705
+ id: "Qwen/Qwen3-30B-A3B",
5706
+ name: "Qwen3-30B-A3B",
5707
+ match: {
5708
+ equals: "Qwen/Qwen3-30B-A3B"
5709
+ },
5710
+ context_window: 40960,
5711
+ prices: {
5712
+ input_mtok: 0.072,
5713
+ output_mtok: 0.36
5714
+ }
5715
+ },
5716
+ {
5717
+ id: "Qwen/Qwen3-32B",
5718
+ name: "Qwen3-32B",
5719
+ match: {
5720
+ equals: "Qwen/Qwen3-32B"
5721
+ },
5722
+ context_window: 40960,
5723
+ prices: {
5724
+ input_mtok: 0.08,
5725
+ output_mtok: 0.36
5726
+ }
5727
+ },
5728
+ {
5729
+ id: "Qwen/Qwen3-Coder-480B-A35B-Instruct",
5730
+ name: "Qwen3-Coder-480B-A35B-Instruct",
5731
+ match: {
5732
+ equals: "Qwen/Qwen3-Coder-480B-A35B-Instruct"
5733
+ },
5734
+ context_window: 262144,
5735
+ prices: {
5736
+ input_mtok: 0.232,
5737
+ output_mtok: 0.96
5738
+ }
5739
+ },
5740
+ {
5741
+ id: "Qwen/Qwen3-Next-80B-A3B-Instruct",
5742
+ name: "Qwen3-Next-80B-A3B-Instruct",
5743
+ match: {
5744
+ equals: "Qwen/Qwen3-Next-80B-A3B-Instruct"
5745
+ },
5746
+ context_window: 131072,
5747
+ prices: {
5748
+ input_mtok: 0.12,
5749
+ output_mtok: 1.2
5750
+ }
5751
+ },
5752
+ {
5753
+ id: "Qwen/Qwen3-Next-80B-A3B-Thinking",
5754
+ name: "Qwen3-Next-80B-A3B-Thinking",
5755
+ match: {
5756
+ equals: "Qwen/Qwen3-Next-80B-A3B-Thinking"
5757
+ },
5758
+ context_window: 131072,
5759
+ prices: {
5760
+ input_mtok: 0.12,
5761
+ output_mtok: 1.2
5762
+ }
5763
+ },
5764
+ {
5765
+ id: "Qwen/Qwen3-VL-235B-A22B-Instruct",
5766
+ name: "Qwen3-VL-235B-A22B-Instruct",
5767
+ match: {
5768
+ equals: "Qwen/Qwen3-VL-235B-A22B-Instruct"
5769
+ },
5770
+ context_window: 131072,
5771
+ prices: {
5772
+ input_mtok: 0.24,
5773
+ output_mtok: 1.2
5774
+ }
5775
+ },
5776
+ {
5777
+ id: "Qwen/Qwen3-VL-235B-A22B-Thinking",
5778
+ name: "Qwen3-VL-235B-A22B-Thinking",
5779
+ match: {
5780
+ equals: "Qwen/Qwen3-VL-235B-A22B-Thinking"
5781
+ },
5782
+ context_window: 131072,
5783
+ prices: {
5784
+ input_mtok: 0.784,
5785
+ output_mtok: 3.16
5786
+ }
5787
+ },
5788
+ {
5789
+ id: "Qwen/Qwen3-VL-30B-A3B-Instruct",
5790
+ name: "Qwen3-VL-30B-A3B-Instruct",
5791
+ match: {
5792
+ equals: "Qwen/Qwen3-VL-30B-A3B-Instruct"
5793
+ },
5794
+ context_window: 131072,
5795
+ prices: {
5796
+ input_mtok: 0.16,
5797
+ output_mtok: 0.56
5798
+ }
5799
+ },
5800
+ {
5801
+ id: "Qwen/Qwen3-VL-30B-A3B-Thinking",
5802
+ name: "Qwen3-VL-30B-A3B-Thinking",
5803
+ match: {
5804
+ equals: "Qwen/Qwen3-VL-30B-A3B-Thinking"
5805
+ },
5806
+ context_window: 131072,
5807
+ prices: {
5808
+ input_mtok: 0.16,
5809
+ output_mtok: 0.8
5810
+ }
5811
+ },
5812
+ {
5813
+ id: "Qwen/Qwen3-VL-8B-Instruct",
5814
+ name: "Qwen3-VL-8B-Instruct",
5815
+ match: {
5816
+ equals: "Qwen/Qwen3-VL-8B-Instruct"
5817
+ },
5818
+ context_window: 131072,
5819
+ prices: {
5820
+ input_mtok: 0.064,
5821
+ output_mtok: 0.4
5822
+ }
5823
+ },
5824
+ {
5825
+ id: "Sao10K/L3-70B-Euryale-v2.1",
5826
+ name: "L3-70B-Euryale-v2.1",
5827
+ match: {
5828
+ equals: "Sao10K/L3-70B-Euryale-v2.1"
5829
+ },
5830
+ context_window: 8192,
5831
+ prices: {
5832
+ input_mtok: 1.48,
5833
+ output_mtok: 1.48
5834
+ }
5835
+ },
5836
+ {
5837
+ id: "Sao10K/L3-8B-Lunaris-v1",
5838
+ name: "L3-8B-Lunaris-v1",
5839
+ match: {
5840
+ equals: "Sao10K/L3-8B-Lunaris-v1"
5841
+ },
5842
+ context_window: 8192,
5843
+ prices: {
5844
+ input_mtok: 0.05,
5845
+ output_mtok: 0.05
5846
+ }
5847
+ },
5848
+ {
5849
+ id: "Sao10K/L3-8B-Stheno-v3.2",
5850
+ name: "L3-8B-Stheno-v3.2",
5851
+ match: {
5852
+ equals: "Sao10K/L3-8B-Stheno-v3.2"
5853
+ },
5854
+ context_window: 8192,
5855
+ prices: {
5856
+ input_mtok: 0.05,
5857
+ output_mtok: 0.05
5858
+ }
5859
+ },
5860
+ {
5861
+ id: "alpindale/WizardLM-2-8x22B",
5862
+ name: "WizardLM-2-8x22B",
5863
+ match: {
5864
+ equals: "alpindale/WizardLM-2-8x22B"
5865
+ },
5866
+ context_window: 65535,
5867
+ prices: {
5868
+ input_mtok: 0.496,
5869
+ output_mtok: 0.496
5870
+ }
5871
+ },
5872
+ {
5873
+ id: "baichuan-inc/Baichuan-M2-32B",
5874
+ name: "Baichuan-M2-32B",
5875
+ match: {
5876
+ equals: "baichuan-inc/Baichuan-M2-32B"
5877
+ },
5878
+ context_window: 131072,
5879
+ prices: {
5880
+ input_mtok: 0.056,
5881
+ output_mtok: 0.056
5882
+ }
5883
+ },
5884
+ {
5885
+ id: "baidu/ERNIE-4.5-21B-A3B-PT",
5886
+ name: "ERNIE-4.5-21B-A3B-PT",
5887
+ match: {
5888
+ equals: "baidu/ERNIE-4.5-21B-A3B-PT"
5889
+ },
5890
+ context_window: 12e4,
5891
+ prices: {
5892
+ input_mtok: 0.056,
5893
+ output_mtok: 0.224
5894
+ }
5895
+ },
5896
+ {
5897
+ id: "baidu/ERNIE-4.5-300B-A47B-Base-PT",
5898
+ name: "ERNIE-4.5-300B-A47B-Base-PT",
5899
+ match: {
5900
+ equals: "baidu/ERNIE-4.5-300B-A47B-Base-PT"
5901
+ },
5902
+ context_window: 123e3,
5903
+ prices: {
5904
+ input_mtok: 0.224,
5905
+ output_mtok: 0.88
5906
+ }
5907
+ },
5908
+ {
5909
+ id: "baidu/ERNIE-4.5-VL-28B-A3B-PT",
5910
+ name: "ERNIE-4.5-VL-28B-A3B-PT",
5911
+ match: {
5912
+ equals: "baidu/ERNIE-4.5-VL-28B-A3B-PT"
5913
+ },
5914
+ context_window: 3e4,
5915
+ prices: {
5916
+ input_mtok: 0.112,
5917
+ output_mtok: 0.448
5918
+ }
5919
+ },
5920
+ {
5921
+ id: "baidu/ERNIE-4.5-VL-424B-A47B-Base-PT",
5922
+ name: "ERNIE-4.5-VL-424B-A47B-Base-PT",
5923
+ match: {
5924
+ equals: "baidu/ERNIE-4.5-VL-424B-A47B-Base-PT"
5925
+ },
5926
+ context_window: 123e3,
5927
+ prices: {
5928
+ input_mtok: 0.336,
5929
+ output_mtok: 1
5930
+ }
5931
+ },
5932
+ {
5933
+ id: "deepseek-ai/DeepSeek-Prover-V2-671B",
5934
+ name: "DeepSeek-Prover-V2-671B",
5935
+ match: {
5936
+ equals: "deepseek-ai/DeepSeek-Prover-V2-671B"
5937
+ },
5938
+ context_window: 16e4,
5939
+ prices: {
5940
+ input_mtok: 0.56,
5941
+ output_mtok: 2
5942
+ }
5943
+ },
5944
+ {
5945
+ id: "deepseek-ai/DeepSeek-R1",
5946
+ name: "DeepSeek-R1",
5947
+ match: {
5948
+ or: [
5949
+ {
5950
+ equals: "deepseek-ai/DeepSeek-R1"
5951
+ },
5952
+ {
5953
+ equals: "deepseek-ai/DeepSeek-R1-0528"
5954
+ }
5955
+ ]
5956
+ },
5957
+ context_window: 64e3,
5958
+ prices: {
5959
+ input_mtok: 0.56,
5960
+ output_mtok: 2
5961
+ }
5962
+ },
5963
+ {
5964
+ id: "deepseek-ai/DeepSeek-R1-0528-Qwen3-8B",
5965
+ name: "DeepSeek-R1-0528-Qwen3-8B",
5966
+ match: {
5967
+ equals: "deepseek-ai/DeepSeek-R1-0528-Qwen3-8B"
5968
+ },
5969
+ context_window: 128e3,
5970
+ prices: {
5971
+ input_mtok: 0.06,
5972
+ output_mtok: 0.09
5973
+ }
5974
+ },
5975
+ {
5976
+ id: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
5977
+ name: "DeepSeek-R1-Distill-Llama-70B",
5978
+ match: {
5979
+ equals: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B"
5980
+ },
5981
+ context_window: 8192,
5982
+ prices: {
5983
+ input_mtok: 0.64,
5984
+ output_mtok: 0.64
5985
+ }
5986
+ },
5987
+ {
5988
+ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B",
5989
+ name: "DeepSeek-R1-Distill-Qwen-14B",
5990
+ match: {
5991
+ equals: "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B"
5992
+ },
5993
+ context_window: 32768,
5994
+ prices: {
5995
+ input_mtok: 0.15,
5996
+ output_mtok: 0.15
5997
+ }
5998
+ },
5999
+ {
6000
+ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
6001
+ name: "DeepSeek-R1-Distill-Qwen-32B",
6002
+ match: {
6003
+ equals: "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B"
6004
+ },
6005
+ context_window: 64e3,
6006
+ prices: {
6007
+ input_mtok: 0.24,
6008
+ output_mtok: 0.24
6009
+ }
6010
+ },
6011
+ {
6012
+ id: "deepseek-ai/DeepSeek-V3",
6013
+ name: "DeepSeek-V3",
6014
+ match: {
6015
+ equals: "deepseek-ai/DeepSeek-V3"
6016
+ },
6017
+ context_window: 64e3,
6018
+ prices: {
6019
+ input_mtok: 0.32,
6020
+ output_mtok: 1.04
6021
+ }
6022
+ },
6023
+ {
6024
+ id: "deepseek-ai/DeepSeek-V3-0324",
6025
+ name: "DeepSeek-V3-0324",
6026
+ match: {
6027
+ equals: "deepseek-ai/DeepSeek-V3-0324"
6028
+ },
6029
+ context_window: 163840,
6030
+ prices: {
6031
+ input_mtok: 0.216,
6032
+ output_mtok: 0.896
6033
+ }
6034
+ },
6035
+ {
6036
+ id: "deepseek-ai/DeepSeek-V3.1",
6037
+ name: "DeepSeek-V3.1",
6038
+ match: {
6039
+ or: [
6040
+ {
6041
+ equals: "deepseek-ai/DeepSeek-V3.1"
6042
+ },
6043
+ {
6044
+ equals: "deepseek-ai/DeepSeek-V3.1-Terminus"
6045
+ }
6046
+ ]
6047
+ },
6048
+ context_window: 131072,
6049
+ prices: {
6050
+ input_mtok: 0.216,
6051
+ output_mtok: 0.8
6052
+ }
6053
+ },
6054
+ {
6055
+ id: "deepseek-ai/DeepSeek-V3.2-Exp",
6056
+ name: "DeepSeek-V3.2-Exp",
6057
+ match: {
6058
+ equals: "deepseek-ai/DeepSeek-V3.2-Exp"
6059
+ },
6060
+ context_window: 163840,
6061
+ prices: {
6062
+ input_mtok: 0.216,
6063
+ output_mtok: 0.328
6064
+ }
6065
+ },
6066
+ {
6067
+ id: "meta-llama/Llama-3.1-8B-Instruct",
6068
+ name: "Llama-3.1-8B-Instruct",
6069
+ match: {
6070
+ equals: "meta-llama/Llama-3.1-8B-Instruct"
6071
+ },
6072
+ context_window: 16384,
6073
+ prices: {
6074
+ input_mtok: 0.02,
6075
+ output_mtok: 0.05
6076
+ }
6077
+ },
6078
+ {
6079
+ id: "meta-llama/Llama-3.2-3B-Instruct",
6080
+ name: "Llama-3.2-3B-Instruct",
6081
+ match: {
6082
+ equals: "meta-llama/Llama-3.2-3B-Instruct"
6083
+ },
6084
+ context_window: 32768,
6085
+ prices: {
6086
+ input_mtok: 0.024,
6087
+ output_mtok: 0.04
6088
+ }
6089
+ },
6090
+ {
6091
+ id: "meta-llama/Llama-3.3-70B-Instruct",
6092
+ name: "Llama-3.3-70B-Instruct",
6093
+ match: {
6094
+ equals: "meta-llama/Llama-3.3-70B-Instruct"
6095
+ },
6096
+ context_window: 131072,
6097
+ prices: {
6098
+ input_mtok: 0.104,
6099
+ output_mtok: 0.312
6100
+ }
6101
+ },
6102
+ {
6103
+ id: "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
6104
+ name: "Llama-4-Maverick-17B-128E-Instruct-FP8",
6105
+ match: {
6106
+ equals: "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8"
6107
+ },
6108
+ context_window: 1048576,
6109
+ prices: {
6110
+ input_mtok: 0.136,
6111
+ output_mtok: 0.68
6112
+ }
6113
+ },
6114
+ {
6115
+ id: "meta-llama/Llama-4-Scout-17B-16E-Instruct",
6116
+ name: "Llama-4-Scout-17B-16E-Instruct",
6117
+ match: {
6118
+ equals: "meta-llama/Llama-4-Scout-17B-16E-Instruct"
6119
+ },
6120
+ context_window: 131072,
6121
+ prices: {
6122
+ input_mtok: 0.08,
6123
+ output_mtok: 0.4
6124
+ }
6125
+ },
6126
+ {
6127
+ id: "meta-llama/Meta-Llama-3-70B-Instruct",
6128
+ name: "Meta-Llama-3-70B-Instruct",
6129
+ match: {
6130
+ equals: "meta-llama/Meta-Llama-3-70B-Instruct"
6131
+ },
6132
+ context_window: 8192,
6133
+ prices: {
6134
+ input_mtok: 0.51,
6135
+ output_mtok: 0.74
6136
+ }
6137
+ },
6138
+ {
6139
+ id: "meta-llama/Meta-Llama-3-8B-Instruct",
6140
+ name: "Meta-Llama-3-8B-Instruct",
6141
+ match: {
6142
+ equals: "meta-llama/Meta-Llama-3-8B-Instruct"
6143
+ },
6144
+ context_window: 8192,
6145
+ prices: {
6146
+ input_mtok: 0.032,
6147
+ output_mtok: 0.032
6148
+ }
6149
+ },
6150
+ {
6151
+ id: "moonshotai/Kimi-K2-Instruct",
6152
+ name: "Kimi-K2-Instruct",
6153
+ match: {
6154
+ equals: "moonshotai/Kimi-K2-Instruct"
6155
+ },
6156
+ context_window: 131072,
6157
+ prices: {
6158
+ input_mtok: 0.456,
6159
+ output_mtok: 1.84
6160
+ }
6161
+ },
6162
+ {
6163
+ id: "moonshotai/Kimi-K2-Instruct-0905",
6164
+ name: "Kimi-K2-Instruct-0905",
6165
+ match: {
6166
+ equals: "moonshotai/Kimi-K2-Instruct-0905"
6167
+ },
6168
+ context_window: 262144,
6169
+ prices: {
6170
+ input_mtok: 0.48,
6171
+ output_mtok: 2
6172
+ }
6173
+ },
6174
+ {
6175
+ id: "moonshotai/Kimi-K2-Thinking",
6176
+ name: "Kimi-K2-Thinking",
6177
+ match: {
6178
+ equals: "moonshotai/Kimi-K2-Thinking"
6179
+ },
6180
+ context_window: 262144,
6181
+ prices: {
6182
+ input_mtok: 0.48,
6183
+ output_mtok: 2
6184
+ }
6185
+ },
6186
+ {
6187
+ id: "openai/gpt-oss-120b",
6188
+ name: "gpt-oss-120b",
6189
+ match: {
6190
+ equals: "openai/gpt-oss-120b"
6191
+ },
6192
+ context_window: 131072,
6193
+ prices: {
6194
+ input_mtok: 0.04,
6195
+ output_mtok: 0.2
6196
+ }
6197
+ },
6198
+ {
6199
+ id: "openai/gpt-oss-20b",
6200
+ name: "gpt-oss-20b",
6201
+ match: {
6202
+ equals: "openai/gpt-oss-20b"
6203
+ },
6204
+ context_window: 131072,
6205
+ prices: {
6206
+ input_mtok: 0.032,
6207
+ output_mtok: 0.12
6208
+ }
6209
+ },
6210
+ {
6211
+ id: "zai-org/GLM-4-32B-0414",
6212
+ name: "GLM-4-32B-0414",
6213
+ match: {
6214
+ equals: "zai-org/GLM-4-32B-0414"
6215
+ },
6216
+ context_window: 32e3,
6217
+ prices: {
6218
+ input_mtok: 0.55,
6219
+ output_mtok: 1.66
6220
+ }
6221
+ },
6222
+ {
6223
+ id: "zai-org/GLM-4.1V-9B-Thinking",
6224
+ name: "GLM-4.1V-9B-Thinking",
6225
+ match: {
6226
+ equals: "zai-org/GLM-4.1V-9B-Thinking"
6227
+ },
6228
+ context_window: 65536,
6229
+ prices: {
6230
+ input_mtok: 0.028,
6231
+ output_mtok: 0.1104
6232
+ }
6233
+ },
6234
+ {
6235
+ id: "zai-org/GLM-4.5",
6236
+ name: "GLM-4.5",
6237
+ match: {
6238
+ equals: "zai-org/GLM-4.5"
6239
+ },
6240
+ context_window: 131072,
6241
+ prices: {
6242
+ input_mtok: 0.48,
6243
+ output_mtok: 1.76
6244
+ }
6245
+ },
6246
+ {
6247
+ id: "zai-org/GLM-4.5-Air",
6248
+ name: "GLM-4.5-Air",
6249
+ match: {
6250
+ equals: "zai-org/GLM-4.5-Air"
6251
+ },
6252
+ context_window: 131072,
6253
+ prices: {
6254
+ input_mtok: 0.104,
6255
+ output_mtok: 0.68
6256
+ }
6257
+ },
6258
+ {
6259
+ id: "zai-org/GLM-4.5V",
6260
+ name: "GLM-4.5V",
6261
+ match: {
6262
+ equals: "zai-org/GLM-4.5V"
6263
+ },
6264
+ context_window: 65536,
6265
+ prices: {
6266
+ input_mtok: 0.48,
6267
+ output_mtok: 1.44
6268
+ }
6269
+ },
6270
+ {
6271
+ id: "zai-org/GLM-4.6",
6272
+ name: "GLM-4.6",
6273
+ match: {
6274
+ equals: "zai-org/GLM-4.6"
6275
+ },
6276
+ context_window: 204800,
6277
+ prices: {
6278
+ input_mtok: 0.48,
6279
+ output_mtok: 1.76
6280
+ }
6281
+ }
6282
+ ]
6283
+ },
6284
+ {
6285
+ id: "huggingface_nscale",
6286
+ name: "HuggingFace (nscale)",
6287
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
6288
+ api_pattern: "https://router\\.huggingface\\.co/nscale",
6289
+ provider_match: {
6290
+ and: [
6291
+ {
6292
+ contains: "huggingface"
6293
+ },
6294
+ {
6295
+ contains: "nscale"
6296
+ }
6297
+ ]
6298
+ },
6299
+ extractors: [
6300
+ {
6301
+ api_flavor: "chat",
6302
+ root: "usage",
6303
+ model_path: "model",
6304
+ mappings: [
6305
+ {
6306
+ path: "prompt_tokens",
6307
+ dest: "input_tokens",
6308
+ required: !0
6309
+ },
6310
+ {
6311
+ path: ["prompt_tokens_details", "cached_tokens"],
6312
+ dest: "cache_read_tokens",
6313
+ required: !1
6314
+ },
6315
+ {
6316
+ path: ["prompt_tokens_details", "audio_tokens"],
6317
+ dest: "input_audio_tokens",
6318
+ required: !1
6319
+ },
6320
+ {
6321
+ path: ["completion_tokens_details", "audio_tokens"],
6322
+ dest: "output_audio_tokens",
6323
+ required: !1
6324
+ },
6325
+ {
6326
+ path: "completion_tokens",
6327
+ dest: "output_tokens",
6328
+ required: !0
6329
+ }
6330
+ ]
6331
+ }
6332
+ ],
6333
+ models: [
6334
+ {
6335
+ id: "Qwen/QwQ-32B",
6336
+ name: "QwQ-32B",
6337
+ match: {
6338
+ equals: "Qwen/QwQ-32B"
6339
+ },
6340
+ context_window: 131072,
6341
+ prices: {
6342
+ input_mtok: 0.18,
6343
+ output_mtok: 0.2
6344
+ }
6345
+ },
6346
+ {
6347
+ id: "Qwen/Qwen2.5-Coder-32B-Instruct",
6348
+ name: "Qwen2.5-Coder-32B-Instruct",
6349
+ match: {
6350
+ equals: "Qwen/Qwen2.5-Coder-32B-Instruct"
6351
+ },
6352
+ context_window: 131072,
6353
+ prices: {
6354
+ input_mtok: 0.06,
6355
+ output_mtok: 0.2
6356
+ }
6357
+ },
6358
+ {
6359
+ id: "Qwen/Qwen2.5-Coder-3B-Instruct",
6360
+ name: "Qwen2.5-Coder-3B-Instruct",
6361
+ match: {
6362
+ equals: "Qwen/Qwen2.5-Coder-3B-Instruct"
6363
+ },
6364
+ context_window: 32768,
6365
+ prices: {
6366
+ input_mtok: 0.01,
6367
+ output_mtok: 0.03
6368
+ }
6369
+ },
6370
+ {
6371
+ id: "Qwen/Qwen2.5-Coder-7B-Instruct",
6372
+ name: "Qwen2.5-Coder-7B-Instruct",
6373
+ match: {
6374
+ equals: "Qwen/Qwen2.5-Coder-7B-Instruct"
6375
+ },
6376
+ context_window: 131072,
6377
+ prices: {
6378
+ input_mtok: 0.01,
6379
+ output_mtok: 0.03
6380
+ }
6381
+ },
6382
+ {
6383
+ id: "Qwen/Qwen3-14B",
6384
+ name: "Qwen3-14B",
6385
+ match: {
6386
+ equals: "Qwen/Qwen3-14B"
6387
+ },
6388
+ context_window: 40960,
6389
+ prices: {
6390
+ input_mtok: 0.07,
6391
+ output_mtok: 0.2
6392
+ }
6393
+ },
6394
+ {
6395
+ id: "Qwen/Qwen3-235B-A22B",
6396
+ name: "Qwen3-235B-A22B",
6397
+ match: {
6398
+ or: [
6399
+ {
6400
+ equals: "Qwen/Qwen3-235B-A22B"
6401
+ },
6402
+ {
6403
+ equals: "Qwen/Qwen3-235B-A22B-Instruct-2507"
6404
+ }
6405
+ ]
6406
+ },
6407
+ context_window: 32e3,
6408
+ prices: {
6409
+ input_mtok: 0.2,
6410
+ output_mtok: 0.6
6411
+ }
6412
+ },
6413
+ {
6414
+ id: "Qwen/Qwen3-32B",
6415
+ name: "Qwen3-32B",
6416
+ match: {
6417
+ equals: "Qwen/Qwen3-32B"
6418
+ },
6419
+ context_window: 40960,
6420
+ prices: {
6421
+ input_mtok: 0.08,
6422
+ output_mtok: 0.25
6423
+ }
6424
+ },
6425
+ {
6426
+ id: "Qwen/Qwen3-4B-Instruct-2507",
6427
+ name: "Qwen3-4B-Instruct-2507",
6428
+ match: {
6429
+ equals: "Qwen/Qwen3-4B-Instruct-2507"
6430
+ },
6431
+ context_window: 262144,
6432
+ prices: {
6433
+ input_mtok: 0.01,
6434
+ output_mtok: 0.03
6435
+ }
6436
+ },
6437
+ {
6438
+ id: "Qwen/Qwen3-4B-Thinking-2507",
6439
+ name: "Qwen3-4B-Thinking-2507",
6440
+ match: {
6441
+ equals: "Qwen/Qwen3-4B-Thinking-2507"
6442
+ },
6443
+ context_window: 262144,
6444
+ prices: {
6445
+ input_mtok: 0.01,
6446
+ output_mtok: 0.03
6447
+ }
6448
+ },
6449
+ {
6450
+ id: "Qwen/Qwen3-8B",
6451
+ name: "Qwen3-8B",
6452
+ match: {
6453
+ equals: "Qwen/Qwen3-8B"
6454
+ },
6455
+ context_window: 40960,
6456
+ prices: {
6457
+ input_mtok: 0.07,
6458
+ output_mtok: 0.18
6459
+ }
6460
+ },
6461
+ {
6462
+ id: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
6463
+ name: "DeepSeek-R1-Distill-Llama-70B",
6464
+ match: {
6465
+ equals: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B"
6466
+ },
6467
+ context_window: 131072,
6468
+ prices: {
6469
+ input_mtok: 0.75,
6470
+ output_mtok: 0.75
6471
+ }
6472
+ },
6473
+ {
6474
+ id: "deepseek-ai/DeepSeek-R1-Distill-Llama-8B",
6475
+ name: "DeepSeek-R1-Distill-Llama-8B",
6476
+ match: {
6477
+ equals: "deepseek-ai/DeepSeek-R1-Distill-Llama-8B"
6478
+ },
6479
+ context_window: 131072,
6480
+ prices: {
6481
+ input_mtok: 0.05,
6482
+ output_mtok: 0.05
6483
+ }
6484
+ },
6485
+ {
6486
+ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
6487
+ name: "DeepSeek-R1-Distill-Qwen-1.5B",
6488
+ match: {
6489
+ equals: "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
6490
+ },
6491
+ context_window: 131072,
6492
+ prices: {
6493
+ input_mtok: 0.1,
6494
+ output_mtok: 0.1
6495
+ }
6496
+ },
6497
+ {
6498
+ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B",
6499
+ name: "DeepSeek-R1-Distill-Qwen-14B",
6500
+ match: {
6501
+ equals: "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B"
6502
+ },
6503
+ context_window: 131072,
6504
+ prices: {
6505
+ input_mtok: 0.2,
6506
+ output_mtok: 0.2
6507
+ }
6508
+ },
6509
+ {
6510
+ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
6511
+ name: "DeepSeek-R1-Distill-Qwen-32B",
6512
+ match: {
6513
+ equals: "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B"
6514
+ },
6515
+ context_window: 131072,
6516
+ prices: {
6517
+ input_mtok: 0.3,
6518
+ output_mtok: 0.3
6519
+ }
6520
+ },
6521
+ {
6522
+ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B",
6523
+ name: "DeepSeek-R1-Distill-Qwen-7B",
6524
+ match: {
6525
+ equals: "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B"
6526
+ },
6527
+ context_window: 131072,
6528
+ prices: {
6529
+ input_mtok: 0.15,
6530
+ output_mtok: 0.15
6531
+ }
6532
+ },
6533
+ {
6534
+ id: "meta-llama/Llama-3.1-8B-Instruct",
6535
+ name: "Llama-3.1-8B-Instruct",
6536
+ match: {
6537
+ equals: "meta-llama/Llama-3.1-8B-Instruct"
6538
+ },
6539
+ context_window: 131072,
6540
+ prices: {
6541
+ input_mtok: 0.06,
6542
+ output_mtok: 0.06
6543
+ }
6544
+ },
6545
+ {
6546
+ id: "meta-llama/Llama-3.3-70B-Instruct",
6547
+ name: "Llama-3.3-70B-Instruct",
6548
+ match: {
6549
+ equals: "meta-llama/Llama-3.3-70B-Instruct"
6550
+ },
6551
+ context_window: 131072,
6552
+ prices: {
6553
+ input_mtok: 0.4,
6554
+ output_mtok: 0.4
6555
+ }
6556
+ },
6557
+ {
6558
+ id: "meta-llama/Llama-4-Scout-17B-16E-Instruct",
6559
+ name: "Llama-4-Scout-17B-16E-Instruct",
6560
+ match: {
6561
+ equals: "meta-llama/Llama-4-Scout-17B-16E-Instruct"
6562
+ },
6563
+ context_window: 89e4,
6564
+ prices: {
6565
+ input_mtok: 0.09,
6566
+ output_mtok: 0.29
6567
+ }
6568
+ },
6569
+ {
6570
+ id: "openai/gpt-oss-120b",
6571
+ name: "gpt-oss-120b",
6572
+ match: {
6573
+ equals: "openai/gpt-oss-120b"
6574
+ },
6575
+ context_window: 131072,
6576
+ prices: {
6577
+ input_mtok: 0.1,
6578
+ output_mtok: 0.4
6579
+ }
6580
+ },
6581
+ {
6582
+ id: "openai/gpt-oss-20b",
6583
+ name: "gpt-oss-20b",
6584
+ match: {
6585
+ equals: "openai/gpt-oss-20b"
6586
+ },
6587
+ context_window: 131072,
6588
+ prices: {
6589
+ input_mtok: 0.05,
6590
+ output_mtok: 0.2
6591
+ }
6592
+ }
6593
+ ]
6594
+ },
6595
+ {
6596
+ id: "huggingface_publicai",
6597
+ name: "HuggingFace (publicai)",
6598
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
6599
+ api_pattern: "https://router\\.huggingface\\.co/publicai",
6600
+ provider_match: {
6601
+ and: [
6602
+ {
6603
+ contains: "huggingface"
6604
+ },
6605
+ {
6606
+ contains: "publicai"
6607
+ }
6608
+ ]
6609
+ },
6610
+ extractors: [
6611
+ {
6612
+ api_flavor: "chat",
6613
+ root: "usage",
6614
+ model_path: "model",
6615
+ mappings: [
6616
+ {
6617
+ path: "prompt_tokens",
6618
+ dest: "input_tokens",
6619
+ required: !0
6620
+ },
6621
+ {
6622
+ path: ["prompt_tokens_details", "cached_tokens"],
6623
+ dest: "cache_read_tokens",
6624
+ required: !1
6625
+ },
6626
+ {
6627
+ path: ["prompt_tokens_details", "audio_tokens"],
6628
+ dest: "input_audio_tokens",
6629
+ required: !1
6630
+ },
6631
+ {
6632
+ path: ["completion_tokens_details", "audio_tokens"],
6633
+ dest: "output_audio_tokens",
6634
+ required: !1
6635
+ },
6636
+ {
6637
+ path: "completion_tokens",
6638
+ dest: "output_tokens",
6639
+ required: !0
6640
+ }
6641
+ ]
6642
+ }
6643
+ ],
6644
+ models: [
6645
+ {
6646
+ id: "aisingapore/Gemma-SEA-LION-v4-27B-IT",
6647
+ name: "Gemma-SEA-LION-v4-27B-IT",
6648
+ match: {
6649
+ equals: "aisingapore/Gemma-SEA-LION-v4-27B-IT"
6650
+ },
6651
+ prices: {}
6652
+ },
6653
+ {
6654
+ id: "swiss-ai/Apertus-70B-Instruct-2509",
6655
+ name: "Apertus-70B-Instruct-2509",
6656
+ match: {
6657
+ equals: "swiss-ai/Apertus-70B-Instruct-2509"
6658
+ },
6659
+ prices: {}
6660
+ },
6661
+ {
6662
+ id: "swiss-ai/Apertus-8B-Instruct-2509",
6663
+ name: "Apertus-8B-Instruct-2509",
6664
+ match: {
6665
+ equals: "swiss-ai/Apertus-8B-Instruct-2509"
6666
+ },
6667
+ prices: {}
6668
+ }
6669
+ ]
6670
+ },
6671
+ {
6672
+ id: "huggingface_sambanova",
6673
+ name: "HuggingFace (sambanova)",
6674
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
6675
+ api_pattern: "https://router\\.huggingface\\.co/sambanova",
6676
+ provider_match: {
6677
+ and: [
6678
+ {
6679
+ contains: "huggingface"
6680
+ },
6681
+ {
6682
+ contains: "sambanova"
6683
+ }
6684
+ ]
6685
+ },
6686
+ extractors: [
6687
+ {
6688
+ api_flavor: "chat",
6689
+ root: "usage",
6690
+ model_path: "model",
6691
+ mappings: [
6692
+ {
6693
+ path: "prompt_tokens",
6694
+ dest: "input_tokens",
6695
+ required: !0
6696
+ },
6697
+ {
6698
+ path: ["prompt_tokens_details", "cached_tokens"],
6699
+ dest: "cache_read_tokens",
6700
+ required: !1
6701
+ },
6702
+ {
6703
+ path: ["prompt_tokens_details", "audio_tokens"],
6704
+ dest: "input_audio_tokens",
6705
+ required: !1
6706
+ },
6707
+ {
6708
+ path: ["completion_tokens_details", "audio_tokens"],
6709
+ dest: "output_audio_tokens",
6710
+ required: !1
6711
+ },
6712
+ {
6713
+ path: "completion_tokens",
6714
+ dest: "output_tokens",
6715
+ required: !0
6716
+ }
6717
+ ]
6718
+ }
6719
+ ],
6720
+ models: [
6721
+ {
6722
+ id: "Qwen/Qwen3-32B",
6723
+ name: "Qwen3-32B",
6724
+ match: {
6725
+ equals: "Qwen/Qwen3-32B"
6726
+ },
6727
+ context_window: 32768,
6728
+ prices: {
6729
+ input_mtok: 0.4,
6730
+ output_mtok: 0.8
6731
+ }
6732
+ },
6733
+ {
6734
+ id: "deepseek-ai/DeepSeek-R1-0528",
6735
+ name: "DeepSeek-R1-0528",
6736
+ match: {
6737
+ equals: "deepseek-ai/DeepSeek-R1-0528"
6738
+ },
6739
+ context_window: 131072,
6740
+ prices: {
6741
+ input_mtok: 5,
6742
+ output_mtok: 7
6743
+ }
6744
+ },
6745
+ {
6746
+ id: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
6747
+ name: "DeepSeek-R1-Distill-Llama-70B",
6748
+ match: {
6749
+ equals: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B"
6750
+ },
6751
+ context_window: 131072,
6752
+ prices: {
6753
+ input_mtok: 0.7,
6754
+ output_mtok: 1.4
6755
+ }
6756
+ },
6757
+ {
6758
+ id: "deepseek-ai/DeepSeek-V3-0324",
6759
+ name: "DeepSeek-V3-0324",
6760
+ match: {
6761
+ equals: "deepseek-ai/DeepSeek-V3-0324"
6762
+ },
6763
+ context_window: 131072,
6764
+ prices: {
6765
+ input_mtok: 3,
6766
+ output_mtok: 4.5
6767
+ }
6768
+ },
6769
+ {
6770
+ id: "meta-llama/Llama-3.1-8B-Instruct",
6771
+ name: "Llama-3.1-8B-Instruct",
6772
+ match: {
6773
+ equals: "meta-llama/Llama-3.1-8B-Instruct"
6774
+ },
6775
+ context_window: 16384,
6776
+ prices: {
6777
+ input_mtok: 0.1,
6778
+ output_mtok: 0.2
6779
+ }
6780
+ },
6781
+ {
6782
+ id: "meta-llama/Llama-3.3-70B-Instruct",
6783
+ name: "Llama-3.3-70B-Instruct",
6784
+ match: {
6785
+ equals: "meta-llama/Llama-3.3-70B-Instruct"
6786
+ },
6787
+ context_window: 131072,
6788
+ prices: {
6789
+ input_mtok: 0.6,
6790
+ output_mtok: 1.2
6791
+ }
6792
+ },
6793
+ {
6794
+ id: "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
6795
+ name: "Llama-4-Maverick-17B-128E-Instruct",
6796
+ match: {
6797
+ equals: "meta-llama/Llama-4-Maverick-17B-128E-Instruct"
6798
+ },
6799
+ context_window: 131072,
6800
+ prices: {
6801
+ input_mtok: 0.63,
6802
+ output_mtok: 1.8
6803
+ }
6804
+ },
6805
+ {
6806
+ id: "tokyotech-llm/Llama-3.3-Swallow-70B-Instruct-v0.4",
6807
+ name: "Llama-3.3-Swallow-70B-Instruct-v0.4",
6808
+ match: {
6809
+ equals: "tokyotech-llm/Llama-3.3-Swallow-70B-Instruct-v0.4"
6810
+ },
6811
+ context_window: 131072,
6812
+ prices: {
6813
+ input_mtok: 0.6,
6814
+ output_mtok: 1.2
6815
+ }
6816
+ }
6817
+ ]
6818
+ },
6819
+ {
6820
+ id: "huggingface_together",
6821
+ name: "HuggingFace (together)",
6822
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
6823
+ api_pattern: "https://router\\.huggingface\\.co/together",
6824
+ provider_match: {
6825
+ and: [
6826
+ {
6827
+ contains: "huggingface"
6828
+ },
6829
+ {
6830
+ contains: "together"
4137
6831
  }
4138
- },
6832
+ ]
6833
+ },
6834
+ extractors: [
4139
6835
  {
4140
- id: "llama-3.1-8b-instant",
4141
- name: "Llama 3.1 8B Instant 128k",
4142
- match: {
4143
- equals: "llama-3.1-8b-instant"
4144
- },
4145
- prices: {
4146
- input_mtok: 0.05,
4147
- output_mtok: 0.08
4148
- }
4149
- },
6836
+ api_flavor: "chat",
6837
+ root: "usage",
6838
+ model_path: "model",
6839
+ mappings: [
6840
+ {
6841
+ path: "prompt_tokens",
6842
+ dest: "input_tokens",
6843
+ required: !0
6844
+ },
6845
+ {
6846
+ path: ["prompt_tokens_details", "cached_tokens"],
6847
+ dest: "cache_read_tokens",
6848
+ required: !1
6849
+ },
6850
+ {
6851
+ path: ["prompt_tokens_details", "audio_tokens"],
6852
+ dest: "input_audio_tokens",
6853
+ required: !1
6854
+ },
6855
+ {
6856
+ path: ["completion_tokens_details", "audio_tokens"],
6857
+ dest: "output_audio_tokens",
6858
+ required: !1
6859
+ },
6860
+ {
6861
+ path: "completion_tokens",
6862
+ dest: "output_tokens",
6863
+ required: !0
6864
+ }
6865
+ ]
6866
+ }
6867
+ ],
6868
+ models: [
4150
6869
  {
4151
- id: "llama-3.2-11b-text-preview",
6870
+ id: "Qwen/Qwen2.5-72B-Instruct",
6871
+ name: "Qwen2.5-72B-Instruct",
4152
6872
  match: {
4153
- equals: "llama-3.2-11b-text-preview"
6873
+ equals: "Qwen/Qwen2.5-72B-Instruct"
4154
6874
  },
6875
+ context_window: 131072,
4155
6876
  prices: {
4156
- input_mtok: 0.18,
4157
- output_mtok: 0.18
6877
+ input_mtok: 1.2,
6878
+ output_mtok: 1.2
4158
6879
  }
4159
6880
  },
4160
6881
  {
4161
- id: "llama-3.2-11b-vision-preview",
6882
+ id: "Qwen/Qwen2.5-7B-Instruct",
6883
+ name: "Qwen2.5-7B-Instruct",
4162
6884
  match: {
4163
- equals: "llama-3.2-11b-vision-preview"
6885
+ equals: "Qwen/Qwen2.5-7B-Instruct"
4164
6886
  },
6887
+ context_window: 32768,
4165
6888
  prices: {
4166
- input_mtok: 0.18,
4167
- output_mtok: 0.18
6889
+ input_mtok: 0.3,
6890
+ output_mtok: 0.3
4168
6891
  }
4169
6892
  },
4170
6893
  {
4171
- id: "llama-3.2-1b-preview",
6894
+ id: "Qwen/Qwen3-235B-A22B",
6895
+ name: "Qwen3-235B-A22B",
4172
6896
  match: {
4173
- equals: "llama-3.2-1b-preview"
6897
+ or: [
6898
+ {
6899
+ equals: "Qwen/Qwen3-235B-A22B"
6900
+ },
6901
+ {
6902
+ equals: "Qwen/Qwen3-235B-A22B-FP8"
6903
+ },
6904
+ {
6905
+ equals: "Qwen/Qwen3-235B-A22B-Instruct-2507"
6906
+ }
6907
+ ]
4174
6908
  },
6909
+ context_window: 40960,
4175
6910
  prices: {
4176
- input_mtok: 0.04,
4177
- output_mtok: 0.04
6911
+ input_mtok: 0.2,
6912
+ output_mtok: 0.6
4178
6913
  }
4179
6914
  },
4180
6915
  {
4181
- id: "llama-3.2-3b-preview",
6916
+ id: "Qwen/Qwen3-Coder-480B-A35B-Instruct",
6917
+ name: "Qwen3-Coder-480B-A35B-Instruct",
4182
6918
  match: {
4183
- equals: "llama-3.2-3b-preview"
6919
+ or: [
6920
+ {
6921
+ equals: "Qwen/Qwen3-Coder-480B-A35B-Instruct"
6922
+ },
6923
+ {
6924
+ equals: "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8"
6925
+ }
6926
+ ]
4184
6927
  },
6928
+ context_window: 262144,
4185
6929
  prices: {
4186
- input_mtok: 0.06,
4187
- output_mtok: 0.06
6930
+ input_mtok: 2,
6931
+ output_mtok: 2
4188
6932
  }
4189
6933
  },
4190
6934
  {
4191
- id: "llama-3.2-90b-text-preview",
6935
+ id: "Qwen/Qwen3-Next-80B-A3B-Instruct",
6936
+ name: "Qwen3-Next-80B-A3B-Instruct",
4192
6937
  match: {
4193
- equals: "llama-3.2-90b-text-preview"
6938
+ equals: "Qwen/Qwen3-Next-80B-A3B-Instruct"
4194
6939
  },
6940
+ context_window: 262144,
4195
6941
  prices: {
4196
- input_mtok: 0.9,
4197
- output_mtok: 0.9
6942
+ input_mtok: 0.15,
6943
+ output_mtok: 1.5
4198
6944
  }
4199
6945
  },
4200
6946
  {
4201
- id: "llama-3.2-90b-vision-preview",
6947
+ id: "Qwen/Qwen3-Next-80B-A3B-Thinking",
6948
+ name: "Qwen3-Next-80B-A3B-Thinking",
4202
6949
  match: {
4203
- equals: "llama-3.2-90b-vision-preview"
6950
+ equals: "Qwen/Qwen3-Next-80B-A3B-Thinking"
4204
6951
  },
6952
+ context_window: 262144,
4205
6953
  prices: {
4206
- input_mtok: 0.9,
4207
- output_mtok: 0.9
6954
+ input_mtok: 0.15,
6955
+ output_mtok: 1.5
4208
6956
  }
4209
6957
  },
4210
6958
  {
4211
- id: "llama-3.3-70b-specdec",
6959
+ id: "deepcogito/cogito-671b-v2.1",
6960
+ name: "cogito-671b-v2.1",
4212
6961
  match: {
4213
- equals: "llama-3.3-70b-specdec"
6962
+ or: [
6963
+ {
6964
+ equals: "deepcogito/cogito-671b-v2.1"
6965
+ },
6966
+ {
6967
+ equals: "deepcogito/cogito-671b-v2.1-FP8"
6968
+ }
6969
+ ]
4214
6970
  },
6971
+ context_window: 163840,
4215
6972
  prices: {
4216
- input_mtok: 0.59,
4217
- output_mtok: 0.99
6973
+ input_mtok: 1.25,
6974
+ output_mtok: 1.25
4218
6975
  }
4219
6976
  },
4220
6977
  {
4221
- id: "llama-3.3-70b-versatile",
4222
- name: "Llama 3.3 70B Versatile 128k",
6978
+ id: "deepcogito/cogito-v2-preview-llama-109B-MoE",
6979
+ name: "cogito-v2-preview-llama-109B-MoE",
4223
6980
  match: {
4224
- equals: "llama-3.3-70b-versatile"
6981
+ equals: "deepcogito/cogito-v2-preview-llama-109B-MoE"
4225
6982
  },
6983
+ context_window: 32767,
4226
6984
  prices: {
4227
- input_mtok: 0.59,
4228
- output_mtok: 0.79
6985
+ input_mtok: 0.18000000000000002,
6986
+ output_mtok: 0.5900000000000001
4229
6987
  }
4230
6988
  },
4231
6989
  {
4232
- id: "llama-guard-3-8b",
6990
+ id: "deepcogito/cogito-v2-preview-llama-405B",
6991
+ name: "cogito-v2-preview-llama-405B",
4233
6992
  match: {
4234
- equals: "llama-guard-3-8b"
6993
+ equals: "deepcogito/cogito-v2-preview-llama-405B"
4235
6994
  },
6995
+ context_window: 32768,
4236
6996
  prices: {
4237
- input_mtok: 0.2,
4238
- output_mtok: 0.2
6997
+ input_mtok: 3.5,
6998
+ output_mtok: 3.5
4239
6999
  }
4240
7000
  },
4241
7001
  {
4242
- id: "llama2-70b-4096",
7002
+ id: "deepcogito/cogito-v2-preview-llama-70B",
7003
+ name: "cogito-v2-preview-llama-70B",
4243
7004
  match: {
4244
- equals: "llama2-70b-4096"
7005
+ equals: "deepcogito/cogito-v2-preview-llama-70B"
4245
7006
  },
7007
+ context_window: 32768,
4246
7008
  prices: {
4247
- input_mtok: 0.7,
4248
- output_mtok: 0.8
7009
+ input_mtok: 0.88,
7010
+ output_mtok: 0.88
4249
7011
  }
4250
7012
  },
4251
7013
  {
4252
- id: "llama3-70b-8192",
7014
+ id: "deepseek-ai/DeepSeek-R1",
7015
+ name: "DeepSeek-R1",
4253
7016
  match: {
4254
- equals: "llama3-70b-8192"
7017
+ or: [
7018
+ {
7019
+ equals: "deepseek-ai/DeepSeek-R1"
7020
+ },
7021
+ {
7022
+ equals: "deepseek-ai/DeepSeek-R1-0528"
7023
+ }
7024
+ ]
4255
7025
  },
7026
+ context_window: 163840,
4256
7027
  prices: {
4257
- input_mtok: 0.59,
4258
- output_mtok: 0.79
7028
+ input_mtok: 3,
7029
+ output_mtok: 7
4259
7030
  }
4260
7031
  },
4261
7032
  {
4262
- id: "llama3-8b-8192",
7033
+ id: "deepseek-ai/DeepSeek-V3",
7034
+ name: "DeepSeek-V3",
4263
7035
  match: {
4264
- equals: "llama3-8b-8192"
7036
+ or: [
7037
+ {
7038
+ equals: "deepseek-ai/DeepSeek-V3"
7039
+ },
7040
+ {
7041
+ equals: "deepseek-ai/DeepSeek-V3-0324"
7042
+ }
7043
+ ]
4265
7044
  },
7045
+ context_window: 131072,
4266
7046
  prices: {
4267
- input_mtok: 0.05,
4268
- output_mtok: 0.08
7047
+ input_mtok: 1.25,
7048
+ output_mtok: 1.25
4269
7049
  }
4270
7050
  },
4271
7051
  {
4272
- id: "llama3-groq-70b-8192-tool-use-preview",
7052
+ id: "deepseek-ai/DeepSeek-V3.1",
7053
+ name: "DeepSeek-V3.1",
4273
7054
  match: {
4274
- equals: "llama3-groq-70b-8192-tool-use-preview"
7055
+ equals: "deepseek-ai/DeepSeek-V3.1"
4275
7056
  },
7057
+ context_window: 131072,
4276
7058
  prices: {
4277
- input_mtok: 0.89,
4278
- output_mtok: 0.89
7059
+ input_mtok: 0.6,
7060
+ output_mtok: 1.7
4279
7061
  }
4280
7062
  },
4281
7063
  {
4282
- id: "llama3-groq-8b-8192-tool-use-preview",
7064
+ id: "marin-community/marin-8b-instruct",
7065
+ name: "marin-8b-instruct",
4283
7066
  match: {
4284
- equals: "llama3-groq-8b-8192-tool-use-preview"
7067
+ equals: "marin-community/marin-8b-instruct"
4285
7068
  },
7069
+ context_window: 4096,
4286
7070
  prices: {
4287
- input_mtok: 0.19,
4288
- output_mtok: 0.19
7071
+ input_mtok: 0.18000000000000002,
7072
+ output_mtok: 0.18000000000000002
4289
7073
  }
4290
7074
  },
4291
7075
  {
4292
- id: "meta-llama/llama-4-maverick-17b-128e-instruct",
4293
- name: "Llama 4 Maverick 17B 128E",
7076
+ id: "meta-llama/Llama-3.2-3B-Instruct",
7077
+ name: "Llama-3.2-3B-Instruct",
4294
7078
  match: {
4295
- equals: "meta-llama/llama-4-maverick-17b-128e-instruct"
7079
+ equals: "meta-llama/Llama-3.2-3B-Instruct"
4296
7080
  },
4297
7081
  context_window: 131072,
4298
7082
  prices: {
4299
- input_mtok: 0.2,
4300
- output_mtok: 0.6
7083
+ input_mtok: 0.060000000000000005,
7084
+ output_mtok: 0.060000000000000005
4301
7085
  }
4302
7086
  },
4303
7087
  {
4304
- id: "meta-llama/llama-4-scout-17b-16e-instruct",
4305
- name: "Llama 4 Scout (17Bx16E) 128k",
7088
+ id: "meta-llama/Llama-3.3-70B-Instruct",
7089
+ name: "Llama-3.3-70B-Instruct",
4306
7090
  match: {
4307
- equals: "meta-llama/llama-4-scout-17b-16e-instruct"
7091
+ equals: "meta-llama/Llama-3.3-70B-Instruct"
4308
7092
  },
7093
+ context_window: 131072,
4309
7094
  prices: {
4310
- input_mtok: 0.11,
4311
- output_mtok: 0.34
7095
+ input_mtok: 0.88,
7096
+ output_mtok: 0.88
4312
7097
  }
4313
7098
  },
4314
7099
  {
4315
- id: "meta-llama/llama-guard-4-12b",
4316
- name: "Llama Guard 4 12B",
7100
+ id: "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
7101
+ name: "Llama-4-Maverick-17B-128E-Instruct-FP8",
4317
7102
  match: {
4318
- equals: "meta-llama/llama-guard-4-12b"
7103
+ equals: "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8"
4319
7104
  },
4320
- context_window: 131072,
7105
+ context_window: 1048576,
4321
7106
  prices: {
4322
- input_mtok: 0.2,
4323
- output_mtok: 0.2
7107
+ input_mtok: 0.27,
7108
+ output_mtok: 0.85
4324
7109
  }
4325
7110
  },
4326
7111
  {
4327
- id: "mistral-saba-24b",
7112
+ id: "meta-llama/Llama-4-Scout-17B-16E-Instruct",
7113
+ name: "Llama-4-Scout-17B-16E-Instruct",
4328
7114
  match: {
4329
- equals: "mistral-saba-24b"
7115
+ equals: "meta-llama/Llama-4-Scout-17B-16E-Instruct"
4330
7116
  },
7117
+ context_window: 1048576,
4331
7118
  prices: {
4332
- input_mtok: 0.79,
4333
- output_mtok: 0.79
7119
+ input_mtok: 0.18000000000000002,
7120
+ output_mtok: 0.5900000000000001
4334
7121
  }
4335
7122
  },
4336
7123
  {
4337
- id: "mixtral-8x7b-32768",
7124
+ id: "meta-llama/Meta-Llama-3-70B-Instruct",
7125
+ name: "Meta-Llama-3-70B-Instruct",
4338
7126
  match: {
4339
- equals: "mixtral-8x7b-32768"
7127
+ equals: "meta-llama/Meta-Llama-3-70B-Instruct"
4340
7128
  },
7129
+ context_window: 8192,
4341
7130
  prices: {
4342
- input_mtok: 0.24,
4343
- output_mtok: 0.24
7131
+ input_mtok: 0.88,
7132
+ output_mtok: 0.88
4344
7133
  }
4345
7134
  },
4346
7135
  {
4347
- id: "moonshotai/kimi-k2-instruct",
4348
- name: "Kimi K2 1T 128k",
7136
+ id: "moonshotai/Kimi-K2-Instruct",
7137
+ name: "Kimi-K2-Instruct",
4349
7138
  match: {
4350
7139
  or: [
4351
7140
  {
4352
- equals: "moonshotai/kimi-k2-instruct"
7141
+ equals: "moonshotai/Kimi-K2-Instruct"
4353
7142
  },
4354
7143
  {
4355
- equals: "moonshotai/kimi-k2-instruct-0905"
7144
+ equals: "moonshotai/Kimi-K2-Instruct-0905"
4356
7145
  }
4357
7146
  ]
4358
7147
  },
4359
7148
  context_window: 131072,
4360
7149
  prices: {
4361
7150
  input_mtok: 1,
4362
- cache_read_mtok: 0.5,
4363
7151
  output_mtok: 3
4364
7152
  }
4365
7153
  },
7154
+ {
7155
+ id: "moonshotai/Kimi-K2-Thinking",
7156
+ name: "Kimi-K2-Thinking",
7157
+ match: {
7158
+ equals: "moonshotai/Kimi-K2-Thinking"
7159
+ },
7160
+ context_window: 262144,
7161
+ prices: {
7162
+ input_mtok: 1.2,
7163
+ output_mtok: 4
7164
+ }
7165
+ },
4366
7166
  {
4367
7167
  id: "openai/gpt-oss-120b",
4368
- description: `GPT-OSS 120B is OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with
4369
- 120 billion parameters and 128 experts.
4370
- `,
7168
+ name: "gpt-oss-120b",
4371
7169
  match: {
4372
- or: [
4373
- {
4374
- equals: "openai/gpt-oss-120b"
4375
- },
4376
- {
4377
- equals: "openai/gpt-oss-safeguard-20b"
4378
- }
4379
- ]
7170
+ equals: "openai/gpt-oss-120b"
4380
7171
  },
4381
7172
  context_window: 131072,
4382
7173
  prices: {
4383
7174
  input_mtok: 0.15,
4384
- cache_read_mtok: 0.075,
4385
7175
  output_mtok: 0.6
4386
7176
  }
4387
7177
  },
4388
7178
  {
4389
7179
  id: "openai/gpt-oss-20b",
4390
- description: `GPT-OSS 20B is OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with
4391
- 20 billion parameters and 32 experts.
4392
- `,
7180
+ name: "gpt-oss-20b",
4393
7181
  match: {
4394
7182
  equals: "openai/gpt-oss-20b"
4395
7183
  },
4396
7184
  context_window: 131072,
4397
7185
  prices: {
4398
- input_mtok: 0.075,
4399
- cache_read_mtok: 0.0375,
4400
- output_mtok: 0.3
7186
+ input_mtok: 0.05,
7187
+ output_mtok: 0.2
4401
7188
  }
4402
7189
  },
4403
7190
  {
4404
- id: "qwen/qwen3-32b",
4405
- name: "Qwen3 32B 131k",
7191
+ id: "zai-org/GLM-4.5-Air-FP8",
7192
+ name: "GLM-4.5-Air-FP8",
4406
7193
  match: {
4407
- equals: "qwen/qwen3-32b"
7194
+ equals: "zai-org/GLM-4.5-Air-FP8"
4408
7195
  },
7196
+ context_window: 131072,
4409
7197
  prices: {
4410
- input_mtok: 0.29,
4411
- output_mtok: 0.59
7198
+ input_mtok: 0.2,
7199
+ output_mtok: 1.1
4412
7200
  }
4413
7201
  }
4414
7202
  ]
@@ -13440,100 +16228,100 @@ Compared to other leading proprietary and open-weights models Command A delivers
13440
16228
  ]
13441
16229
  }
13442
16230
  ];
13443
- function Wt(i, s) {
13444
- if (s <= 0) return 0;
16231
+ function $t(i, n) {
16232
+ if (n <= 0) return 0;
13445
16233
  let m = 0;
13446
- const n = [...i.tiers].sort((_, h) => _.start - h.start), u = n[0]?.start ?? s, k = Math.min(s, u);
16234
+ const s = [...i.tiers].sort((h, _) => h.start - _.start), u = s[0]?.start ?? n, k = Math.min(n, u);
13447
16235
  m += k * i.base / 1e6;
13448
- for (let _ = 0; _ < n.length; _++) {
13449
- const h = n[_], f = n[_ + 1]?.start ?? 1 / 0, y = Math.max(0, Math.min(s, f) - h.start);
13450
- y > 0 && (m += y * h.price / 1e6);
16236
+ for (let h = 0; h < s.length; h++) {
16237
+ const _ = s[h], f = s[h + 1]?.start ?? 1 / 0, x = Math.max(0, Math.min(n, f) - _.start);
16238
+ x > 0 && (m += x * _.price / 1e6);
13451
16239
  }
13452
16240
  return m;
13453
16241
  }
13454
- function O(i, s, m) {
13455
- return i === void 0 || s === void 0 ? 0 : typeof i == "number" ? i * s / 1e6 : Wt(i, s);
16242
+ function G(i, n, m) {
16243
+ return i === void 0 || n === void 0 ? 0 : typeof i == "number" ? i * n / 1e6 : $t(i, n);
13456
16244
  }
13457
- function Ut(i, s) {
13458
- let m = 0, n = 0;
13459
- const u = i.cache_read_tokens ?? 0, k = i.cache_write_tokens ?? 0, _ = i.cache_audio_read_tokens ?? 0, h = i.output_audio_tokens ?? 0;
16245
+ function Wt(i, n) {
16246
+ let m = 0, s = 0;
16247
+ const u = i.cache_read_tokens ?? 0, k = i.cache_write_tokens ?? 0, h = i.cache_audio_read_tokens ?? 0, _ = i.output_audio_tokens ?? 0;
13460
16248
  let f = i.input_audio_tokens ?? 0;
13461
- if (f -= _, f < 0)
16249
+ if (f -= h, f < 0)
13462
16250
  throw new Error("cache_audio_read_tokens cannot be greater than input_audio_tokens");
13463
- let y = i.input_tokens ?? 0;
13464
- if (y -= u, y -= k, y -= f, y < 0)
16251
+ let x = i.input_tokens ?? 0;
16252
+ if (x -= u, x -= k, x -= f, x < 0)
13465
16253
  throw new Error("Uncached text input tokens cannot be negative");
13466
- let P = u;
13467
- if (P -= _, P < 0)
16254
+ let M = u;
16255
+ if (M -= h, M < 0)
13468
16256
  throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
13469
- m += O(s.input_mtok, y), m += O(s.cache_read_mtok, P), m += O(s.cache_write_mtok, k), m += O(s.input_audio_mtok, f), m += O(s.cache_audio_read_mtok, _);
13470
- let S = i.output_tokens ?? 0;
13471
- if (S -= h, S < 0)
16257
+ m += G(n.input_mtok, x), m += G(n.cache_read_mtok, M), m += G(n.cache_write_mtok, k), m += G(n.input_audio_mtok, f), m += G(n.cache_audio_read_mtok, h);
16258
+ let P = i.output_tokens ?? 0;
16259
+ if (P -= _, P < 0)
13472
16260
  throw new Error("output_audio_tokens cannot be greater than output_tokens");
13473
- n += O(s.output_mtok, S), n += O(s.output_audio_mtok, i.output_audio_tokens);
13474
- let G = m + n;
13475
- return s.requests_kcount !== void 0 && (G += s.requests_kcount / 1e3), {
16261
+ s += G(n.output_mtok, P), s += G(n.output_audio_mtok, i.output_audio_tokens);
16262
+ let T = m + s;
16263
+ return n.requests_kcount !== void 0 && (T += n.requests_kcount / 1e3), {
13476
16264
  input_price: m,
13477
- output_price: n,
13478
- total_price: G
16265
+ output_price: s,
16266
+ total_price: T
13479
16267
  };
13480
16268
  }
13481
- function Kt(i, s) {
16269
+ function Ut(i, n) {
13482
16270
  if (!Array.isArray(i.prices))
13483
16271
  return i.prices;
13484
16272
  for (let m = i.prices.length - 1; m >= 0; m--) {
13485
- const n = i.prices[m], u = n.constraint;
16273
+ const s = i.prices[m], u = s.constraint;
13486
16274
  if (u === void 0)
13487
- return n.prices;
16275
+ return s.prices;
13488
16276
  if (u.type === "start_date") {
13489
- if (s >= new Date(u.start_date))
13490
- return n.prices;
16277
+ if (n >= new Date(u.start_date))
16278
+ return s.prices;
13491
16279
  } else {
13492
- const k = s.toISOString().slice(11, 19), _ = u.start_time, h = u.end_time;
13493
- if (h < _) {
13494
- if (k >= _ || k < h)
13495
- return n.prices;
13496
- } else if (k >= _ && k < h)
13497
- return n.prices;
16280
+ const k = n.toISOString().slice(11, 19), h = u.start_time, _ = u.end_time;
16281
+ if (_ < h) {
16282
+ if (k >= h || k < _)
16283
+ return s.prices;
16284
+ } else if (k >= h && k < _)
16285
+ return s.prices;
13498
16286
  }
13499
16287
  }
13500
16288
  return i.prices[0].prices;
13501
16289
  }
13502
- function j(i, s) {
13503
- return "or" in i ? i.or.some((m) => j(m, s)) : "and" in i ? i.and.every((m) => j(m, s)) : "equals" in i ? s === i.equals : "starts_with" in i ? s.startsWith(i.starts_with) : "ends_with" in i ? s.endsWith(i.ends_with) : "contains" in i ? s.includes(i.contains) : "regex" in i ? new RegExp(i.regex).test(s) : !1;
16290
+ function O(i, n) {
16291
+ return "or" in i ? i.or.some((m) => O(m, n)) : "and" in i ? i.and.every((m) => O(m, n)) : "equals" in i ? n === i.equals : "starts_with" in i ? n.startsWith(i.starts_with) : "ends_with" in i ? n.endsWith(i.ends_with) : "contains" in i ? n.includes(i.contains) : "regex" in i ? new RegExp(i.regex).test(n) : !1;
13504
16292
  }
13505
- function Yt(i, s) {
13506
- const m = s.toLowerCase().trim(), n = i.find((u) => u.id === m);
13507
- return n || i.find((u) => u.provider_match && j(u.provider_match, m));
16293
+ function Yt(i, n) {
16294
+ const m = n.toLowerCase().trim(), s = i.find((u) => u.id === m);
16295
+ return s || i.find((u) => u.provider_match && O(u.provider_match, m));
13508
16296
  }
13509
- function Jt(i, { modelId: s, providerApiUrl: m, providerId: n }) {
13510
- if (n)
13511
- return Yt(i, n);
16297
+ function Jt(i, { modelId: n, providerApiUrl: m, providerId: s }) {
16298
+ if (s)
16299
+ return Yt(i, s);
13512
16300
  if (m)
13513
16301
  return i.find((u) => new RegExp(u.api_pattern).test(m));
13514
- if (s)
13515
- return i.find((u) => u.model_match && j(u.model_match, s));
16302
+ if (n)
16303
+ return i.find((u) => u.model_match && O(u.model_match, n));
13516
16304
  }
13517
- function Zt(i, s) {
13518
- return i.find((m) => j(m.match, s));
16305
+ function Zt(i, n) {
16306
+ return i.find((m) => O(m.match, n));
13519
16307
  }
13520
16308
  let Xt = it;
13521
16309
  Promise.resolve(it);
13522
- function te(i, s, m) {
13523
- const n = s.toLowerCase().trim(), u = m?.provider ?? Jt(Xt, { modelId: n, providerApiUrl: m?.providerApiUrl, providerId: m?.providerId });
16310
+ function te(i, n, m) {
16311
+ const s = n.toLowerCase().trim(), u = m?.provider ?? Jt(Xt, { modelId: s, providerApiUrl: m?.providerApiUrl, providerId: m?.providerId });
13524
16312
  if (!u) return null;
13525
- const k = Zt(u.models, n);
16313
+ const k = Zt(u.models, s);
13526
16314
  if (!k) return null;
13527
- const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Kt(k, _), f = Ut(i, h);
16315
+ const h = m?.timestamp ?? /* @__PURE__ */ new Date(), _ = Ut(k, h), f = Wt(i, _);
13528
16316
  return {
13529
16317
  auto_update_timestamp: void 0,
13530
16318
  model: k,
13531
- model_price: h,
16319
+ model_price: _,
13532
16320
  provider: u,
13533
16321
  ...f
13534
16322
  };
13535
16323
  }
13536
- const b = dt(Ct(process.argv)).scriptName("genai-prices").command(
16324
+ const w = dt(Rt(process.argv)).scriptName("genai-prices").command(
13537
16325
  "list [provider]",
13538
16326
  "List providers and models",
13539
16327
  (i) => i.positional("provider", { describe: "Provider ID to filter", type: "string" })
@@ -13543,54 +16331,54 @@ const b = dt(Ct(process.argv)).scriptName("genai-prices").command(
13543
16331
  (i) => i.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" })
13544
16332
  ).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();
13545
16333
  function ee() {
13546
- if (b._[0] === "list") {
16334
+ if (w._[0] === "list") {
13547
16335
  const m = it;
13548
- if (b.provider) {
13549
- const n = m.find((u) => u.id === b.provider);
13550
- n || (console.error(`Provider ${b.provider} not found.`), process.exit(1)), console.log(`${n.name}: (${n.models.length} models)`);
13551
- for (const u of n.models)
13552
- console.log(` ${n.id}:${u.id}${u.name ? ": " + u.name : ""}`);
16336
+ if (w.provider) {
16337
+ const s = m.find((u) => u.id === w.provider);
16338
+ s || (console.error(`Provider ${w.provider} not found.`), process.exit(1)), console.log(`${s.name}: (${s.models.length} models)`);
16339
+ for (const u of s.models)
16340
+ console.log(` ${s.id}:${u.id}${u.name ? ": " + u.name : ""}`);
13553
16341
  } else
13554
- for (const n of m) {
13555
- console.log(`${n.name}: (${n.models.length} models)`);
13556
- for (const u of n.models)
13557
- console.log(` ${n.id}:${u.id}${u.name ? ": " + u.name : ""}`);
16342
+ for (const s of m) {
16343
+ console.log(`${s.name}: (${s.models.length} models)`);
16344
+ for (const u of s.models)
16345
+ console.log(` ${s.id}:${u.id}${u.name ? ": " + u.name : ""}`);
13558
16346
  }
13559
16347
  process.exit(0);
13560
16348
  }
13561
- const s = b._[0] === "calc" ? Array.isArray(b.model) ? b.model : [b.model] : b._.filter((m) => typeof m == "string");
13562
- if (s.length > 0) {
16349
+ const n = w._[0] === "calc" ? Array.isArray(w.model) ? w.model : [w.model] : w._.filter((m) => typeof m == "string");
16350
+ if (n.length > 0) {
13563
16351
  const m = {
13564
- cache_audio_read_tokens: b["cache-audio-read-tokens"] !== void 0 ? Number(b["cache-audio-read-tokens"]) : void 0,
13565
- cache_read_tokens: b["cache-read-tokens"] !== void 0 ? Number(b["cache-read-tokens"]) : void 0,
13566
- cache_write_tokens: b["cache-write-tokens"] !== void 0 ? Number(b["cache-write-tokens"]) : void 0,
13567
- input_audio_tokens: b["input-audio-tokens"] !== void 0 ? Number(b["input-audio-tokens"]) : void 0,
13568
- input_tokens: b["input-tokens"] !== void 0 ? Number(b["input-tokens"]) : void 0,
13569
- output_audio_tokens: b["output-audio-tokens"] !== void 0 ? Number(b["output-audio-tokens"]) : void 0,
13570
- output_tokens: b["output-tokens"] !== void 0 ? Number(b["output-tokens"]) : void 0,
13571
- requests: b.requests !== void 0 ? Number(b.requests) : void 0
13572
- }, n = b.timestamp ? new Date(String(b.timestamp)) : void 0;
16352
+ cache_audio_read_tokens: w["cache-audio-read-tokens"] !== void 0 ? Number(w["cache-audio-read-tokens"]) : void 0,
16353
+ cache_read_tokens: w["cache-read-tokens"] !== void 0 ? Number(w["cache-read-tokens"]) : void 0,
16354
+ cache_write_tokens: w["cache-write-tokens"] !== void 0 ? Number(w["cache-write-tokens"]) : void 0,
16355
+ input_audio_tokens: w["input-audio-tokens"] !== void 0 ? Number(w["input-audio-tokens"]) : void 0,
16356
+ input_tokens: w["input-tokens"] !== void 0 ? Number(w["input-tokens"]) : void 0,
16357
+ output_audio_tokens: w["output-audio-tokens"] !== void 0 ? Number(w["output-audio-tokens"]) : void 0,
16358
+ output_tokens: w["output-tokens"] !== void 0 ? Number(w["output-tokens"]) : void 0,
16359
+ requests: w.requests !== void 0 ? Number(w.requests) : void 0
16360
+ }, s = w.timestamp ? new Date(String(w.timestamp)) : void 0;
13573
16361
  let u = !1;
13574
- for (const k of s) {
13575
- let _, h = k;
13576
- h.includes(":") && ([_, h] = h.split(":", 2));
16362
+ for (const k of n) {
16363
+ let h, _ = k;
16364
+ _.includes(":") && ([h, _] = _.split(":", 2));
13577
16365
  try {
13578
- const f = te(m, h, { providerId: _, timestamp: n });
16366
+ const f = te(m, _, { providerId: h, timestamp: s });
13579
16367
  if (!f) {
13580
16368
  u = !0, console.error(`No price found for model ${k}`);
13581
16369
  continue;
13582
16370
  }
13583
- const y = f.model.context_window, P = [
16371
+ const x = f.model.context_window, M = [
13584
16372
  ["Provider", f.provider.name],
13585
16373
  ["Model", f.model.name ?? f.model.id],
13586
16374
  ["Model Prices", JSON.stringify(f.model_price)],
13587
- ["Context Window", y !== void 0 ? y.toLocaleString() : void 0],
16375
+ ["Context Window", x !== void 0 ? x.toLocaleString() : void 0],
13588
16376
  ["Total Price", `$${f.total_price}`],
13589
16377
  ["Input Price", `$${f.input_price}`],
13590
16378
  ["Output Price", `$${f.output_price}`]
13591
16379
  ];
13592
- for (const [S, G] of P)
13593
- G !== void 0 && console.log(`${S.padStart(14)}: ${G}`);
16380
+ for (const [P, T] of M)
16381
+ T !== void 0 && console.log(`${P.padStart(14)}: ${T}`);
13594
16382
  console.log("");
13595
16383
  } catch (f) {
13596
16384
  u = !0, f instanceof Error && console.error(`Error for model ${k}:`, f.message);