@pydantic/genai-prices 0.0.43 → 0.0.44

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
@@ -26,24 +26,24 @@ function W(i) {
26
26
  if (i !== i.toLowerCase() && i !== i.toUpperCase() || (i = i.toLowerCase()), i.indexOf("-") === -1 && i.indexOf("_") === -1)
27
27
  return i;
28
28
  {
29
- let m = "", s = !1;
29
+ let m = "", n = !1;
30
30
  const u = i.match(/^-+/);
31
31
  for (let k = u ? u[0].length : 0; k < i.length; k++) {
32
32
  let _ = i.charAt(k);
33
- s && (s = !1, _ = _.toUpperCase()), k !== 0 && (_ === "-" || _ === "_") ? s = !0 : _ !== "-" && _ !== "_" && (m += _);
33
+ n && (n = !1, _ = _.toUpperCase()), k !== 0 && (_ === "-" || _ === "_") ? n = !0 : _ !== "-" && _ !== "_" && (m += _);
34
34
  }
35
35
  return m;
36
36
  }
37
37
  }
38
- function Ot(i, n) {
38
+ function Ot(i, s) {
39
39
  const m = i.toLowerCase();
40
- n = n || "-";
41
- let s = "";
40
+ s = s || "-";
41
+ let n = "";
42
42
  for (let u = 0; u < i.length; u++) {
43
43
  const k = m.charAt(u), _ = i.charAt(u);
44
- k !== _ && u > 0 ? s += `${n}${m.charAt(u)}` : s += _;
44
+ k !== _ && u > 0 ? n += `${s}${m.charAt(u)}` : n += _;
45
45
  }
46
- return s;
46
+ return n;
47
47
  }
48
48
  function Rt(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);
@@ -57,14 +57,14 @@ function Et(i) {
57
57
  if (Array.isArray(i))
58
58
  return i.map((_) => typeof _ != "string" ? _ + "" : _);
59
59
  i = i.trim();
60
- let n = 0, m = null, s = null, u = null;
60
+ let s = 0, m = null, n = null, u = null;
61
61
  const k = [];
62
62
  for (let _ = 0; _ < i.length; _++) {
63
- if (m = s, s = i.charAt(_), s === " " && !u) {
64
- m !== " " && n++;
63
+ if (m = n, n = i.charAt(_), n === " " && !u) {
64
+ m !== " " && s++;
65
65
  continue;
66
66
  }
67
- s === u ? u = null : (s === "'" || s === '"') && !u && (u = s), k[n] || (k[n] = ""), k[n] += s;
67
+ n === u ? u = null : (n === "'" || n === '"') && !u && (u = n), k[s] || (k[s] = ""), k[s] += n;
68
68
  }
69
69
  return k;
70
70
  }
@@ -84,11 +84,11 @@ var I;
84
84
  */
85
85
  let A;
86
86
  class Nt {
87
- constructor(n) {
88
- A = n;
87
+ constructor(s) {
88
+ A = s;
89
89
  }
90
- parse(n, m) {
91
- const s = Object.assign({
90
+ parse(s, m) {
91
+ const n = 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(n), k = typeof n == "string", _ = zt(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), h = Object.assign({
108
+ }, m), u = Et(s), k = typeof s == "string", _ = zt(Object.assign(/* @__PURE__ */ Object.create(null), n.alias)), h = Object.assign({
109
109
  "boolean-negation": !0,
110
110
  "camel-case-expansion": !0,
111
111
  "combine-arrays": !1,
@@ -124,7 +124,7 @@ class Nt {
124
124
  "strip-aliased": !1,
125
125
  "strip-dashed": !1,
126
126
  "unknown-options-as-args": !1
127
- }, s.configuration), f = Object.assign(/* @__PURE__ */ Object.create(null), s.default), y = s.configObjects || [], P = s.envPrefix, S = h["populate--"], G = S ? "--" : "_", Q = /* @__PURE__ */ Object.create(null), ot = /* @__PURE__ */ Object.create(null), C = s.__ || A.format, r = {
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 = {
128
128
  aliases: /* @__PURE__ */ Object.create(null),
129
129
  arrays: /* @__PURE__ */ Object.create(null),
130
130
  bools: /* @__PURE__ */ Object.create(null),
@@ -137,7 +137,7 @@ class Nt {
137
137
  coercions: /* @__PURE__ */ Object.create(null),
138
138
  keys: []
139
139
  }, L = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, U = new RegExp("^--" + h["negation-prefix"] + "(.+)");
140
- [].concat(s.array || []).filter(Boolean).forEach(function(t) {
140
+ [].concat(n.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,25 +146,25 @@ 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(s.boolean || []).filter(Boolean).forEach(function(t) {
149
+ }), [].concat(n.boolean || []).filter(Boolean).forEach(function(t) {
150
150
  r.bools[t] = !0, r.keys.push(t);
151
- }), [].concat(s.string || []).filter(Boolean).forEach(function(t) {
151
+ }), [].concat(n.string || []).filter(Boolean).forEach(function(t) {
152
152
  r.strings[t] = !0, r.keys.push(t);
153
- }), [].concat(s.number || []).filter(Boolean).forEach(function(t) {
153
+ }), [].concat(n.number || []).filter(Boolean).forEach(function(t) {
154
154
  r.numbers[t] = !0, r.keys.push(t);
155
- }), [].concat(s.count || []).filter(Boolean).forEach(function(t) {
155
+ }), [].concat(n.count || []).filter(Boolean).forEach(function(t) {
156
156
  r.counts[t] = !0, r.keys.push(t);
157
- }), [].concat(s.normalize || []).filter(Boolean).forEach(function(t) {
157
+ }), [].concat(n.normalize || []).filter(Boolean).forEach(function(t) {
158
158
  r.normalize[t] = !0, r.keys.push(t);
159
- }), typeof s.narg == "object" && Object.entries(s.narg).forEach(([t, a]) => {
159
+ }), typeof n.narg == "object" && Object.entries(n.narg).forEach(([t, a]) => {
160
160
  typeof a == "number" && (r.nargs[t] = a, r.keys.push(t));
161
- }), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([t, a]) => {
161
+ }), typeof n.coerce == "object" && Object.entries(n.coerce).forEach(([t, a]) => {
162
162
  typeof a == "function" && (r.coercions[t] = a, r.keys.push(t));
163
- }), typeof s.config < "u" && (Array.isArray(s.config) || typeof s.config == "string" ? [].concat(s.config).filter(Boolean).forEach(function(t) {
163
+ }), typeof n.config < "u" && (Array.isArray(n.config) || typeof n.config == "string" ? [].concat(n.config).filter(Boolean).forEach(function(t) {
164
164
  r.configs[t] = !0;
165
- }) : typeof s.config == "object" && Object.entries(s.config).forEach(([t, a]) => {
165
+ }) : typeof n.config == "object" && Object.entries(n.config).forEach(([t, a]) => {
166
166
  (typeof a == "boolean" || typeof a == "function") && (r.configs[t] = a);
167
- })), qt(s.key, _, s.default, r.arrays), Object.keys(f).forEach(function(t) {
167
+ })), qt(n.key, _, n.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
  });
@@ -172,7 +172,7 @@ class Nt {
172
172
  let B = null;
173
173
  Mt();
174
174
  let F = [];
175
- const w = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), nt = {};
175
+ const w = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), st = {};
176
176
  for (let t = 0; t < u.length; t++) {
177
177
  const a = u[t], c = a.replace(/^-{3,}/, "---");
178
178
  let o, e, p, l, d, v;
@@ -276,7 +276,7 @@ class Nt {
276
276
  const p = t.split(".").map(function(l) {
277
277
  return W(l);
278
278
  }).join(".");
279
- st(t, p);
279
+ nt(t, p);
280
280
  }
281
281
  const o = Y(t, a, c), e = t.split(".");
282
282
  N(w, e, o), r.aliases[t] && r.aliases[t].forEach(function(p) {
@@ -287,7 +287,7 @@ class Nt {
287
287
  const d = [].concat(e);
288
288
  d.shift(), l = l.concat(d), (r.aliases[t] || []).includes(l.join(".")) || N(w, l, o);
289
289
  }), g(t, r.normalize) && !g(t, r.arrays) && [t].concat(r.aliases[t] || []).forEach(function(l) {
290
- Object.defineProperty(nt, l, {
290
+ Object.defineProperty(st, l, {
291
291
  enumerable: !0,
292
292
  get() {
293
293
  return a;
@@ -298,8 +298,8 @@ class Nt {
298
298
  });
299
299
  });
300
300
  }
301
- function st(t, a) {
302
- r.aliases[t] && r.aliases[t].length || (r.aliases[t] = [a], Q[a] = !0), r.aliases[a] && r.aliases[a].length || st(a, t);
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);
303
303
  }
304
304
  function Y(t, a, c) {
305
305
  c && (a = jt(a)), (g(t, r.bools) || g(t, r.counts)) && typeof a == "string" && (a = a === "true");
@@ -486,7 +486,7 @@ class Nt {
486
486
  }
487
487
  return {
488
488
  aliases: Object.assign({}, r.aliases),
489
- argv: Object.assign(nt, w),
489
+ argv: Object.assign(st, w),
490
490
  configuration: h,
491
491
  defaulted: Object.assign({}, ot),
492
492
  error: B,
@@ -495,22 +495,22 @@ class Nt {
495
495
  }
496
496
  }
497
497
  function zt(i) {
498
- const n = [], m = /* @__PURE__ */ Object.create(null);
499
- let s = !0;
498
+ const s = [], m = /* @__PURE__ */ Object.create(null);
499
+ let n = !0;
500
500
  for (Object.keys(i).forEach(function(u) {
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(h) {
507
- return n[k].indexOf(h) !== -1;
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;
508
508
  }).length) {
509
- n[u] = n[u].concat(n[k]), n.splice(k, 1), s = !0;
509
+ s[u] = s[u].concat(s[k]), s.splice(k, 1), n = !0;
510
510
  break;
511
511
  }
512
512
  }
513
- return n.forEach(function(u) {
513
+ return s.forEach(function(u) {
514
514
  u = u.filter(function(_, h, f) {
515
515
  return f.indexOf(_) === h;
516
516
  });
@@ -573,93 +573,93 @@ const Ft = {
573
573
  };
574
574
  let M;
575
575
  class Dt {
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 = [];
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 = [];
578
578
  }
579
- __(...n) {
579
+ __(...s) {
580
580
  if (typeof arguments[0] != "string")
581
581
  return this._taggedLiteral(arguments[0], ...arguments);
582
- const m = n.shift();
583
- let s = function() {
582
+ const m = s.shift();
583
+ let n = function() {
584
584
  };
585
- return typeof n[n.length - 1] == "function" && (s = n.pop()), s = s || function() {
585
+ return typeof s[s.length - 1] == "function" && (n = s.pop()), n = n || 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: s
590
- })) : s(), M.format.apply(M.format, [this.cache[this.locale][m] || m].concat(n));
589
+ cb: n
590
+ })) : n(), M.format.apply(M.format, [this.cache[this.locale][m] || m].concat(s));
591
591
  }
592
592
  __n() {
593
- const n = Array.prototype.slice.call(arguments), m = n.shift(), s = n.shift(), u = n.shift();
593
+ const s = Array.prototype.slice.call(arguments), m = s.shift(), n = s.shift(), u = s.shift();
594
594
  let k = function() {
595
595
  };
596
- typeof n[n.length - 1] == "function" && (k = n.pop()), this.cache[this.locale] || this._readLocaleFile();
597
- let _ = u === 1 ? m : s;
596
+ typeof s[s.length - 1] == "function" && (k = s.pop()), this.cache[this.locale] || this._readLocaleFile();
597
+ let _ = u === 1 ? m : n;
598
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] = {
599
599
  one: m,
600
- other: s
600
+ other: n
601
601
  }, this._enqueueWrite({
602
602
  directory: this.directory,
603
603
  locale: this.locale,
604
604
  cb: k
605
605
  })) : k();
606
606
  const h = [_];
607
- return ~_.indexOf("%d") && h.push(u), M.format.apply(M.format, h.concat(n));
607
+ return ~_.indexOf("%d") && h.push(u), M.format.apply(M.format, h.concat(s));
608
608
  }
609
- setLocale(n) {
610
- this.locale = n;
609
+ setLocale(s) {
610
+ this.locale = s;
611
611
  }
612
612
  getLocale() {
613
613
  return this.locale;
614
614
  }
615
- updateLocale(n) {
615
+ updateLocale(s) {
616
616
  this.cache[this.locale] || this._readLocaleFile();
617
- for (const m in n)
618
- Object.prototype.hasOwnProperty.call(n, m) && (this.cache[this.locale][m] = n[m]);
617
+ for (const m in s)
618
+ Object.prototype.hasOwnProperty.call(s, m) && (this.cache[this.locale][m] = s[m]);
619
619
  }
620
- _taggedLiteral(n, ...m) {
621
- let s = "";
622
- return n.forEach(function(u, k) {
620
+ _taggedLiteral(s, ...m) {
621
+ let n = "";
622
+ return s.forEach(function(u, k) {
623
623
  const _ = m[k + 1];
624
- s += u, typeof _ < "u" && (s += "%s");
625
- }), this.__.apply(this, [s].concat([].slice.call(m, 1)));
624
+ n += u, typeof _ < "u" && (n += "%s");
625
+ }), this.__.apply(this, [n].concat([].slice.call(m, 1)));
626
626
  }
627
- _enqueueWrite(n) {
628
- this.writeQueue.push(n), this.writeQueue.length === 1 && this._processWriteQueue();
627
+ _enqueueWrite(s) {
628
+ this.writeQueue.push(s), this.writeQueue.length === 1 && this._processWriteQueue();
629
629
  }
630
630
  _processWriteQueue() {
631
- const n = this, m = this.writeQueue[0], s = m.directory, u = m.locale, k = m.cb, _ = this._resolveLocaleFile(s, u), h = JSON.stringify(this.cache[u], null, 2);
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
632
  M.fs.writeFile(_, h, "utf-8", function(f) {
633
- n.writeQueue.shift(), n.writeQueue.length > 0 && n._processWriteQueue(), k(f);
633
+ s.writeQueue.shift(), s.writeQueue.length > 0 && s._processWriteQueue(), k(f);
634
634
  });
635
635
  }
636
636
  _readLocaleFile() {
637
- let n = {};
637
+ let s = {};
638
638
  const m = this._resolveLocaleFile(this.directory, this.locale);
639
639
  try {
640
- M.fs.readFileSync && (n = JSON.parse(M.fs.readFileSync(m, "utf-8")));
641
- } catch (s) {
642
- if (s instanceof SyntaxError && (s.message = "syntax error in " + m), s.code === "ENOENT")
643
- n = {};
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 = {};
644
644
  else
645
- throw s;
645
+ throw n;
646
646
  }
647
- this.cache[this.locale] = n;
647
+ this.cache[this.locale] = s;
648
648
  }
649
- _resolveLocaleFile(n, m) {
650
- let s = M.resolve(n, "./", m + ".json");
651
- if (this.fallbackToLanguage && !this._fileExistsSync(s) && ~m.lastIndexOf("_")) {
652
- const u = M.resolve(n, "./", m.split("_")[0] + ".json");
653
- this._fileExistsSync(u) && (s = u);
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);
654
654
  }
655
- return s;
655
+ return n;
656
656
  }
657
- _fileExistsSync(n) {
658
- return M.exists(n);
657
+ _fileExistsSync(s) {
658
+ return M.exists(s);
659
659
  }
660
660
  }
661
- function Vt(i, n) {
662
- M = n;
661
+ function Vt(i, s) {
662
+ M = s;
663
663
  const m = new Dt(i);
664
664
  return {
665
665
  __: m.__.bind(m),
@@ -1944,6 +1944,111 @@ const it = [
1944
1944
  pricing_urls: ["https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/#pricing"],
1945
1945
  api_pattern: "(https?://)?([^.]*\\.)?(?:openai\\.azure\\.com|azure-api\\.net|cognitiveservices\\.azure\\.com)",
1946
1946
  price_comments: 'These are prices for "*-Global" models, prices for "Regional" models are often slightly higher. Retired models are listed at https://learn.microsoft.com/th-th/azure/ai-foundry/openai/concepts/legacy-models',
1947
+ extractors: [
1948
+ {
1949
+ api_flavor: "chat",
1950
+ root: "usage",
1951
+ model_path: "model",
1952
+ mappings: [
1953
+ {
1954
+ path: "prompt_tokens",
1955
+ dest: "input_tokens",
1956
+ required: !0
1957
+ },
1958
+ {
1959
+ path: ["prompt_tokens_details", "cached_tokens"],
1960
+ dest: "cache_read_tokens",
1961
+ required: !1
1962
+ },
1963
+ {
1964
+ path: ["prompt_tokens_details", "audio_tokens"],
1965
+ dest: "input_audio_tokens",
1966
+ required: !1
1967
+ },
1968
+ {
1969
+ path: ["completion_tokens_details", "audio_tokens"],
1970
+ dest: "output_audio_tokens",
1971
+ required: !1
1972
+ },
1973
+ {
1974
+ path: "completion_tokens",
1975
+ dest: "output_tokens",
1976
+ required: !0
1977
+ }
1978
+ ]
1979
+ },
1980
+ {
1981
+ api_flavor: "responses",
1982
+ root: "usage",
1983
+ model_path: "model",
1984
+ mappings: [
1985
+ {
1986
+ path: "input_tokens",
1987
+ dest: "input_tokens",
1988
+ required: !0
1989
+ },
1990
+ {
1991
+ path: ["input_tokens_details", "cached_tokens"],
1992
+ dest: "cache_read_tokens",
1993
+ required: !1
1994
+ },
1995
+ {
1996
+ path: "output_tokens",
1997
+ dest: "output_tokens",
1998
+ required: !0
1999
+ }
2000
+ ]
2001
+ },
2002
+ {
2003
+ api_flavor: "embeddings",
2004
+ root: "usage",
2005
+ model_path: "model",
2006
+ mappings: [
2007
+ {
2008
+ path: "prompt_tokens",
2009
+ dest: "input_tokens",
2010
+ required: !0
2011
+ }
2012
+ ]
2013
+ },
2014
+ {
2015
+ api_flavor: "anthropic",
2016
+ root: "usage",
2017
+ model_path: "model",
2018
+ mappings: [
2019
+ {
2020
+ path: "input_tokens",
2021
+ dest: "input_tokens",
2022
+ required: !0
2023
+ },
2024
+ {
2025
+ path: "cache_creation_input_tokens",
2026
+ dest: "input_tokens",
2027
+ required: !1
2028
+ },
2029
+ {
2030
+ path: "cache_read_input_tokens",
2031
+ dest: "input_tokens",
2032
+ required: !1
2033
+ },
2034
+ {
2035
+ path: "cache_creation_input_tokens",
2036
+ dest: "cache_write_tokens",
2037
+ required: !1
2038
+ },
2039
+ {
2040
+ path: "cache_read_input_tokens",
2041
+ dest: "cache_read_tokens",
2042
+ required: !1
2043
+ },
2044
+ {
2045
+ path: "output_tokens",
2046
+ dest: "output_tokens",
2047
+ required: !0
2048
+ }
2049
+ ]
2050
+ }
2051
+ ],
1947
2052
  models: [
1948
2053
  {
1949
2054
  id: "ada",
@@ -13335,22 +13440,22 @@ Compared to other leading proprietary and open-weights models Command A delivers
13335
13440
  ]
13336
13441
  }
13337
13442
  ];
13338
- function Wt(i, n) {
13339
- if (n <= 0) return 0;
13443
+ function Wt(i, s) {
13444
+ if (s <= 0) return 0;
13340
13445
  let m = 0;
13341
- const s = [...i.tiers].sort((_, h) => _.start - h.start), u = s[0]?.start ?? n, k = Math.min(n, u);
13446
+ const n = [...i.tiers].sort((_, h) => _.start - h.start), u = n[0]?.start ?? s, k = Math.min(s, u);
13342
13447
  m += k * i.base / 1e6;
13343
- for (let _ = 0; _ < s.length; _++) {
13344
- const h = s[_], f = s[_ + 1]?.start ?? 1 / 0, y = Math.max(0, Math.min(n, f) - h.start);
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);
13345
13450
  y > 0 && (m += y * h.price / 1e6);
13346
13451
  }
13347
13452
  return m;
13348
13453
  }
13349
- function O(i, n, m) {
13350
- return i === void 0 || n === void 0 ? 0 : typeof i == "number" ? i * n / 1e6 : Wt(i, n);
13454
+ function O(i, s, m) {
13455
+ return i === void 0 || s === void 0 ? 0 : typeof i == "number" ? i * s / 1e6 : Wt(i, s);
13351
13456
  }
13352
- function Ut(i, n) {
13353
- let m = 0, s = 0;
13457
+ function Ut(i, s) {
13458
+ let m = 0, n = 0;
13354
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;
13355
13460
  let f = i.input_audio_tokens ?? 0;
13356
13461
  if (f -= _, f < 0)
@@ -13361,63 +13466,63 @@ function Ut(i, n) {
13361
13466
  let P = u;
13362
13467
  if (P -= _, P < 0)
13363
13468
  throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
13364
- m += O(n.input_mtok, y), m += O(n.cache_read_mtok, P), m += O(n.cache_write_mtok, k), m += O(n.input_audio_mtok, f), m += O(n.cache_audio_read_mtok, _);
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, _);
13365
13470
  let S = i.output_tokens ?? 0;
13366
13471
  if (S -= h, S < 0)
13367
13472
  throw new Error("output_audio_tokens cannot be greater than output_tokens");
13368
- s += O(n.output_mtok, S), s += O(n.output_audio_mtok, i.output_audio_tokens);
13369
- let G = m + s;
13370
- return n.requests_kcount !== void 0 && (G += n.requests_kcount / 1e3), {
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), {
13371
13476
  input_price: m,
13372
- output_price: s,
13477
+ output_price: n,
13373
13478
  total_price: G
13374
13479
  };
13375
13480
  }
13376
- function Kt(i, n) {
13481
+ function Kt(i, s) {
13377
13482
  if (!Array.isArray(i.prices))
13378
13483
  return i.prices;
13379
13484
  for (let m = i.prices.length - 1; m >= 0; m--) {
13380
- const s = i.prices[m], u = s.constraint;
13485
+ const n = i.prices[m], u = n.constraint;
13381
13486
  if (u === void 0)
13382
- return s.prices;
13487
+ return n.prices;
13383
13488
  if (u.type === "start_date") {
13384
- if (n >= new Date(u.start_date))
13385
- return s.prices;
13489
+ if (s >= new Date(u.start_date))
13490
+ return n.prices;
13386
13491
  } else {
13387
- const k = n.toISOString().slice(11, 19), _ = u.start_time, h = u.end_time;
13492
+ const k = s.toISOString().slice(11, 19), _ = u.start_time, h = u.end_time;
13388
13493
  if (h < _) {
13389
13494
  if (k >= _ || k < h)
13390
- return s.prices;
13495
+ return n.prices;
13391
13496
  } else if (k >= _ && k < h)
13392
- return s.prices;
13497
+ return n.prices;
13393
13498
  }
13394
13499
  }
13395
13500
  return i.prices[0].prices;
13396
13501
  }
13397
- function j(i, n) {
13398
- return "or" in i ? i.or.some((m) => j(m, n)) : "and" in i ? i.and.every((m) => j(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;
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;
13399
13504
  }
13400
- function Yt(i, n) {
13401
- const m = n.toLowerCase().trim(), s = i.find((u) => u.id === m);
13402
- return s || i.find((u) => u.provider_match && j(u.provider_match, m));
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));
13403
13508
  }
13404
- function Jt(i, { modelId: n, providerApiUrl: m, providerId: s }) {
13405
- if (s)
13406
- return Yt(i, s);
13509
+ function Jt(i, { modelId: s, providerApiUrl: m, providerId: n }) {
13510
+ if (n)
13511
+ return Yt(i, n);
13407
13512
  if (m)
13408
13513
  return i.find((u) => new RegExp(u.api_pattern).test(m));
13409
- if (n)
13410
- return i.find((u) => u.model_match && j(u.model_match, n));
13514
+ if (s)
13515
+ return i.find((u) => u.model_match && j(u.model_match, s));
13411
13516
  }
13412
- function Zt(i, n) {
13413
- return i.find((m) => j(m.match, n));
13517
+ function Zt(i, s) {
13518
+ return i.find((m) => j(m.match, s));
13414
13519
  }
13415
13520
  let Xt = it;
13416
13521
  Promise.resolve(it);
13417
- function te(i, n, m) {
13418
- const s = n.toLowerCase().trim(), u = m?.provider ?? Jt(Xt, { modelId: s, providerApiUrl: m?.providerApiUrl, providerId: m?.providerId });
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 });
13419
13524
  if (!u) return null;
13420
- const k = Zt(u.models, s);
13525
+ const k = Zt(u.models, n);
13421
13526
  if (!k) return null;
13422
13527
  const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Kt(k, _), f = Ut(i, h);
13423
13528
  return {
@@ -13441,20 +13546,20 @@ function ee() {
13441
13546
  if (b._[0] === "list") {
13442
13547
  const m = it;
13443
13548
  if (b.provider) {
13444
- const s = m.find((u) => u.id === b.provider);
13445
- s || (console.error(`Provider ${b.provider} not found.`), process.exit(1)), console.log(`${s.name}: (${s.models.length} models)`);
13446
- for (const u of s.models)
13447
- console.log(` ${s.id}:${u.id}${u.name ? ": " + u.name : ""}`);
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 : ""}`);
13448
13553
  } else
13449
- for (const s of m) {
13450
- console.log(`${s.name}: (${s.models.length} models)`);
13451
- for (const u of s.models)
13452
- console.log(` ${s.id}:${u.id}${u.name ? ": " + u.name : ""}`);
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 : ""}`);
13453
13558
  }
13454
13559
  process.exit(0);
13455
13560
  }
13456
- const n = b._[0] === "calc" ? Array.isArray(b.model) ? b.model : [b.model] : b._.filter((m) => typeof m == "string");
13457
- if (n.length > 0) {
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) {
13458
13563
  const m = {
13459
13564
  cache_audio_read_tokens: b["cache-audio-read-tokens"] !== void 0 ? Number(b["cache-audio-read-tokens"]) : void 0,
13460
13565
  cache_read_tokens: b["cache-read-tokens"] !== void 0 ? Number(b["cache-read-tokens"]) : void 0,
@@ -13464,13 +13569,13 @@ function ee() {
13464
13569
  output_audio_tokens: b["output-audio-tokens"] !== void 0 ? Number(b["output-audio-tokens"]) : void 0,
13465
13570
  output_tokens: b["output-tokens"] !== void 0 ? Number(b["output-tokens"]) : void 0,
13466
13571
  requests: b.requests !== void 0 ? Number(b.requests) : void 0
13467
- }, s = b.timestamp ? new Date(String(b.timestamp)) : void 0;
13572
+ }, n = b.timestamp ? new Date(String(b.timestamp)) : void 0;
13468
13573
  let u = !1;
13469
- for (const k of n) {
13574
+ for (const k of s) {
13470
13575
  let _, h = k;
13471
13576
  h.includes(":") && ([_, h] = h.split(":", 2));
13472
13577
  try {
13473
- const f = te(m, h, { providerId: _, timestamp: s });
13578
+ const f = te(m, h, { providerId: _, timestamp: n });
13474
13579
  if (!f) {
13475
13580
  u = !0, console.error(`No price found for model ${k}`);
13476
13581
  continue;
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=[{id:"anthropic",name:"Anthropic",pricing_urls:["https://www.anthropic.com/pricing#api"],api_pattern:"https://api\\.anthropic\\.com",model_match:{contains:"claude"},provider_match:{contains:"anthropic"},extractors:[{api_flavor:"default",root:"usage",model_path:"model",mappings:[{path:"input_tokens",dest:"input_tokens",required:!0},{path:"cache_creation_input_tokens",dest:"input_tokens",required:!1},{path:"cache_read_input_tokens",dest:"input_tokens",required:!1},{path:"cache_creation_input_tokens",dest:"cache_write_tokens",required:!1},{path:"cache_read_input_tokens",dest:"cache_read_tokens",required:!1},{path:"output_tokens",dest:"output_tokens",required:!0}]},{api_flavor:"chat",root:"usage",model_path:"model",mappings:[{path:"prompt_tokens",dest:"input_tokens",required:!0},{path:"cached_tokens",dest:"cache_read_tokens",required:!1},{path:"completion_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"claude-2",name:"Claude 2.0 / 2.1",description:`Claude 2 is Anthropic's previous generation model, offering reliable performance for various tasks. This includes Claude 2.0 and Claude 2.1.
2
- `,match:{or:[{starts_with:"claude-2"},{contains:"claude-v2"}]},context_window:2e5,prices:{input_mtok:8,output_mtok:24}},{id:"claude-3-5-haiku-latest",name:"Claude Haiku 3.5",description:"Fastest, most cost-effective model",match:{or:[{starts_with:"claude-3-5-haiku"},{starts_with:"claude-3.5-haiku"}]},context_window:2e5,prices:{input_mtok:.8,cache_write_mtok:1,cache_read_mtok:.08,output_mtok:4}},{id:"claude-3-5-sonnet",name:"Claude Sonnet 3.5",description:"Claude 3.5 Sonnet is an ideal balance of intelligence and speed for enterprise workloads. Maximum utility at a lower price, dependable, balanced for scaled deployments.",match:{or:[{starts_with:"claude-3-5-sonnet"},{starts_with:"claude-3.5-sonnet"}]},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"claude-3-7-sonnet-latest",name:"Claude Sonnet 3.7",description:"Claude 3.7 Sonnet is an advanced large language model with improved reasoning, coding, and problem-solving capabilities.",match:{or:[{starts_with:"claude-3-7-sonnet"},{starts_with:"claude-3.7-sonnet"},{starts_with:"claude-sonnet-3.7"},{starts_with:"claude-sonnet-3-7"}]},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"claude-3-haiku",name:"Claude Haiku 3",description:"Fastest, most cost-effective model",match:{starts_with:"claude-3-haiku"},context_window:2e5,prices:{input_mtok:.25,cache_write_mtok:.3,cache_read_mtok:.03,output_mtok:1.25}},{id:"claude-3-opus-latest",name:"Claude Opus 3",description:"Claude 3 Opus was Anthropic's most powerful model for highly complex tasks. It boasts top-level performance, intelligence, fluency, and understanding.",match:{starts_with:"claude-3-opus"},context_window:2e5,prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"claude-3-sonnet",name:"Claude 3 Sonnet",description:"Claude 3 Sonnet is an ideal balance of intelligence and speed for enterprise workloads. Maximum utility at a lower price, dependable, balanced for scaled deployments.",match:{starts_with:"claude-3-sonnet"},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"claude-haiku-4-5",name:"Claude Haiku 4.5",description:"Fastest and most intelligent Haiku model",match:{or:[{starts_with:"claude-haiku-4-5"},{starts_with:"claude-haiku-4.5"},{starts_with:"claude-4-5-haiku"},{starts_with:"claude-4.5-haiku"}]},context_window:2e5,prices:{input_mtok:1,cache_write_mtok:1.25,cache_read_mtok:.1,output_mtok:5}},{id:"claude-instant-1",description:"Retired, here to match price sources",match:{equals:"claude-instant-1"},prices:{input_mtok:1.63,output_mtok:55.1}},{id:"claude-instant-1.2",description:"Retired, here to match price sources",match:{equals:"claude-instant-1.2"},prices:{input_mtok:1.63,output_mtok:5.51}},{id:"claude-opus-4-0",name:"Claude Opus 4",description:"Most intelligent model for complex tasks",match:{or:[{starts_with:"claude-opus-4-0"},{starts_with:"claude-4-opus"},{equals:"claude-opus-4"},{equals:"claude-opus-4-20250514"}]},context_window:2e5,prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"claude-opus-4-1",name:"Claude Opus 4.1",description:"Most intelligent model for complex tasks",match:{or:[{starts_with:"claude-opus-4-1"},{starts_with:"claude-opus-4.1"}]},context_window:2e5,prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"claude-sonnet-4-0",name:"Claude Sonnet 4",description:"Optimal balance of intelligence, cost, and speed",match:{or:[{starts_with:"claude-sonnet-4-2025"},{starts_with:"claude-sonnet-4-0"},{starts_with:"claude-sonnet-4@"},{equals:"claude-sonnet-4"},{starts_with:"claude-4-sonnet"}]},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5",description:"Most intelligent model for building agents and coding",match:{or:[{starts_with:"claude-sonnet-4-5"},{starts_with:"claude-sonnet-4.5"}]},context_window:1e6,prices:{input_mtok:{base:3,tiers:[{start:2e5,price:6}]},cache_write_mtok:{base:3.75,tiers:[{start:2e5,price:7.5}]},cache_read_mtok:{base:.3,tiers:[{start:2e5,price:.6}]},output_mtok:{base:15,tiers:[{start:2e5,price:22.5}]}}},{id:"claude-v1",description:"Retired, here to match price sources",match:{equals:"claude-v1"},prices:{input_mtok:8,output_mtok:24}}]},{id:"avian",name:"Avian",pricing_urls:["https://avian.io/pricing/"],api_pattern:"https://api\\.avian\\.io",models:[{id:"Meta-Llama-3.1-405B-Instruct",match:{equals:"Meta-Llama-3.1-405B-Instruct"},prices:{input_mtok:1.5,output_mtok:1.5}},{id:"Meta-Llama-3.1-70B-Instruct",match:{equals:"Meta-Llama-3.1-70B-Instruct"},prices:{input_mtok:.45,output_mtok:.45}},{id:"Meta-Llama-3.1-8B-Instruct",match:{equals:"Meta-Llama-3.1-8B-Instruct"},prices:{input_mtok:.1,output_mtok:.1}},{id:"Meta-Llama-3.3-70B-Instruct",match:{equals:"Meta-Llama-3.3-70B-Instruct"},prices:{input_mtok:.45,output_mtok:.45}}]},{id:"aws",name:"AWS Bedrock",pricing_urls:["https://aws.amazon.com/bedrock/pricing/"],api_pattern:"https://bedrock-runtime\\.[a-z0-9-]+\\.amazonaws\\.com/",provider_match:{contains:"bedrock"},extractors:[{api_flavor:"default",root:"usage",model_path:"model",mappings:[{path:"inputTokens",dest:"input_tokens",required:!0},{path:"outputTokens",dest:"output_tokens",required:!0}]},{api_flavor:"anthropic",root:"usage",model_path:"model",mappings:[{path:"input_tokens",dest:"input_tokens",required:!0},{path:"cache_creation_input_tokens",dest:"input_tokens",required:!1},{path:"cache_read_input_tokens",dest:"input_tokens",required:!1},{path:"cache_creation_input_tokens",dest:"cache_write_tokens",required:!1},{path:"cache_read_input_tokens",dest:"cache_read_tokens",required:!1},{path:"output_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"amazon.nova-lite-v1:0",name:"Nova Lite",description:"Amazon Nova Lite 1.0 is a very low-cost multimodal model from Amazon that focused on fast processing of image, video, and text inputs to generate text output. Amazon Nova Lite can handle real-time customer interactions, document analysis, and visual question-answering tasks with high accuracy.",match:{contains:"nova-lite"},prices:{input_mtok:.06,cache_read_mtok:.015,output_mtok:.24}},{id:"amazon.nova-micro-v1:0",name:"Nova Micro",description:"Amazon Nova Micro 1.0 is a text-only model that delivers the lowest latency responses in the Amazon Nova family of models at a very low cost. With a context length of 128K tokens and optimized for speed and cost, Amazon Nova Micro excels at tasks such as text summarization, translation, content classification, interactive chat, and brainstorming. It has simple mathematical reasoning and coding abilities.",match:{contains:"nova-micro"},prices:{input_mtok:.035,cache_read_mtok:.00875,output_mtok:.14}},{id:"amazon.nova-premier-v1:0",name:"Nova Premier",match:{contains:"nova-premier"},prices:{input_mtok:2.5,cache_read_mtok:.625,output_mtok:12.5}},{id:"amazon.nova-pro-v1:0",name:"Nova Pro",description:"Amazon Nova Pro 1.0 is a capable multimodal model from Amazon focused on providing a combination of accuracy, speed, and cost for a wide range of tasks. As of December 2024, it achieves state-of-the-art performance on key benchmarks including visual question answering (TextVQA) and video understanding (VATEX).",match:{contains:"nova-pro"},prices:{input_mtok:.8,cache_read_mtok:.2,output_mtok:3.2}},{id:"amazon.nova-sonic-v1:0",name:"Nova Sonic",match:{contains:"nova-sonic"},prices:{input_mtok:.06,output_mtok:.24,input_audio_mtok:3.4,output_audio_mtok:13.6}},{id:"amazon.titan-embed-text-v1",name:"Titan Embeddings G1 - Text",match:{contains:"titan-embed-text"},prices:{input_mtok:.1}},{id:"amazon.titan-text-express-v1",name:"Titan Text G1 - Express",match:{contains:"titan-text-express"},prices:{input_mtok:.2,output_mtok:.6}},{id:"amazon.titan-text-lite-v1",name:"Titan Text G1 - Lite",match:{contains:"titan-text-lite"},prices:{input_mtok:.15,output_mtok:.2}},{id:"deepseek.r1-v1:0",name:"DeepSeek-R1",match:{contains:"r1"},prices:{input_mtok:1.35,output_mtok:5.4}},{id:"global.anthropic.claude-haiku-4-5-20251001-v1:0",match:{starts_with:"global.anthropic.claude-haiku-4-5-20251001-v1"},prices:{input_mtok:1,cache_write_mtok:1.25,cache_read_mtok:.1,output_mtok:5}},{id:"global.anthropic.claude-sonnet-4-20250514-v1:0",match:{starts_with:"global.anthropic.claude-sonnet-4-20250514-v1"},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"global.anthropic.claude-sonnet-4-5-20250929-v1:0",match:{starts_with:"global.anthropic.claude-sonnet-4-5-20250929-v1"},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"meta.llama3-1-70b-instruct-v1:0",name:"Llama 3.1 70B Instruct",match:{contains:"llama3-1-70b-instruct"},prices:{input_mtok:.72,output_mtok:.72}},{id:"meta.llama3-1-8b-instruct-v1:0",name:"Llama 3.1 8B Instruct",match:{contains:"llama3-1-8b-instruct"},prices:{input_mtok:.22,output_mtok:.22}},{id:"meta.llama3-2-11b-instruct-v1:0",name:"Llama 3.2 11B Instruct",match:{contains:"llama3-2-11b-instruct"},prices:{input_mtok:.16,output_mtok:.16}},{id:"meta.llama3-2-1b-instruct-v1:0",name:"Llama 3.2 1B Instruct",match:{contains:"llama3-2-1b-instruct"},prices:{input_mtok:.1,output_mtok:.1}},{id:"meta.llama3-2-3b-instruct-v1:0",name:"Llama 3.2 3B Instruct",match:{contains:"llama3-2-3b-instruct"},prices:{input_mtok:.15,output_mtok:.15}},{id:"meta.llama3-2-90b-instruct-v1:0",name:"Llama 3.2 90B Instruct",match:{contains:"llama3-2-90b-instruct"},prices:{input_mtok:.72,output_mtok:.72}},{id:"meta.llama3-3-70b-instruct-v1:0",name:"Llama 3.3 70B Instruct",match:{contains:"llama3-3-70b-instruct"},prices:{input_mtok:.72,output_mtok:.72}},{id:"meta.llama3-70b-instruct-v1:0",name:"Llama 3 70B Instruct",match:{contains:"llama3-70b-instruct"},prices:{input_mtok:2.65,output_mtok:3.5}},{id:"meta.llama3-8b-instruct-v1:0",name:"Llama 3 8B Instruct",match:{contains:"llama3-8b-instruct"},prices:{input_mtok:.3,output_mtok:.6}},{id:"meta.llama4-maverick-17b-instruct-v1:0",name:"Llama 4 Maverick 17B Instruct",match:{contains:"llama4-maverick-17b-instruct"},prices:{input_mtok:.24,output_mtok:.97}},{id:"meta.llama4-scout-17b-instruct-v1:0",name:"Llama 4 Scout 17B Instruct",match:{contains:"llama4-scout-17b-instruct"},prices:{input_mtok:.17,output_mtok:.66}},{id:"mistral.mistral-7b-instruct-v0:2",name:"Mistral 7B Instruct",match:{contains:"mistral-7b-instruct"},prices:{input_mtok:.15,output_mtok:.2}},{id:"mistral.mistral-large-2402-v1:0",name:"Mistral Large (24.02)",match:{contains:"mistral-large-2402"},prices:{input_mtok:4,output_mtok:12}},{id:"mistral.mistral-small-2402-v1:0",name:"Mistral Small (24.02)",match:{contains:"mistral-small-2402"},prices:{input_mtok:1,output_mtok:3}},{id:"mistral.mixtral-8x7b-instruct-v0:1",name:"Mixtral 8x7B Instruct",match:{contains:"mixtral-8x7b-instruct"},prices:{input_mtok:.45,output_mtok:.7}},{id:"mistral.pixtral-large-2502-v1:0",name:"Pixtral Large (25.02)",match:{contains:"pixtral-large-2502"},prices:{input_mtok:2,output_mtok:6}},{id:"openai.gpt-oss-120b-1:0",name:"gpt-oss-120b",match:{contains:"gpt-oss-120b"},prices:{input_mtok:.15,output_mtok:.6}},{id:"openai.gpt-oss-20b-1:0",name:"gpt-oss-20b",match:{contains:"gpt-oss-20b"},prices:{input_mtok:.07,output_mtok:.3}},{id:"qwen.qwen3-32b-v1:0",name:"Qwen3 32B (dense)",match:{contains:"qwen3-32b"},prices:{input_mtok:.15,output_mtok:.6}},{id:"qwen.qwen3-coder-30b-a3b-v1:0",name:"Qwen3-Coder-30B-A3B-Instruct",match:{contains:"qwen3-coder-30b-a3b"},prices:{input_mtok:.15,output_mtok:.6}},{id:"regional.anthropic.claude-3-5-haiku-20241022-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-5-haiku-20241022-v1"},{starts_with:"au.anthropic.claude-3-5-haiku-20241022-v1"},{starts_with:"apac.anthropic.claude-3-5-haiku-20241022-v1"},{starts_with:"eu.anthropic.claude-3-5-haiku-20241022-v1"},{starts_with:"us-gov.anthropic.claude-3-5-haiku-20241022-v1"},{starts_with:"jp.anthropic.claude-3-5-haiku-20241022-v1"}]},prices:{input_mtok:.8,cache_write_mtok:1,cache_read_mtok:.08,output_mtok:4}},{id:"regional.anthropic.claude-3-5-sonnet-20240620-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-5-sonnet-20240620-v1"},{starts_with:"au.anthropic.claude-3-5-sonnet-20240620-v1"},{starts_with:"apac.anthropic.claude-3-5-sonnet-20240620-v1"},{starts_with:"eu.anthropic.claude-3-5-sonnet-20240620-v1"},{starts_with:"us-gov.anthropic.claude-3-5-sonnet-20240620-v1"},{starts_with:"jp.anthropic.claude-3-5-sonnet-20240620-v1"}]},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"regional.anthropic.claude-3-5-sonnet-20241022-v2:0",match:{or:[{starts_with:"us.anthropic.claude-3-5-sonnet-20241022-v2"},{starts_with:"au.anthropic.claude-3-5-sonnet-20241022-v2"},{starts_with:"apac.anthropic.claude-3-5-sonnet-20241022-v2"},{starts_with:"eu.anthropic.claude-3-5-sonnet-20241022-v2"},{starts_with:"us-gov.anthropic.claude-3-5-sonnet-20241022-v2"},{starts_with:"jp.anthropic.claude-3-5-sonnet-20241022-v2"}]},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"regional.anthropic.claude-3-7-sonnet-20250219-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-7-sonnet-20250219-v1"},{starts_with:"au.anthropic.claude-3-7-sonnet-20250219-v1"},{starts_with:"apac.anthropic.claude-3-7-sonnet-20250219-v1"},{starts_with:"eu.anthropic.claude-3-7-sonnet-20250219-v1"},{starts_with:"us-gov.anthropic.claude-3-7-sonnet-20250219-v1"},{starts_with:"jp.anthropic.claude-3-7-sonnet-20250219-v1"}]},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"regional.anthropic.claude-3-haiku-20240307-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-haiku-20240307-v1"},{starts_with:"au.anthropic.claude-3-haiku-20240307-v1"},{starts_with:"apac.anthropic.claude-3-haiku-20240307-v1"},{starts_with:"eu.anthropic.claude-3-haiku-20240307-v1"},{starts_with:"us-gov.anthropic.claude-3-haiku-20240307-v1"},{starts_with:"jp.anthropic.claude-3-haiku-20240307-v1"}]},prices:{input_mtok:.25,output_mtok:1.25}},{id:"regional.anthropic.claude-3-opus-20240229-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-opus-20240229-v1"},{starts_with:"au.anthropic.claude-3-opus-20240229-v1"},{starts_with:"apac.anthropic.claude-3-opus-20240229-v1"},{starts_with:"eu.anthropic.claude-3-opus-20240229-v1"},{starts_with:"us-gov.anthropic.claude-3-opus-20240229-v1"},{starts_with:"jp.anthropic.claude-3-opus-20240229-v1"}]},prices:{input_mtok:15,output_mtok:75}},{id:"regional.anthropic.claude-3-sonnet-20240229-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-sonnet-20240229-v1"},{starts_with:"au.anthropic.claude-3-sonnet-20240229-v1"},{starts_with:"apac.anthropic.claude-3-sonnet-20240229-v1"},{starts_with:"eu.anthropic.claude-3-sonnet-20240229-v1"},{starts_with:"us-gov.anthropic.claude-3-sonnet-20240229-v1"},{starts_with:"jp.anthropic.claude-3-sonnet-20240229-v1"}]},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"regional.anthropic.claude-haiku-4-5-20251001-v1:0",match:{or:[{starts_with:"us.anthropic.claude-haiku-4-5-20251001-v1"},{starts_with:"au.anthropic.claude-haiku-4-5-20251001-v1"},{starts_with:"apac.anthropic.claude-haiku-4-5-20251001-v1"},{starts_with:"eu.anthropic.claude-haiku-4-5-20251001-v1"},{starts_with:"us-gov.anthropic.claude-haiku-4-5-20251001-v1"},{starts_with:"jp.anthropic.claude-haiku-4-5-20251001-v1"}]},prices:{input_mtok:1.1,cache_write_mtok:1.375,cache_read_mtok:.11,output_mtok:5.5}},{id:"regional.anthropic.claude-opus-4-1-20250805-v1:0",match:{or:[{starts_with:"us.anthropic.claude-opus-4-1-20250805-v1"},{starts_with:"au.anthropic.claude-opus-4-1-20250805-v1"},{starts_with:"apac.anthropic.claude-opus-4-1-20250805-v1"},{starts_with:"eu.anthropic.claude-opus-4-1-20250805-v1"},{starts_with:"us-gov.anthropic.claude-opus-4-1-20250805-v1"},{starts_with:"jp.anthropic.claude-opus-4-1-20250805-v1"}]},prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"regional.anthropic.claude-opus-4-20250514-v1:0",match:{or:[{starts_with:"us.anthropic.claude-opus-4-20250514-v1"},{starts_with:"au.anthropic.claude-opus-4-20250514-v1"},{starts_with:"apac.anthropic.claude-opus-4-20250514-v1"},{starts_with:"eu.anthropic.claude-opus-4-20250514-v1"},{starts_with:"us-gov.anthropic.claude-opus-4-20250514-v1"},{starts_with:"jp.anthropic.claude-opus-4-20250514-v1"}]},prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"regional.anthropic.claude-sonnet-4-20250514-v1:0",match:{or:[{starts_with:"us.anthropic.claude-sonnet-4-20250514-v1"},{starts_with:"au.anthropic.claude-sonnet-4-20250514-v1"},{starts_with:"apac.anthropic.claude-sonnet-4-20250514-v1"},{starts_with:"eu.anthropic.claude-sonnet-4-20250514-v1"},{starts_with:"us-gov.anthropic.claude-sonnet-4-20250514-v1"},{starts_with:"jp.anthropic.claude-sonnet-4-20250514-v1"}]},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"regional.anthropic.claude-sonnet-4-5-20250929-v1:0",match:{or:[{starts_with:"us.anthropic.claude-sonnet-4-5-20250929-v1"},{starts_with:"au.anthropic.claude-sonnet-4-5-20250929-v1"},{starts_with:"apac.anthropic.claude-sonnet-4-5-20250929-v1"},{starts_with:"eu.anthropic.claude-sonnet-4-5-20250929-v1"},{starts_with:"us-gov.anthropic.claude-sonnet-4-5-20250929-v1"},{starts_with:"jp.anthropic.claude-sonnet-4-5-20250929-v1"}]},prices:{input_mtok:3.3,cache_write_mtok:4.125,cache_read_mtok:.33,output_mtok:16.5}}]},{id:"azure",name:"Microsoft Azure",pricing_urls:["https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/#pricing"],api_pattern:"(https?://)?([^.]*\\.)?(?:openai\\.azure\\.com|azure-api\\.net|cognitiveservices\\.azure\\.com)",price_comments:'These are prices for "*-Global" models, prices for "Regional" models are often slightly higher. Retired models are listed at https://learn.microsoft.com/th-th/azure/ai-foundry/openai/concepts/legacy-models',models:[{id:"ada",match:{or:[{equals:"ada"},{equals:"text-embedding-ada"},{equals:"text-embedding-ada-002"},{equals:"text-embedding-ada-002-v2"}]},prices:{input_mtok:.1}},{id:"babbage",match:{or:[{equals:"babbage"},{equals:"babbage-002"}]},prices:{input_mtok:.4}},{id:"curie",match:{or:[{equals:"curie"},{equals:"text-curie"},{equals:"text-curie-001"}]},prices:{input_mtok:2}},{id:"davinci",match:{or:[{equals:"davinci"},{equals:"davinci-002"},{equals:"text-davinci"},{equals:"text-davinci-002"}]},prices:{input_mtok:2}},{id:"gpt-3.5-turbo",match:{or:[{equals:"gpt-3.5-turbo"},{equals:"gpt-3.5-turbo-0301"},{equals:"gpt-3.5-turbo-0613"},{equals:"gpt-3.5-turbo-instruct"},{equals:"gpt-3.5-turbo-instruct-0914"}]},prices:{input_mtok:1.5,output_mtok:2}},{id:"gpt-3.5-turbo-0125",match:{equals:"gpt-3.5-turbo-0125"},prices:{input_mtok:.5,output_mtok:1.5}},{id:"gpt-3.5-turbo-1106",match:{equals:"gpt-3.5-turbo-1106"},prices:{input_mtok:1,output_mtok:2}},{id:"gpt-3.5-turbo-16k-0613",match:{equals:"gpt-3.5-turbo-16k-0613"},prices:{input_mtok:3,output_mtok:4}},{id:"gpt-35-16k",match:{equals:"gpt-35-16k"},prices:{input_mtok:3,output_mtok:4}},{id:"gpt-35-turbo",match:{or:[{equals:"gpt-35-turbo"},{equals:"gpt-35-turbo-0613"},{equals:"gpt-35-turbo-1106"}]},prices:{input_mtok:1.5,output_mtok:2}},{id:"gpt-35-turbo-16k",match:{or:[{equals:"gpt-35-turbo-16k"},{equals:"gpt-35-turbo-16k-0613"}]},prices:{input_mtok:3,output_mtok:4}},{id:"gpt-4",match:{or:[{equals:"gpt-4"},{equals:"gpt-4-0314"},{equals:"gpt-4-0613"}]},prices:{input_mtok:30,output_mtok:60}},{id:"gpt-4-0125-preview",match:{equals:"gpt-4-0125-preview"},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4-1106-preview",match:{equals:"gpt-4-1106-preview"},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4-1106-vision-preview",match:{equals:"gpt-4-1106-vision-preview"},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4-32k",match:{or:[{equals:"gpt-4-32k"},{equals:"gpt-4-32k-0314"},{equals:"gpt-4-32k-0613"}]},prices:{input_mtok:60,output_mtok:120}},{id:"gpt-4-preview-1106",match:{equals:"gpt-4-preview-1106"},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4-turbo",match:{or:[{equals:"gpt-4-turbo"},{equals:"gpt-4-turbo-0125-preview"},{equals:"gpt-4-turbo-2024-04-09"},{equals:"gpt-4-turbo-preview"}]},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4-vision",match:{or:[{equals:"gpt-4-vision"},{equals:"gpt-4-vision-preview"}]},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4.1",match:{or:[{equals:"gpt-4.1"},{equals:"gpt-4.1-2025-04-14"}]},prices:{input_mtok:2,cache_read_mtok:.5,output_mtok:8}},{id:"gpt-4.1-mini",match:{or:[{equals:"gpt-4.1-mini"},{equals:"gpt-4.1-mini-2025-04-14"}]},prices:{input_mtok:.4,cache_read_mtok:.1,output_mtok:1.6}},{id:"gpt-4.1-nano",match:{or:[{equals:"gpt-4.1-nano"},{equals:"gpt-4.1-nano-2025-04-14"}]},prices:{input_mtok:.1,cache_read_mtok:.03,output_mtok:.4}},{id:"gpt-4o-2024-0513",match:{or:[{equals:"gpt-4o-2024-05-13"},{equals:"gpt-4o-2024-0513"}]},prices:{input_mtok:5,output_mtok:15}},{id:"gpt-4o-2024-08-06",match:{equals:"gpt-4o-2024-08-06"},prices:{input_mtok:2.5,cache_read_mtok:1.25,output_mtok:10}},{id:"gpt-4o-2024-1120",match:{or:[{equals:"gpt-4o-2024-1120"},{equals:"gpt-4o-2024-11-20"}]},prices:{input_mtok:2.5,cache_read_mtok:1.25,output_mtok:10}},{id:"gpt-4o-mini",match:{or:[{equals:"gpt-4o-mini"},{equals:"gpt-4o-mini-0718"},{starts_with:"gpt-4o-mini-audio"}]},context_window:128e3,prices:{input_mtok:.15,cache_read_mtok:.075,output_mtok:.6,input_audio_mtok:10,output_audio_mtok:20}},{id:"gpt-4o-mini-realtime",match:{starts_with:"gpt-4o-mini-realtime"},prices:{input_mtok:.6,cache_read_mtok:.3,output_mtok:2.4,input_audio_mtok:10,cache_audio_read_mtok:.3,output_audio_mtok:20}},{id:"gpt-4o-realtime",match:{starts_with:"gpt-4o-realtime"},prices:{input_mtok:5,cache_read_mtok:2.5,output_mtok:20,input_audio_mtok:40,cache_audio_read_mtok:2.5,output_audio_mtok:80}},{id:"gpt-5",name:"GPT-5",description:"GPT-5 is OpenAI's flagship model for coding, reasoning, and agentic tasks across domains.",match:{or:[{equals:"gpt-5"},{equals:"gpt-5-2025-08-07"}]},context_window:4e5,prices:{input_mtok:1.25,cache_read_mtok:.125,output_mtok:10}},{id:"gpt-5-mini",name:"GPT-5 mini",description:"GPT-5 mini is a faster, more cost-efficient version of GPT-5. It's great for well-defined tasks and precise prompts.",match:{or:[{equals:"gpt-5-mini"},{equals:"gpt-5-mini-2025-08-07"}]},context_window:4e5,prices:{input_mtok:.25,cache_read_mtok:.025,output_mtok:2}},{id:"gpt-5-nano",name:"GPT-5 nano",description:"GPT-5 Nano is OpenAI's fastest, cheapest version of GPT-5. It's great for summarization and classification tasks.",match:{or:[{equals:"gpt-5-nano"},{equals:"gpt-5-nano-2025-04-14"}]},context_window:4e5,prices:{input_mtok:.05,cache_read_mtok:.005,output_mtok:.4}},{id:"gpt35",match:{equals:"gpt35"},prices:{input_mtok:1.5,output_mtok:2}},{id:"gpt4-turbo-preview",match:{equals:"gpt4-turbo-preview"},prices:{input_mtok:10,output_mtok:30}},{id:"mai-ds-r1:free",name:"MAI DS R1 (free)",description:"MAI-DS-R1 is a post-trained variant of DeepSeek-R1 developed by the Microsoft AI team to improve the model's responsiveness on previously blocked topics while enhancing its safety profile. Built on top of DeepSeek-R1's reasoning foundation, it integrates 110k examples from the Tulu-3 SFT dataset and 350k internally curated multilingual safety-alignment samples. The model retains strong reasoning, coding, and problem-solving capabilities, while unblocking a wide range of prompts previously restricted in R1.",match:{equals:"mai-ds-r1:free"},prices:{}},{id:"o1",match:{or:[{equals:"o1"},{equals:"o1-2024-12-17"},{equals:"o1-preview"},{equals:"o1-preview-2024-09-12"}]},prices:{input_mtok:15,cache_read_mtok:7.5,output_mtok:60}},{id:"o1-mini",match:{or:[{equals:"o1-mini"},{equals:"o1-mini-2024-09-12"}]},prices:{input_mtok:1.1,cache_read_mtok:.55,output_mtok:4.4}},{id:"o3-2025-04-16",match:{or:[{equals:"o3"},{equals:"o3-2025-04-16"}]},prices:{input_mtok:2,cache_read_mtok:.5,output_mtok:8}},{id:"o3-mini",match:{or:[{equals:"o3-mini"},{equals:"o3-mini-2025-01-31"}]},prices:{input_mtok:1.1,cache_read_mtok:.55,output_mtok:4.4}},{id:"o4-mini",match:{or:[{contains:"o4-mini"},{contains:"o4-mini-2025-04-16"}]},prices:{input_mtok:1.1,cache_read_mtok:.28,output_mtok:4.4}},{id:"phi-3-medium-128k-instruct",name:"Phi-3 Medium 128K Instruct",description:"Phi-3 128K Medium is a powerful 14-billion parameter model designed for advanced language understanding, reasoning, and instruction following. Optimized through supervised fine-tuning and preference adjustments, it excels in tasks involving common sense, mathematics, logical reasoning, and code processing.",match:{equals:"phi-3-medium-128k-instruct"},prices:{input_mtok:1,output_mtok:1}},{id:"phi-3-mini-128k-instruct",name:"Phi-3 Mini 128K Instruct",description:"Phi-3 Mini is a powerful 3.8B parameter model designed for advanced language understanding, reasoning, and instruction following. Optimized through supervised fine-tuning and preference adjustments, it excels in tasks involving common sense, mathematics, logical reasoning, and code processing.",match:{equals:"phi-3-mini-128k-instruct"},prices:{input_mtok:.1,output_mtok:.1}},{id:"phi-3.5-mini-128k-instruct",name:"Phi-3.5 Mini 128K Instruct",description:"Phi-3.5 models are lightweight, state-of-the-art open models. These models were trained with Phi-3 datasets that include both synthetic data and the filtered, publicly available websites data, with a focus on high quality and reasoning-dense properties. Phi-3.5 Mini uses 3.8B parameters, and is a dense decoder-only transformer model using the same tokenizer as Phi-3 Mini.",match:{equals:"phi-3.5-mini-128k-instruct"},prices:{input_mtok:.1,output_mtok:.1}},{id:"phi-4",name:"Phi 4",description:"Microsoft Research Phi-4 is designed to perform well in complex reasoning tasks and can operate efficiently in situations with limited memory or where quick responses are needed.",match:{equals:"phi-4"},prices:{input_mtok:.07,output_mtok:.14}},{id:"phi-4-multimodal-instruct",name:"Phi 4 Multimodal Instruct",description:"Phi-4 Multimodal Instruct is a versatile 5.6B parameter foundation model that combines advanced reasoning and instruction-following capabilities across both text and visual inputs, providing accurate text outputs. The unified architecture enables efficient, low-latency inference, suitable for edge and mobile deployments. Phi-4 Multimodal Instruct supports text inputs in multiple languages including Arabic, Chinese, English, French, German, Japanese, Spanish, and more, with visual input optimized primarily for English. It delivers impressive performance on multimodal tasks involving mathematical, scientific, and document reasoning, providing developers and enterprises a powerful yet compact model for sophisticated interactive applications. For more information, see the Phi-4 Multimodal blog post.",match:{equals:"phi-4-multimodal-instruct"},prices:{input_mtok:.05,output_mtok:.1}},{id:"phi-4-reasoning-plus",name:"Phi 4 Reasoning Plus",description:"Phi-4-reasoning-plus is an enhanced 14B parameter model from Microsoft, fine-tuned from Phi-4 with additional reinforcement learning to boost accuracy on math, science, and code reasoning tasks. It uses the same dense decoder-only transformer architecture as Phi-4, but generates longer, more comprehensive outputs structured into a step-by-step reasoning trace and final answer.",match:{equals:"phi-4-reasoning-plus"},prices:{input_mtok:.07,output_mtok:.35}},{id:"phi-4-reasoning-plus:free",name:"Phi 4 Reasoning Plus (free)",description:"Phi-4-reasoning-plus is an enhanced 14B parameter model from Microsoft, fine-tuned from Phi-4 with additional reinforcement learning to boost accuracy on math, science, and code reasoning tasks. It uses the same dense decoder-only transformer architecture as Phi-4, but generates longer, more comprehensive outputs structured into a step-by-step reasoning trace and final answer.",match:{equals:"phi-4-reasoning-plus:free"},prices:{}},{id:"phi-4-reasoning:free",name:"Phi 4 Reasoning (free)",description:"Phi-4-reasoning is a 14B parameter dense decoder-only transformer developed by Microsoft, fine-tuned from Phi-4 to enhance complex reasoning capabilities. It uses a combination of supervised fine-tuning on chain-of-thought traces and reinforcement learning, targeting math, science, and code reasoning tasks. With a 32k context window and high inference efficiency, it is optimized for structured responses in a two-part format: reasoning trace followed by a final solution.",match:{equals:"phi-4-reasoning:free"},prices:{}},{id:"text-embedding-3-large",match:{equals:"text-embedding-3-large"},prices:{input_mtok:.13}},{id:"text-embedding-3-small",match:{equals:"text-embedding-3-small"},prices:{input_mtok:.02}},{id:"wizardlm-2-8x22b",name:"WizardLM-2 8x22B",description:"WizardLM-2 8x22B is Microsoft AI's most advanced Wizard model. It demonstrates highly competitive performance compared to leading proprietary models, and it consistently outperforms all existing state-of-the-art opensource models.",match:{equals:"wizardlm-2-8x22b"},prices:{input_mtok:.48,output_mtok:.48}}]},{id:"cerebras",name:"Cerebras",pricing_urls:["https://www.cerebras.ai/pricing#pricing","https://inference-docs.cerebras.ai/models/openai-oss"],api_pattern:"https://api\\.cerebras\\.ai",model_match:{contains:"cerebras"},provider_match:{contains:"cerebras"},extractors:[{api_flavor:"chat",root:"usage",model_path:"model",mappings:[{path:"prompt_tokens",dest:"input_tokens",required:!0},{path:"completion_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"gpt-oss-120b",name:"GPT-OSS 120B",description:"OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with 120 billion parameters and 128 experts. Delivers frontier reasoning capabilities with record-breaking inference speeds on Cerebras hardware (~3,000 tokens/second).",match:{or:[{equals:"gpt-oss-120b"},{starts_with:"cerebras/gpt-oss-120b"},{starts_with:"cerebras:gpt-oss-120b"}]},context_window:131072,price_comments:"Developer tier pricing. Free tier: 65k context, Paid tier: 131k context.",prices:{input_mtok:.35,output_mtok:.75}},{id:"llama-3.3-70b",name:"Llama 3.3 70B",description:"Meta's enhanced 70B model delivering 405B-level accuracy. Optimized for chat, coding, instruction following, mathematics, and reasoning with high-speed inference on Cerebras hardware (~2,100 tokens/second).",match:{or:[{equals:"llama-3.3-70b"},{starts_with:"cerebras/llama-3.3-70b"},{starts_with:"cerebras:llama-3.3-70b"}]},context_window:128e3,price_comments:"Developer tier pricing. Free tier: 65k context, Paid tier: 128k context.",prices:{input_mtok:.85,output_mtok:1.2}},{id:"llama3.1-8b",name:"Llama 3.1 8B",description:"Meta's Llama 3.1 8B model for general-purpose tasks including chat, coding, and instruction following. Optimized for fast inference on Cerebras hardware (~2,200 tokens/second).",match:{or:[{equals:"llama3.1-8b"},{starts_with:"cerebras/llama3.1-8b"},{starts_with:"cerebras:llama3.1-8b"}]},context_window:32768,price_comments:"Developer tier pricing. Free tier: 8k context, Paid tier: 32k context.",prices:{input_mtok:.1,output_mtok:.1}},{id:"qwen-3-32b",name:"Qwen 3 32B",description:"Qwen's 32B parameter model with enhanced reasoning and coding capabilities. Supports both standard and reasoning modes for complex tasks, with fast inference speeds on Cerebras hardware (~2,600 tokens/second).",match:{or:[{equals:"qwen-3-32b"},{starts_with:"cerebras/qwen-3-32b"},{starts_with:"cerebras:qwen-3-32b"}]},context_window:131072,price_comments:"Developer tier pricing. Free tier: 65k context, Paid tier: 131k context.",prices:{input_mtok:.4,output_mtok:.8}}]},{id:"cohere",name:"Cohere",pricing_urls:["https://cohere.com/pricing"],api_pattern:"https://api\\.cohere\\.ai",model_match:{starts_with:"command-"},provider_match:{contains:"cohere"},extractors:[{api_flavor:"default",root:["usage","billed_units"],model_path:"model",mappings:[{path:"input_tokens",dest:"input_tokens",required:!0},{path:"output_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"command",name:"Command",description:"Command is an instruction-following conversational model that performs language tasks with high quality, more reliably and with a longer context than our base generative models.",match:{equals:"command"},prices:{input_mtok:1,output_mtok:2}},{id:"command-a",name:"Command A",description:`Command A is an open-weights 111B parameter model with a 256k context window focused on delivering great performance across agentic, multilingual, and coding use cases.
2
+ `,match:{or:[{starts_with:"claude-2"},{contains:"claude-v2"}]},context_window:2e5,prices:{input_mtok:8,output_mtok:24}},{id:"claude-3-5-haiku-latest",name:"Claude Haiku 3.5",description:"Fastest, most cost-effective model",match:{or:[{starts_with:"claude-3-5-haiku"},{starts_with:"claude-3.5-haiku"}]},context_window:2e5,prices:{input_mtok:.8,cache_write_mtok:1,cache_read_mtok:.08,output_mtok:4}},{id:"claude-3-5-sonnet",name:"Claude Sonnet 3.5",description:"Claude 3.5 Sonnet is an ideal balance of intelligence and speed for enterprise workloads. Maximum utility at a lower price, dependable, balanced for scaled deployments.",match:{or:[{starts_with:"claude-3-5-sonnet"},{starts_with:"claude-3.5-sonnet"}]},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"claude-3-7-sonnet-latest",name:"Claude Sonnet 3.7",description:"Claude 3.7 Sonnet is an advanced large language model with improved reasoning, coding, and problem-solving capabilities.",match:{or:[{starts_with:"claude-3-7-sonnet"},{starts_with:"claude-3.7-sonnet"},{starts_with:"claude-sonnet-3.7"},{starts_with:"claude-sonnet-3-7"}]},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"claude-3-haiku",name:"Claude Haiku 3",description:"Fastest, most cost-effective model",match:{starts_with:"claude-3-haiku"},context_window:2e5,prices:{input_mtok:.25,cache_write_mtok:.3,cache_read_mtok:.03,output_mtok:1.25}},{id:"claude-3-opus-latest",name:"Claude Opus 3",description:"Claude 3 Opus was Anthropic's most powerful model for highly complex tasks. It boasts top-level performance, intelligence, fluency, and understanding.",match:{starts_with:"claude-3-opus"},context_window:2e5,prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"claude-3-sonnet",name:"Claude 3 Sonnet",description:"Claude 3 Sonnet is an ideal balance of intelligence and speed for enterprise workloads. Maximum utility at a lower price, dependable, balanced for scaled deployments.",match:{starts_with:"claude-3-sonnet"},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"claude-haiku-4-5",name:"Claude Haiku 4.5",description:"Fastest and most intelligent Haiku model",match:{or:[{starts_with:"claude-haiku-4-5"},{starts_with:"claude-haiku-4.5"},{starts_with:"claude-4-5-haiku"},{starts_with:"claude-4.5-haiku"}]},context_window:2e5,prices:{input_mtok:1,cache_write_mtok:1.25,cache_read_mtok:.1,output_mtok:5}},{id:"claude-instant-1",description:"Retired, here to match price sources",match:{equals:"claude-instant-1"},prices:{input_mtok:1.63,output_mtok:55.1}},{id:"claude-instant-1.2",description:"Retired, here to match price sources",match:{equals:"claude-instant-1.2"},prices:{input_mtok:1.63,output_mtok:5.51}},{id:"claude-opus-4-0",name:"Claude Opus 4",description:"Most intelligent model for complex tasks",match:{or:[{starts_with:"claude-opus-4-0"},{starts_with:"claude-4-opus"},{equals:"claude-opus-4"},{equals:"claude-opus-4-20250514"}]},context_window:2e5,prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"claude-opus-4-1",name:"Claude Opus 4.1",description:"Most intelligent model for complex tasks",match:{or:[{starts_with:"claude-opus-4-1"},{starts_with:"claude-opus-4.1"}]},context_window:2e5,prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"claude-sonnet-4-0",name:"Claude Sonnet 4",description:"Optimal balance of intelligence, cost, and speed",match:{or:[{starts_with:"claude-sonnet-4-2025"},{starts_with:"claude-sonnet-4-0"},{starts_with:"claude-sonnet-4@"},{equals:"claude-sonnet-4"},{starts_with:"claude-4-sonnet"}]},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5",description:"Most intelligent model for building agents and coding",match:{or:[{starts_with:"claude-sonnet-4-5"},{starts_with:"claude-sonnet-4.5"}]},context_window:1e6,prices:{input_mtok:{base:3,tiers:[{start:2e5,price:6}]},cache_write_mtok:{base:3.75,tiers:[{start:2e5,price:7.5}]},cache_read_mtok:{base:.3,tiers:[{start:2e5,price:.6}]},output_mtok:{base:15,tiers:[{start:2e5,price:22.5}]}}},{id:"claude-v1",description:"Retired, here to match price sources",match:{equals:"claude-v1"},prices:{input_mtok:8,output_mtok:24}}]},{id:"avian",name:"Avian",pricing_urls:["https://avian.io/pricing/"],api_pattern:"https://api\\.avian\\.io",models:[{id:"Meta-Llama-3.1-405B-Instruct",match:{equals:"Meta-Llama-3.1-405B-Instruct"},prices:{input_mtok:1.5,output_mtok:1.5}},{id:"Meta-Llama-3.1-70B-Instruct",match:{equals:"Meta-Llama-3.1-70B-Instruct"},prices:{input_mtok:.45,output_mtok:.45}},{id:"Meta-Llama-3.1-8B-Instruct",match:{equals:"Meta-Llama-3.1-8B-Instruct"},prices:{input_mtok:.1,output_mtok:.1}},{id:"Meta-Llama-3.3-70B-Instruct",match:{equals:"Meta-Llama-3.3-70B-Instruct"},prices:{input_mtok:.45,output_mtok:.45}}]},{id:"aws",name:"AWS Bedrock",pricing_urls:["https://aws.amazon.com/bedrock/pricing/"],api_pattern:"https://bedrock-runtime\\.[a-z0-9-]+\\.amazonaws\\.com/",provider_match:{contains:"bedrock"},extractors:[{api_flavor:"default",root:"usage",model_path:"model",mappings:[{path:"inputTokens",dest:"input_tokens",required:!0},{path:"outputTokens",dest:"output_tokens",required:!0}]},{api_flavor:"anthropic",root:"usage",model_path:"model",mappings:[{path:"input_tokens",dest:"input_tokens",required:!0},{path:"cache_creation_input_tokens",dest:"input_tokens",required:!1},{path:"cache_read_input_tokens",dest:"input_tokens",required:!1},{path:"cache_creation_input_tokens",dest:"cache_write_tokens",required:!1},{path:"cache_read_input_tokens",dest:"cache_read_tokens",required:!1},{path:"output_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"amazon.nova-lite-v1:0",name:"Nova Lite",description:"Amazon Nova Lite 1.0 is a very low-cost multimodal model from Amazon that focused on fast processing of image, video, and text inputs to generate text output. Amazon Nova Lite can handle real-time customer interactions, document analysis, and visual question-answering tasks with high accuracy.",match:{contains:"nova-lite"},prices:{input_mtok:.06,cache_read_mtok:.015,output_mtok:.24}},{id:"amazon.nova-micro-v1:0",name:"Nova Micro",description:"Amazon Nova Micro 1.0 is a text-only model that delivers the lowest latency responses in the Amazon Nova family of models at a very low cost. With a context length of 128K tokens and optimized for speed and cost, Amazon Nova Micro excels at tasks such as text summarization, translation, content classification, interactive chat, and brainstorming. It has simple mathematical reasoning and coding abilities.",match:{contains:"nova-micro"},prices:{input_mtok:.035,cache_read_mtok:.00875,output_mtok:.14}},{id:"amazon.nova-premier-v1:0",name:"Nova Premier",match:{contains:"nova-premier"},prices:{input_mtok:2.5,cache_read_mtok:.625,output_mtok:12.5}},{id:"amazon.nova-pro-v1:0",name:"Nova Pro",description:"Amazon Nova Pro 1.0 is a capable multimodal model from Amazon focused on providing a combination of accuracy, speed, and cost for a wide range of tasks. As of December 2024, it achieves state-of-the-art performance on key benchmarks including visual question answering (TextVQA) and video understanding (VATEX).",match:{contains:"nova-pro"},prices:{input_mtok:.8,cache_read_mtok:.2,output_mtok:3.2}},{id:"amazon.nova-sonic-v1:0",name:"Nova Sonic",match:{contains:"nova-sonic"},prices:{input_mtok:.06,output_mtok:.24,input_audio_mtok:3.4,output_audio_mtok:13.6}},{id:"amazon.titan-embed-text-v1",name:"Titan Embeddings G1 - Text",match:{contains:"titan-embed-text"},prices:{input_mtok:.1}},{id:"amazon.titan-text-express-v1",name:"Titan Text G1 - Express",match:{contains:"titan-text-express"},prices:{input_mtok:.2,output_mtok:.6}},{id:"amazon.titan-text-lite-v1",name:"Titan Text G1 - Lite",match:{contains:"titan-text-lite"},prices:{input_mtok:.15,output_mtok:.2}},{id:"deepseek.r1-v1:0",name:"DeepSeek-R1",match:{contains:"r1"},prices:{input_mtok:1.35,output_mtok:5.4}},{id:"global.anthropic.claude-haiku-4-5-20251001-v1:0",match:{starts_with:"global.anthropic.claude-haiku-4-5-20251001-v1"},prices:{input_mtok:1,cache_write_mtok:1.25,cache_read_mtok:.1,output_mtok:5}},{id:"global.anthropic.claude-sonnet-4-20250514-v1:0",match:{starts_with:"global.anthropic.claude-sonnet-4-20250514-v1"},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"global.anthropic.claude-sonnet-4-5-20250929-v1:0",match:{starts_with:"global.anthropic.claude-sonnet-4-5-20250929-v1"},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"meta.llama3-1-70b-instruct-v1:0",name:"Llama 3.1 70B Instruct",match:{contains:"llama3-1-70b-instruct"},prices:{input_mtok:.72,output_mtok:.72}},{id:"meta.llama3-1-8b-instruct-v1:0",name:"Llama 3.1 8B Instruct",match:{contains:"llama3-1-8b-instruct"},prices:{input_mtok:.22,output_mtok:.22}},{id:"meta.llama3-2-11b-instruct-v1:0",name:"Llama 3.2 11B Instruct",match:{contains:"llama3-2-11b-instruct"},prices:{input_mtok:.16,output_mtok:.16}},{id:"meta.llama3-2-1b-instruct-v1:0",name:"Llama 3.2 1B Instruct",match:{contains:"llama3-2-1b-instruct"},prices:{input_mtok:.1,output_mtok:.1}},{id:"meta.llama3-2-3b-instruct-v1:0",name:"Llama 3.2 3B Instruct",match:{contains:"llama3-2-3b-instruct"},prices:{input_mtok:.15,output_mtok:.15}},{id:"meta.llama3-2-90b-instruct-v1:0",name:"Llama 3.2 90B Instruct",match:{contains:"llama3-2-90b-instruct"},prices:{input_mtok:.72,output_mtok:.72}},{id:"meta.llama3-3-70b-instruct-v1:0",name:"Llama 3.3 70B Instruct",match:{contains:"llama3-3-70b-instruct"},prices:{input_mtok:.72,output_mtok:.72}},{id:"meta.llama3-70b-instruct-v1:0",name:"Llama 3 70B Instruct",match:{contains:"llama3-70b-instruct"},prices:{input_mtok:2.65,output_mtok:3.5}},{id:"meta.llama3-8b-instruct-v1:0",name:"Llama 3 8B Instruct",match:{contains:"llama3-8b-instruct"},prices:{input_mtok:.3,output_mtok:.6}},{id:"meta.llama4-maverick-17b-instruct-v1:0",name:"Llama 4 Maverick 17B Instruct",match:{contains:"llama4-maverick-17b-instruct"},prices:{input_mtok:.24,output_mtok:.97}},{id:"meta.llama4-scout-17b-instruct-v1:0",name:"Llama 4 Scout 17B Instruct",match:{contains:"llama4-scout-17b-instruct"},prices:{input_mtok:.17,output_mtok:.66}},{id:"mistral.mistral-7b-instruct-v0:2",name:"Mistral 7B Instruct",match:{contains:"mistral-7b-instruct"},prices:{input_mtok:.15,output_mtok:.2}},{id:"mistral.mistral-large-2402-v1:0",name:"Mistral Large (24.02)",match:{contains:"mistral-large-2402"},prices:{input_mtok:4,output_mtok:12}},{id:"mistral.mistral-small-2402-v1:0",name:"Mistral Small (24.02)",match:{contains:"mistral-small-2402"},prices:{input_mtok:1,output_mtok:3}},{id:"mistral.mixtral-8x7b-instruct-v0:1",name:"Mixtral 8x7B Instruct",match:{contains:"mixtral-8x7b-instruct"},prices:{input_mtok:.45,output_mtok:.7}},{id:"mistral.pixtral-large-2502-v1:0",name:"Pixtral Large (25.02)",match:{contains:"pixtral-large-2502"},prices:{input_mtok:2,output_mtok:6}},{id:"openai.gpt-oss-120b-1:0",name:"gpt-oss-120b",match:{contains:"gpt-oss-120b"},prices:{input_mtok:.15,output_mtok:.6}},{id:"openai.gpt-oss-20b-1:0",name:"gpt-oss-20b",match:{contains:"gpt-oss-20b"},prices:{input_mtok:.07,output_mtok:.3}},{id:"qwen.qwen3-32b-v1:0",name:"Qwen3 32B (dense)",match:{contains:"qwen3-32b"},prices:{input_mtok:.15,output_mtok:.6}},{id:"qwen.qwen3-coder-30b-a3b-v1:0",name:"Qwen3-Coder-30B-A3B-Instruct",match:{contains:"qwen3-coder-30b-a3b"},prices:{input_mtok:.15,output_mtok:.6}},{id:"regional.anthropic.claude-3-5-haiku-20241022-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-5-haiku-20241022-v1"},{starts_with:"au.anthropic.claude-3-5-haiku-20241022-v1"},{starts_with:"apac.anthropic.claude-3-5-haiku-20241022-v1"},{starts_with:"eu.anthropic.claude-3-5-haiku-20241022-v1"},{starts_with:"us-gov.anthropic.claude-3-5-haiku-20241022-v1"},{starts_with:"jp.anthropic.claude-3-5-haiku-20241022-v1"}]},prices:{input_mtok:.8,cache_write_mtok:1,cache_read_mtok:.08,output_mtok:4}},{id:"regional.anthropic.claude-3-5-sonnet-20240620-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-5-sonnet-20240620-v1"},{starts_with:"au.anthropic.claude-3-5-sonnet-20240620-v1"},{starts_with:"apac.anthropic.claude-3-5-sonnet-20240620-v1"},{starts_with:"eu.anthropic.claude-3-5-sonnet-20240620-v1"},{starts_with:"us-gov.anthropic.claude-3-5-sonnet-20240620-v1"},{starts_with:"jp.anthropic.claude-3-5-sonnet-20240620-v1"}]},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"regional.anthropic.claude-3-5-sonnet-20241022-v2:0",match:{or:[{starts_with:"us.anthropic.claude-3-5-sonnet-20241022-v2"},{starts_with:"au.anthropic.claude-3-5-sonnet-20241022-v2"},{starts_with:"apac.anthropic.claude-3-5-sonnet-20241022-v2"},{starts_with:"eu.anthropic.claude-3-5-sonnet-20241022-v2"},{starts_with:"us-gov.anthropic.claude-3-5-sonnet-20241022-v2"},{starts_with:"jp.anthropic.claude-3-5-sonnet-20241022-v2"}]},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"regional.anthropic.claude-3-7-sonnet-20250219-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-7-sonnet-20250219-v1"},{starts_with:"au.anthropic.claude-3-7-sonnet-20250219-v1"},{starts_with:"apac.anthropic.claude-3-7-sonnet-20250219-v1"},{starts_with:"eu.anthropic.claude-3-7-sonnet-20250219-v1"},{starts_with:"us-gov.anthropic.claude-3-7-sonnet-20250219-v1"},{starts_with:"jp.anthropic.claude-3-7-sonnet-20250219-v1"}]},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"regional.anthropic.claude-3-haiku-20240307-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-haiku-20240307-v1"},{starts_with:"au.anthropic.claude-3-haiku-20240307-v1"},{starts_with:"apac.anthropic.claude-3-haiku-20240307-v1"},{starts_with:"eu.anthropic.claude-3-haiku-20240307-v1"},{starts_with:"us-gov.anthropic.claude-3-haiku-20240307-v1"},{starts_with:"jp.anthropic.claude-3-haiku-20240307-v1"}]},prices:{input_mtok:.25,output_mtok:1.25}},{id:"regional.anthropic.claude-3-opus-20240229-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-opus-20240229-v1"},{starts_with:"au.anthropic.claude-3-opus-20240229-v1"},{starts_with:"apac.anthropic.claude-3-opus-20240229-v1"},{starts_with:"eu.anthropic.claude-3-opus-20240229-v1"},{starts_with:"us-gov.anthropic.claude-3-opus-20240229-v1"},{starts_with:"jp.anthropic.claude-3-opus-20240229-v1"}]},prices:{input_mtok:15,output_mtok:75}},{id:"regional.anthropic.claude-3-sonnet-20240229-v1:0",match:{or:[{starts_with:"us.anthropic.claude-3-sonnet-20240229-v1"},{starts_with:"au.anthropic.claude-3-sonnet-20240229-v1"},{starts_with:"apac.anthropic.claude-3-sonnet-20240229-v1"},{starts_with:"eu.anthropic.claude-3-sonnet-20240229-v1"},{starts_with:"us-gov.anthropic.claude-3-sonnet-20240229-v1"},{starts_with:"jp.anthropic.claude-3-sonnet-20240229-v1"}]},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"regional.anthropic.claude-haiku-4-5-20251001-v1:0",match:{or:[{starts_with:"us.anthropic.claude-haiku-4-5-20251001-v1"},{starts_with:"au.anthropic.claude-haiku-4-5-20251001-v1"},{starts_with:"apac.anthropic.claude-haiku-4-5-20251001-v1"},{starts_with:"eu.anthropic.claude-haiku-4-5-20251001-v1"},{starts_with:"us-gov.anthropic.claude-haiku-4-5-20251001-v1"},{starts_with:"jp.anthropic.claude-haiku-4-5-20251001-v1"}]},prices:{input_mtok:1.1,cache_write_mtok:1.375,cache_read_mtok:.11,output_mtok:5.5}},{id:"regional.anthropic.claude-opus-4-1-20250805-v1:0",match:{or:[{starts_with:"us.anthropic.claude-opus-4-1-20250805-v1"},{starts_with:"au.anthropic.claude-opus-4-1-20250805-v1"},{starts_with:"apac.anthropic.claude-opus-4-1-20250805-v1"},{starts_with:"eu.anthropic.claude-opus-4-1-20250805-v1"},{starts_with:"us-gov.anthropic.claude-opus-4-1-20250805-v1"},{starts_with:"jp.anthropic.claude-opus-4-1-20250805-v1"}]},prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"regional.anthropic.claude-opus-4-20250514-v1:0",match:{or:[{starts_with:"us.anthropic.claude-opus-4-20250514-v1"},{starts_with:"au.anthropic.claude-opus-4-20250514-v1"},{starts_with:"apac.anthropic.claude-opus-4-20250514-v1"},{starts_with:"eu.anthropic.claude-opus-4-20250514-v1"},{starts_with:"us-gov.anthropic.claude-opus-4-20250514-v1"},{starts_with:"jp.anthropic.claude-opus-4-20250514-v1"}]},prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"regional.anthropic.claude-sonnet-4-20250514-v1:0",match:{or:[{starts_with:"us.anthropic.claude-sonnet-4-20250514-v1"},{starts_with:"au.anthropic.claude-sonnet-4-20250514-v1"},{starts_with:"apac.anthropic.claude-sonnet-4-20250514-v1"},{starts_with:"eu.anthropic.claude-sonnet-4-20250514-v1"},{starts_with:"us-gov.anthropic.claude-sonnet-4-20250514-v1"},{starts_with:"jp.anthropic.claude-sonnet-4-20250514-v1"}]},prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"regional.anthropic.claude-sonnet-4-5-20250929-v1:0",match:{or:[{starts_with:"us.anthropic.claude-sonnet-4-5-20250929-v1"},{starts_with:"au.anthropic.claude-sonnet-4-5-20250929-v1"},{starts_with:"apac.anthropic.claude-sonnet-4-5-20250929-v1"},{starts_with:"eu.anthropic.claude-sonnet-4-5-20250929-v1"},{starts_with:"us-gov.anthropic.claude-sonnet-4-5-20250929-v1"},{starts_with:"jp.anthropic.claude-sonnet-4-5-20250929-v1"}]},prices:{input_mtok:3.3,cache_write_mtok:4.125,cache_read_mtok:.33,output_mtok:16.5}}]},{id:"azure",name:"Microsoft Azure",pricing_urls:["https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/#pricing"],api_pattern:"(https?://)?([^.]*\\.)?(?:openai\\.azure\\.com|azure-api\\.net|cognitiveservices\\.azure\\.com)",price_comments:'These are prices for "*-Global" models, prices for "Regional" models are often slightly higher. Retired models are listed at https://learn.microsoft.com/th-th/azure/ai-foundry/openai/concepts/legacy-models',extractors:[{api_flavor:"chat",root:"usage",model_path:"model",mappings:[{path:"prompt_tokens",dest:"input_tokens",required:!0},{path:["prompt_tokens_details","cached_tokens"],dest:"cache_read_tokens",required:!1},{path:["prompt_tokens_details","audio_tokens"],dest:"input_audio_tokens",required:!1},{path:["completion_tokens_details","audio_tokens"],dest:"output_audio_tokens",required:!1},{path:"completion_tokens",dest:"output_tokens",required:!0}]},{api_flavor:"responses",root:"usage",model_path:"model",mappings:[{path:"input_tokens",dest:"input_tokens",required:!0},{path:["input_tokens_details","cached_tokens"],dest:"cache_read_tokens",required:!1},{path:"output_tokens",dest:"output_tokens",required:!0}]},{api_flavor:"embeddings",root:"usage",model_path:"model",mappings:[{path:"prompt_tokens",dest:"input_tokens",required:!0}]},{api_flavor:"anthropic",root:"usage",model_path:"model",mappings:[{path:"input_tokens",dest:"input_tokens",required:!0},{path:"cache_creation_input_tokens",dest:"input_tokens",required:!1},{path:"cache_read_input_tokens",dest:"input_tokens",required:!1},{path:"cache_creation_input_tokens",dest:"cache_write_tokens",required:!1},{path:"cache_read_input_tokens",dest:"cache_read_tokens",required:!1},{path:"output_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"ada",match:{or:[{equals:"ada"},{equals:"text-embedding-ada"},{equals:"text-embedding-ada-002"},{equals:"text-embedding-ada-002-v2"}]},prices:{input_mtok:.1}},{id:"babbage",match:{or:[{equals:"babbage"},{equals:"babbage-002"}]},prices:{input_mtok:.4}},{id:"curie",match:{or:[{equals:"curie"},{equals:"text-curie"},{equals:"text-curie-001"}]},prices:{input_mtok:2}},{id:"davinci",match:{or:[{equals:"davinci"},{equals:"davinci-002"},{equals:"text-davinci"},{equals:"text-davinci-002"}]},prices:{input_mtok:2}},{id:"gpt-3.5-turbo",match:{or:[{equals:"gpt-3.5-turbo"},{equals:"gpt-3.5-turbo-0301"},{equals:"gpt-3.5-turbo-0613"},{equals:"gpt-3.5-turbo-instruct"},{equals:"gpt-3.5-turbo-instruct-0914"}]},prices:{input_mtok:1.5,output_mtok:2}},{id:"gpt-3.5-turbo-0125",match:{equals:"gpt-3.5-turbo-0125"},prices:{input_mtok:.5,output_mtok:1.5}},{id:"gpt-3.5-turbo-1106",match:{equals:"gpt-3.5-turbo-1106"},prices:{input_mtok:1,output_mtok:2}},{id:"gpt-3.5-turbo-16k-0613",match:{equals:"gpt-3.5-turbo-16k-0613"},prices:{input_mtok:3,output_mtok:4}},{id:"gpt-35-16k",match:{equals:"gpt-35-16k"},prices:{input_mtok:3,output_mtok:4}},{id:"gpt-35-turbo",match:{or:[{equals:"gpt-35-turbo"},{equals:"gpt-35-turbo-0613"},{equals:"gpt-35-turbo-1106"}]},prices:{input_mtok:1.5,output_mtok:2}},{id:"gpt-35-turbo-16k",match:{or:[{equals:"gpt-35-turbo-16k"},{equals:"gpt-35-turbo-16k-0613"}]},prices:{input_mtok:3,output_mtok:4}},{id:"gpt-4",match:{or:[{equals:"gpt-4"},{equals:"gpt-4-0314"},{equals:"gpt-4-0613"}]},prices:{input_mtok:30,output_mtok:60}},{id:"gpt-4-0125-preview",match:{equals:"gpt-4-0125-preview"},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4-1106-preview",match:{equals:"gpt-4-1106-preview"},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4-1106-vision-preview",match:{equals:"gpt-4-1106-vision-preview"},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4-32k",match:{or:[{equals:"gpt-4-32k"},{equals:"gpt-4-32k-0314"},{equals:"gpt-4-32k-0613"}]},prices:{input_mtok:60,output_mtok:120}},{id:"gpt-4-preview-1106",match:{equals:"gpt-4-preview-1106"},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4-turbo",match:{or:[{equals:"gpt-4-turbo"},{equals:"gpt-4-turbo-0125-preview"},{equals:"gpt-4-turbo-2024-04-09"},{equals:"gpt-4-turbo-preview"}]},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4-vision",match:{or:[{equals:"gpt-4-vision"},{equals:"gpt-4-vision-preview"}]},prices:{input_mtok:10,output_mtok:30}},{id:"gpt-4.1",match:{or:[{equals:"gpt-4.1"},{equals:"gpt-4.1-2025-04-14"}]},prices:{input_mtok:2,cache_read_mtok:.5,output_mtok:8}},{id:"gpt-4.1-mini",match:{or:[{equals:"gpt-4.1-mini"},{equals:"gpt-4.1-mini-2025-04-14"}]},prices:{input_mtok:.4,cache_read_mtok:.1,output_mtok:1.6}},{id:"gpt-4.1-nano",match:{or:[{equals:"gpt-4.1-nano"},{equals:"gpt-4.1-nano-2025-04-14"}]},prices:{input_mtok:.1,cache_read_mtok:.03,output_mtok:.4}},{id:"gpt-4o-2024-0513",match:{or:[{equals:"gpt-4o-2024-05-13"},{equals:"gpt-4o-2024-0513"}]},prices:{input_mtok:5,output_mtok:15}},{id:"gpt-4o-2024-08-06",match:{equals:"gpt-4o-2024-08-06"},prices:{input_mtok:2.5,cache_read_mtok:1.25,output_mtok:10}},{id:"gpt-4o-2024-1120",match:{or:[{equals:"gpt-4o-2024-1120"},{equals:"gpt-4o-2024-11-20"}]},prices:{input_mtok:2.5,cache_read_mtok:1.25,output_mtok:10}},{id:"gpt-4o-mini",match:{or:[{equals:"gpt-4o-mini"},{equals:"gpt-4o-mini-0718"},{starts_with:"gpt-4o-mini-audio"}]},context_window:128e3,prices:{input_mtok:.15,cache_read_mtok:.075,output_mtok:.6,input_audio_mtok:10,output_audio_mtok:20}},{id:"gpt-4o-mini-realtime",match:{starts_with:"gpt-4o-mini-realtime"},prices:{input_mtok:.6,cache_read_mtok:.3,output_mtok:2.4,input_audio_mtok:10,cache_audio_read_mtok:.3,output_audio_mtok:20}},{id:"gpt-4o-realtime",match:{starts_with:"gpt-4o-realtime"},prices:{input_mtok:5,cache_read_mtok:2.5,output_mtok:20,input_audio_mtok:40,cache_audio_read_mtok:2.5,output_audio_mtok:80}},{id:"gpt-5",name:"GPT-5",description:"GPT-5 is OpenAI's flagship model for coding, reasoning, and agentic tasks across domains.",match:{or:[{equals:"gpt-5"},{equals:"gpt-5-2025-08-07"}]},context_window:4e5,prices:{input_mtok:1.25,cache_read_mtok:.125,output_mtok:10}},{id:"gpt-5-mini",name:"GPT-5 mini",description:"GPT-5 mini is a faster, more cost-efficient version of GPT-5. It's great for well-defined tasks and precise prompts.",match:{or:[{equals:"gpt-5-mini"},{equals:"gpt-5-mini-2025-08-07"}]},context_window:4e5,prices:{input_mtok:.25,cache_read_mtok:.025,output_mtok:2}},{id:"gpt-5-nano",name:"GPT-5 nano",description:"GPT-5 Nano is OpenAI's fastest, cheapest version of GPT-5. It's great for summarization and classification tasks.",match:{or:[{equals:"gpt-5-nano"},{equals:"gpt-5-nano-2025-04-14"}]},context_window:4e5,prices:{input_mtok:.05,cache_read_mtok:.005,output_mtok:.4}},{id:"gpt35",match:{equals:"gpt35"},prices:{input_mtok:1.5,output_mtok:2}},{id:"gpt4-turbo-preview",match:{equals:"gpt4-turbo-preview"},prices:{input_mtok:10,output_mtok:30}},{id:"mai-ds-r1:free",name:"MAI DS R1 (free)",description:"MAI-DS-R1 is a post-trained variant of DeepSeek-R1 developed by the Microsoft AI team to improve the model's responsiveness on previously blocked topics while enhancing its safety profile. Built on top of DeepSeek-R1's reasoning foundation, it integrates 110k examples from the Tulu-3 SFT dataset and 350k internally curated multilingual safety-alignment samples. The model retains strong reasoning, coding, and problem-solving capabilities, while unblocking a wide range of prompts previously restricted in R1.",match:{equals:"mai-ds-r1:free"},prices:{}},{id:"o1",match:{or:[{equals:"o1"},{equals:"o1-2024-12-17"},{equals:"o1-preview"},{equals:"o1-preview-2024-09-12"}]},prices:{input_mtok:15,cache_read_mtok:7.5,output_mtok:60}},{id:"o1-mini",match:{or:[{equals:"o1-mini"},{equals:"o1-mini-2024-09-12"}]},prices:{input_mtok:1.1,cache_read_mtok:.55,output_mtok:4.4}},{id:"o3-2025-04-16",match:{or:[{equals:"o3"},{equals:"o3-2025-04-16"}]},prices:{input_mtok:2,cache_read_mtok:.5,output_mtok:8}},{id:"o3-mini",match:{or:[{equals:"o3-mini"},{equals:"o3-mini-2025-01-31"}]},prices:{input_mtok:1.1,cache_read_mtok:.55,output_mtok:4.4}},{id:"o4-mini",match:{or:[{contains:"o4-mini"},{contains:"o4-mini-2025-04-16"}]},prices:{input_mtok:1.1,cache_read_mtok:.28,output_mtok:4.4}},{id:"phi-3-medium-128k-instruct",name:"Phi-3 Medium 128K Instruct",description:"Phi-3 128K Medium is a powerful 14-billion parameter model designed for advanced language understanding, reasoning, and instruction following. Optimized through supervised fine-tuning and preference adjustments, it excels in tasks involving common sense, mathematics, logical reasoning, and code processing.",match:{equals:"phi-3-medium-128k-instruct"},prices:{input_mtok:1,output_mtok:1}},{id:"phi-3-mini-128k-instruct",name:"Phi-3 Mini 128K Instruct",description:"Phi-3 Mini is a powerful 3.8B parameter model designed for advanced language understanding, reasoning, and instruction following. Optimized through supervised fine-tuning and preference adjustments, it excels in tasks involving common sense, mathematics, logical reasoning, and code processing.",match:{equals:"phi-3-mini-128k-instruct"},prices:{input_mtok:.1,output_mtok:.1}},{id:"phi-3.5-mini-128k-instruct",name:"Phi-3.5 Mini 128K Instruct",description:"Phi-3.5 models are lightweight, state-of-the-art open models. These models were trained with Phi-3 datasets that include both synthetic data and the filtered, publicly available websites data, with a focus on high quality and reasoning-dense properties. Phi-3.5 Mini uses 3.8B parameters, and is a dense decoder-only transformer model using the same tokenizer as Phi-3 Mini.",match:{equals:"phi-3.5-mini-128k-instruct"},prices:{input_mtok:.1,output_mtok:.1}},{id:"phi-4",name:"Phi 4",description:"Microsoft Research Phi-4 is designed to perform well in complex reasoning tasks and can operate efficiently in situations with limited memory or where quick responses are needed.",match:{equals:"phi-4"},prices:{input_mtok:.07,output_mtok:.14}},{id:"phi-4-multimodal-instruct",name:"Phi 4 Multimodal Instruct",description:"Phi-4 Multimodal Instruct is a versatile 5.6B parameter foundation model that combines advanced reasoning and instruction-following capabilities across both text and visual inputs, providing accurate text outputs. The unified architecture enables efficient, low-latency inference, suitable for edge and mobile deployments. Phi-4 Multimodal Instruct supports text inputs in multiple languages including Arabic, Chinese, English, French, German, Japanese, Spanish, and more, with visual input optimized primarily for English. It delivers impressive performance on multimodal tasks involving mathematical, scientific, and document reasoning, providing developers and enterprises a powerful yet compact model for sophisticated interactive applications. For more information, see the Phi-4 Multimodal blog post.",match:{equals:"phi-4-multimodal-instruct"},prices:{input_mtok:.05,output_mtok:.1}},{id:"phi-4-reasoning-plus",name:"Phi 4 Reasoning Plus",description:"Phi-4-reasoning-plus is an enhanced 14B parameter model from Microsoft, fine-tuned from Phi-4 with additional reinforcement learning to boost accuracy on math, science, and code reasoning tasks. It uses the same dense decoder-only transformer architecture as Phi-4, but generates longer, more comprehensive outputs structured into a step-by-step reasoning trace and final answer.",match:{equals:"phi-4-reasoning-plus"},prices:{input_mtok:.07,output_mtok:.35}},{id:"phi-4-reasoning-plus:free",name:"Phi 4 Reasoning Plus (free)",description:"Phi-4-reasoning-plus is an enhanced 14B parameter model from Microsoft, fine-tuned from Phi-4 with additional reinforcement learning to boost accuracy on math, science, and code reasoning tasks. It uses the same dense decoder-only transformer architecture as Phi-4, but generates longer, more comprehensive outputs structured into a step-by-step reasoning trace and final answer.",match:{equals:"phi-4-reasoning-plus:free"},prices:{}},{id:"phi-4-reasoning:free",name:"Phi 4 Reasoning (free)",description:"Phi-4-reasoning is a 14B parameter dense decoder-only transformer developed by Microsoft, fine-tuned from Phi-4 to enhance complex reasoning capabilities. It uses a combination of supervised fine-tuning on chain-of-thought traces and reinforcement learning, targeting math, science, and code reasoning tasks. With a 32k context window and high inference efficiency, it is optimized for structured responses in a two-part format: reasoning trace followed by a final solution.",match:{equals:"phi-4-reasoning:free"},prices:{}},{id:"text-embedding-3-large",match:{equals:"text-embedding-3-large"},prices:{input_mtok:.13}},{id:"text-embedding-3-small",match:{equals:"text-embedding-3-small"},prices:{input_mtok:.02}},{id:"wizardlm-2-8x22b",name:"WizardLM-2 8x22B",description:"WizardLM-2 8x22B is Microsoft AI's most advanced Wizard model. It demonstrates highly competitive performance compared to leading proprietary models, and it consistently outperforms all existing state-of-the-art opensource models.",match:{equals:"wizardlm-2-8x22b"},prices:{input_mtok:.48,output_mtok:.48}}]},{id:"cerebras",name:"Cerebras",pricing_urls:["https://www.cerebras.ai/pricing#pricing","https://inference-docs.cerebras.ai/models/openai-oss"],api_pattern:"https://api\\.cerebras\\.ai",model_match:{contains:"cerebras"},provider_match:{contains:"cerebras"},extractors:[{api_flavor:"chat",root:"usage",model_path:"model",mappings:[{path:"prompt_tokens",dest:"input_tokens",required:!0},{path:"completion_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"gpt-oss-120b",name:"GPT-OSS 120B",description:"OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with 120 billion parameters and 128 experts. Delivers frontier reasoning capabilities with record-breaking inference speeds on Cerebras hardware (~3,000 tokens/second).",match:{or:[{equals:"gpt-oss-120b"},{starts_with:"cerebras/gpt-oss-120b"},{starts_with:"cerebras:gpt-oss-120b"}]},context_window:131072,price_comments:"Developer tier pricing. Free tier: 65k context, Paid tier: 131k context.",prices:{input_mtok:.35,output_mtok:.75}},{id:"llama-3.3-70b",name:"Llama 3.3 70B",description:"Meta's enhanced 70B model delivering 405B-level accuracy. Optimized for chat, coding, instruction following, mathematics, and reasoning with high-speed inference on Cerebras hardware (~2,100 tokens/second).",match:{or:[{equals:"llama-3.3-70b"},{starts_with:"cerebras/llama-3.3-70b"},{starts_with:"cerebras:llama-3.3-70b"}]},context_window:128e3,price_comments:"Developer tier pricing. Free tier: 65k context, Paid tier: 128k context.",prices:{input_mtok:.85,output_mtok:1.2}},{id:"llama3.1-8b",name:"Llama 3.1 8B",description:"Meta's Llama 3.1 8B model for general-purpose tasks including chat, coding, and instruction following. Optimized for fast inference on Cerebras hardware (~2,200 tokens/second).",match:{or:[{equals:"llama3.1-8b"},{starts_with:"cerebras/llama3.1-8b"},{starts_with:"cerebras:llama3.1-8b"}]},context_window:32768,price_comments:"Developer tier pricing. Free tier: 8k context, Paid tier: 32k context.",prices:{input_mtok:.1,output_mtok:.1}},{id:"qwen-3-32b",name:"Qwen 3 32B",description:"Qwen's 32B parameter model with enhanced reasoning and coding capabilities. Supports both standard and reasoning modes for complex tasks, with fast inference speeds on Cerebras hardware (~2,600 tokens/second).",match:{or:[{equals:"qwen-3-32b"},{starts_with:"cerebras/qwen-3-32b"},{starts_with:"cerebras:qwen-3-32b"}]},context_window:131072,price_comments:"Developer tier pricing. Free tier: 65k context, Paid tier: 131k context.",prices:{input_mtok:.4,output_mtok:.8}}]},{id:"cohere",name:"Cohere",pricing_urls:["https://cohere.com/pricing"],api_pattern:"https://api\\.cohere\\.ai",model_match:{starts_with:"command-"},provider_match:{contains:"cohere"},extractors:[{api_flavor:"default",root:["usage","billed_units"],model_path:"model",mappings:[{path:"input_tokens",dest:"input_tokens",required:!0},{path:"output_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"command",name:"Command",description:"Command is an instruction-following conversational model that performs language tasks with high quality, more reliably and with a longer context than our base generative models.",match:{equals:"command"},prices:{input_mtok:1,output_mtok:2}},{id:"command-a",name:"Command A",description:`Command A is an open-weights 111B parameter model with a 256k context window focused on delivering great performance across agentic, multilingual, and coding use cases.
3
3
  Compared to other leading proprietary and open-weights models Command A delivers maximum performance with minimum hardware costs, excelling on business-critical agentic and multilingual tasks.`,match:{starts_with:"command-a"},prices:{input_mtok:2.5,output_mtok:10}},{id:"command-r",name:"Command R",description:"Command-R is a 35B parameter model that performs conversational language tasks at a higher quality, more reliably, and with a longer context than previous models. It can be used for complex workflows like code generation, retrieval augmented generation (RAG), tool use, and agents.",match:{or:[{equals:"command-r"},{equals:"command-r-08-2024"}]},prices:{input_mtok:.15,output_mtok:.6}},{id:"command-r-plus",name:"Command R+",description:"Command R+ is a new, 104B-parameter LLM from Cohere. It's useful for roleplay, general consumer usecases, and Retrieval Augmented Generation (RAG).",match:{or:[{equals:"command-r-plus"},{equals:"command-r-plus-08-2024"}]},prices:{input_mtok:2.5,output_mtok:10}},{id:"command-r7b",name:"Command R7B",description:"Command R7B (12-2024) is a small, fast update of the Command R+ model, delivered in December 2024. It excels at RAG, tool use, agents, and similar tasks requiring complex reasoning and multiple steps.",match:{or:[{equals:"command-r7b"},{equals:"command-r7b-12-2024"}]},prices:{input_mtok:.0375,output_mtok:.15}}]},{id:"deepseek",name:"Deepseek",pricing_urls:["https://api-docs.deepseek.com/quick_start/pricing"],api_pattern:"https://api\\.deepseek\\.com",price_comments:'Deepseek off-peak pricing applies "UTC 16:30-00:30" so we switch it around and use the off-peak pricing as the default (first) price then the second price with a constraint is the "standard" pricing that applies "UTC 00:30-16:30".',model_match:{contains:"deepseek"},extractors:[{api_flavor:"chat",root:"usage",model_path:"model",mappings:[{path:"prompt_tokens",dest:"input_tokens",required:!0},{path:["prompt_tokens_details","cached_tokens"],dest:"cache_read_tokens",required:!1},{path:["completion_tokens_details","audio_tokens"],dest:"output_audio_tokens",required:!1},{path:"completion_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"deepseek-chat",name:"DeepSeek Chat",description:"DeepSeek-V3 is the latest model from the DeepSeek team, building upon the instruction following and coding abilities of the previous versions. Pre-trained on nearly 15 trillion tokens, the reported evaluations reveal that the model outperforms other open-source models and rivals leading closed-source models.",match:{or:[{starts_with:"deepseek-chat"},{equals:"deepseek-chat-v3-0324"}]},context_window:64e3,prices:[{prices:{input_mtok:.135,cache_read_mtok:.035,output_mtok:.55}},{constraint:{start_time:"00:30:00Z",end_time:"16:30:00Z",type:"time_of_date"},prices:{input_mtok:.27,cache_read_mtok:.07,output_mtok:1.1}}]},{id:"deepseek-reasoner",name:"Deepseek R1",description:"DeepSeek R1 is here: Performance on par with OpenAI o1, but open-sourced and with fully open reasoning tokens. It's 671B parameters in size, with 37B active in an inference pass.",match:{or:[{equals:"deepseek-reasoner"},{starts_with:"deepseek-r1"},{equals:"deepseek-r1-0528"}]},context_window:64e3,prices:[{prices:{input_mtok:.135,cache_read_mtok:.035,output_mtok:.55}},{constraint:{start_time:"00:30:00Z",end_time:"16:30:00Z",type:"time_of_date"},prices:{input_mtok:.55,cache_read_mtok:.14,output_mtok:2.19}}]}]},{id:"fireworks",name:"Fireworks",pricing_urls:["https://fireworks.ai/pricing"],api_pattern:"https://api\\.fireworks\\.ai",model_match:{starts_with:"accounts/fireworks/models/"},extractors:[{api_flavor:"chat",root:"usage",model_path:"model",mappings:[{path:"prompt_tokens",dest:"input_tokens",required:!0},{path:["prompt_tokens_details","cached_tokens"],dest:"cache_read_tokens",required:!1},{path:["completion_tokens_details","audio_tokens"],dest:"output_audio_tokens",required:!1},{path:"completion_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"deepseek-r1-0528",name:"DeepSeek R1 0528",description:"The updated DeepSeek-R1-0528 model delivers major improvements in reasoning, inference, and accuracy through enhanced post-training optimization and greater computational resources. It now performs at a level approaching top-tier models like O3 and Gemini 2.5 Pro, with notable gains in complex tasks such as math and programming.",match:{equals:"accounts/fireworks/models/deepseek-r1-0528"},context_window:16e4,prices:{input_mtok:3,output_mtok:8}},{id:"deepseek-v3-0324",name:"Deepseek V3 03-24",description:"A strong Mixture-of-Experts (MoE) language model with 671B total parameters with 37B activated for each token from Deepseek. Updated checkpoint.",match:{equals:"accounts/fireworks/models/deepseek-v3-0324"},context_window:16e4,price_comments:`docs give just one price - "Pricing Per 1M Tokens", we assume that's input and output`,prices:{input_mtok:.9,output_mtok:.9}},{id:"gemma-3-27b-it",name:"Gemma 3 27B Instruct",match:{equals:"accounts/fireworks/models/gemma-3-27b-it"},context_window:131e3,price_comments:`docs give just one price - "Pricing Per 1M Tokens", we assume that's input and output`,prices:{input_mtok:.1,output_mtok:.1}},{id:"llama-v3p1-8b-instruct",name:"Llama 3.1 8B Instruct",description:"The Meta Llama 3.1 collection of multilingual large language models (LLMs) is a collection of pretrained and instruction tuned generative models in 8B, 70B and 405B sizes. The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",match:{equals:"accounts/fireworks/models/llama-v3p1-8b-instruct"},context_window:131e3,price_comments:`docs give just one price - "Pricing Per 1M Tokens", we assume that's input and output`,prices:{input_mtok:.2,output_mtok:.2}},{id:"llama4-maverick-instruct-basic",name:"Llama 4 Maverick Instruct (Basic)",description:"The Meta Llama 3.1 collection of multilingual large language models (LLMs) is a collection of pretrained and instruction tuned generative models in 8B, 70B and 405B sizes. The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",match:{equals:"accounts/fireworks/models/llama4-maverick-instruct-basic"},context_window:1e6,prices:{input_mtok:.22,output_mtok:.88}},{id:"qwen2p5-vl-72b-instruct",name:"Qwen2.5-VL 72B Instruct",description:"Latest Qwen's VLM model",match:{equals:"accounts/fireworks/models/qwen2p5-vl-72b-instruct"},context_window:128e3,price_comments:`docs give just one price - "Pricing Per 1M Tokens", we assume that's input and output`,prices:{input_mtok:.9,output_mtok:.9}},{id:"qwen3-235b-a22b",name:"Qwen3 235B-A22B",description:'Qwen3 is the latest evolution in the Qwen LLM series, featuring both dense and MoE models with major advancements in reasoning, agent capabilities, multilingual support, and instruction following. It uniquely allows seamless switching between "thinking" (for complex logic, math, coding) and "non-thinking" modes (for fast, general dialogue), delivering strong performance across tasks.',match:{equals:"accounts/fireworks/models/qwen3-235b-a22b"},context_window:128e3,prices:{input_mtok:.22,output_mtok:.88}}]},{id:"google",name:"Google",pricing_urls:["https://ai.google.dev/gemini-api/docs/pricing","https://cloud.google.com/vertex-ai/generative-ai/pricing"],api_pattern:"https://(.*\\.)?googleapis\\.com",model_match:{contains:"gemini"},provider_match:{or:[{contains:"google"},{contains:"vertex"},{contains:"gemini"}]},extractors:[{api_flavor:"default",root:"usageMetadata",model_path:"modelVersion",mappings:[{path:"promptTokenCount",dest:"input_tokens",required:!1},{path:"cachedContentTokenCount",dest:"cache_read_tokens",required:!1},{path:["cacheTokensDetails",{type:"array-match",field:"modality",match:{equals:"AUDIO"}},"tokenCount"],dest:"cache_audio_read_tokens",required:!1},{path:["promptTokensDetails",{type:"array-match",field:"modality",match:{equals:"AUDIO"}},"tokenCount"],dest:"input_audio_tokens",required:!1},{path:["candidatesTokensDetails",{type:"array-match",field:"modality",match:{equals:"AUDIO"}},"tokenCount"],dest:"output_audio_tokens",required:!1},{path:"candidatesTokenCount",dest:"output_tokens",required:!1},{path:"thoughtsTokenCount",dest:"output_tokens",required:!1},{path:"toolUsePromptTokenCount",dest:"output_tokens",required:!1}]},{api_flavor:"anthropic",root:"usage",model_path:"model",mappings:[{path:"input_tokens",dest:"input_tokens",required:!0},{path:"cache_creation_input_tokens",dest:"input_tokens",required:!1},{path:"cache_read_input_tokens",dest:"input_tokens",required:!1},{path:"cache_creation_input_tokens",dest:"cache_write_tokens",required:!1},{path:"cache_read_input_tokens",dest:"cache_read_tokens",required:!1},{path:"output_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"claude-3-5-haiku",match:{contains:"claude-3-5-haiku"},context_window:2e5,prices:{input_mtok:.8,cache_write_mtok:1,cache_read_mtok:.08,output_mtok:4}},{id:"claude-3-5-sonnet",match:{contains:"claude-3-5-sonnet"},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"claude-3-7-sonnet",match:{contains:"claude-3-7-sonnet"},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"claude-3-haiku",match:{contains:"claude-3-haiku"},context_window:2e5,prices:{input_mtok:.25,cache_write_mtok:.3,cache_read_mtok:.03,output_mtok:1.25}},{id:"claude-3-opus",match:{contains:"claude-3-opus"},prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"claude-4-opus",match:{or:[{contains:"claude-4-opus"},{contains:"claude-opus-4"}]},context_window:2e5,prices:{input_mtok:15,cache_write_mtok:18.75,cache_read_mtok:1.5,output_mtok:75}},{id:"claude-4-sonnet",match:{or:[{contains:"claude-4-sonnet"},{contains:"claude-sonnet-4"}]},context_window:2e5,prices:{input_mtok:3,cache_write_mtok:3.75,cache_read_mtok:.3,output_mtok:15}},{id:"gemini-1.0-pro-vision-001",name:"gemini 1.0 pro vision",description:"Google's first-generation advanced multimodal model that can understand text, code, and images. It provides strong reasoning capabilities and follows instructions effectively.",match:{equals:"gemini-1.0-pro-vision-001"},context_window:32768,price_comments:"I can't find anything about this model or it's pricing, so trusting the original source",prices:{input_mtok:.125,output_mtok:.375}},{id:"gemini-1.5-flash",name:"gemini 1.5 flash",description:"A faster, more cost-effective variant of Gemini 1.5 that maintains strong capabilities while optimizing for performance and cost efficiency. Suitable for production deployments requiring high throughput.",match:{contains:"gemini-1.5-flash"},context_window:1e6,prices:{input_mtok:{base:.075,tiers:[{start:128e3,price:.15}]},cache_read_mtok:{base:.01875,tiers:[{start:128e3,price:.0375}]},output_mtok:{base:.3,tiers:[{start:128e3,price:.6}]}}},{id:"gemini-1.5-pro",name:"gemini 1.5 Pro",description:"Google's most capable multimodal model with an extremely long context window of up to 1 million tokens. It excels at complex reasoning, long-form content processing, and multimodal understanding.",match:{contains:"gemini-1.5-pro"},context_window:1e6,prices:{input_mtok:{base:1.25,tiers:[{start:128e3,price:2.5}]},output_mtok:{base:5,tiers:[{start:128e3,price:10}]}}},{id:"gemini-2.0-flash",name:"gemini 2.0 flash",description:"The newest generation of Google's Gemini models, featuring improved reasoning, instruction following, and factual accuracy, with the Flash variant optimized for cost-efficiency and performance.",match:{or:[{contains:"gemini-2.0-flash"},{equals:"gemini-2.0-flash-lite-001"},{equals:"gemini-2.0-flash-001"},{equals:"gemini-2.0-flash-exp:free"}]},context_window:1e6,prices:{input_mtok:.1,cache_read_mtok:{base:.025,tiers:[{start:1e6,price:.175}]},output_mtok:.4,input_audio_mtok:.7}},{id:"gemini-2.0-flash-lite",name:"gemini 2.0 flash lite",description:"A lighter, more cost-effective version of Gemini 2.0 Flash, designed for applications requiring high efficiency while maintaining good performance. Ideal for high-volume, cost-sensitive deployments.",match:{contains:"gemini-2.0-flash-lite"},context_window:1e6,prices:{input_mtok:.075,output_mtok:.3}},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",description:`Gemini 2.5 Flash is Google's state-of-the-art workhorse model, specifically designed for advanced reasoning, coding, mathematics, and scientific tasks. It includes built-in "thinking" capabilities, enabling it to provide responses with greater accuracy and nuanced context handling.`,match:{or:[{equals:"gemini-2.5-flash"},{equals:"gemini-2.5-flash-latest"},{equals:"gemini-2.5-flash-preview-09-2025"}]},prices:{input_mtok:.3,cache_read_mtok:.03,output_mtok:2.5,input_audio_mtok:1,cache_audio_read_mtok:.1}},{id:"gemini-2.5-flash-image",name:"Gemini 2.5 Flash Image",description:"Google's specialized image generation model optimized for fast, high-quality image generation. Outputs images at 1024x1024 resolution, with each image consuming 1290 output tokens.",match:{or:[{equals:"gemini-2.5-flash-image"},{equals:"gemini-2.5-flash-image-preview"}]},context_window:1e6,price_comments:"See https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-flash-image. Image output is priced at $30 per 1M tokens, with each 1024x1024 image = 1290 tokens = $0.039/image. Cache pricing is not available for this model.",prices:{input_mtok:.3,output_mtok:30}},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite",description:'Gemini 2.5 Flash-Lite is a lightweight reasoning model in the Gemini 2.5 family, optimized for ultra-low latency and cost efficiency. It offers improved throughput, faster token generation, and better performance across common benchmarks compared to earlier Flash models. By default, "thinking" (i.e. multi-pass reasoning) is disabled to prioritize speed, but developers can enable it via the Reasoning API parameter to selectively trade off cost for intelligence.',match:{or:[{equals:"gemini-2.5-flash-lite"},{starts_with:"gemini-2.5-flash-lite-preview"}]},context_window:1e6,prices:{input_mtok:.1,cache_read_mtok:.01,output_mtok:.4,input_audio_mtok:.3,cache_audio_read_mtok:.03}},{id:"gemini-2.5-flash-preview",name:"Gemini 2.5 Flash Preview 05-20",description:`Gemini 2.5 Flash May 20th Checkpoint is Google's state-of-the-art workhorse model, specifically designed for advanced reasoning, coding, mathematics, and scientific tasks. It includes built-in "thinking" capabilities, enabling it to provide responses with greater accuracy and nuanced context handling.`,match:{or:[{contains:"gemini-2.5-flash-preview-05-20"},{contains:"gemini-2.5-flash-preview-04-17"},{equals:"gemini-2.5-flash-preview-05-20:thinking"},{equals:"gemini-2.5-flash-preview"},{equals:"gemini-2.5-flash-preview:thinking"}]},price_comments:"from https://cloud.google.com/vertex-ai/generative-ai/pricing should be retired 2025-07-15",prices:{input_mtok:.15,output_mtok:.6}},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:`Gemini 2.5 Pro is Google's state-of-the-art AI model designed for advanced reasoning, coding, mathematics, and scientific tasks. It employs "thinking" capabilities, enabling it to reason through responses with enhanced accuracy and nuanced context handling. Gemini 2.5 Pro achieves top-tier performance on multiple benchmarks, including first-place positioning on the LMArena leaderboard, reflecting superior human-preference alignment and complex problem-solving abilities.`,match:{starts_with:"gemini-2.5-pro"},price_comments:"See https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-pro",prices:{input_mtok:{base:1.25,tiers:[{start:2e5,price:2.5}]},cache_read_mtok:{base:.125,tiers:[{start:2e5,price:.25}]},output_mtok:{base:10,tiers:[{start:2e5,price:15}]}}},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview",description:"The best model in the world for multimodal understanding, and our most powerful agentic and vibe-coding model yet.",match:{starts_with:"gemini-3-pro-preview"},prices:{input_mtok:{base:2,tiers:[{start:2e5,price:4}]},cache_read_mtok:{base:.2,tiers:[{start:2e5,price:.4}]},output_mtok:{base:12,tiers:[{start:2e5,price:18}]}}},{id:"gemini-embedding-001",match:{equals:"gemini-embedding-001"},prices:{input_mtok:.15}},{id:"gemini-flash-1.5",name:"Gemini 1.5 Flash",description:"Gemini 1.5 Flash is a foundation model that performs well at a variety of multimodal tasks such as visual understanding, classification, summarization, and creating content from image, audio and video. It's adept at processing visual and text inputs such as photographs, documents, infographics, and screenshots.",match:{equals:"gemini-flash-1.5"},price_comments:"See https://ai.google.dev/gemini-api/docs/pricing#gemini-1.5-flash",prices:{input_mtok:{base:.075,tiers:[{start:128e3,price:.15}]},cache_read_mtok:{base:.01875,tiers:[{start:128e3,price:.0375}]},output_mtok:{base:.3,tiers:[{start:128e3,price:.6}]}}},{id:"gemini-flash-1.5-8b",name:"gemini 1.5 flash",description:"A faster, more cost-effective variant of Gemini 1.5 that maintains strong capabilities while optimizing for performance and cost efficiency. Suitable for production deployments requiring high throughput.",match:{equals:"gemini-flash-1.5-8b"},context_window:1e6,price_comments:"See https://ai.google.dev/gemini-api/docs/pricing#gemini-1.5-flash-8b",prices:{input_mtok:{base:.0375,tiers:[{start:128e3,price:.075}]},cache_read_mtok:{base:.01,tiers:[{start:128e3,price:.02}]},output_mtok:{base:.15,tiers:[{start:128e3,price:.3}]}}},{id:"gemini-live-2.5-flash-preview",match:{or:[{starts_with:"gemini-live-2.5-flash-preview"},{starts_with:"gemini-2.5-flash-native-audio-preview"}]},prices:{input_mtok:.5,output_mtok:2,input_audio_mtok:3,output_audio_mtok:12}},{id:"gemini-pro",name:"gemini 1.0 pro",description:"Google's first-generation advanced multimodal model that can understand text, code, and images. It provides strong reasoning capabilities and follows instructions effectively.",match:{or:[{equals:"gemini-pro"},{equals:"gemini-1.0-pro"}]},context_window:32768,price_comments:"I can't find anything so trusting these prices, not sure the model still exists",prices:{input_mtok:.125,output_mtok:.375}},{id:"gemini-pro-1.5",name:"Gemini 1.5 Pro",description:"Google's latest multimodal model, supports image and video[0] in text or chat prompts.",match:{equals:"gemini-pro-1.5"},context_window:2e6,price_comments:"See https://ai.google.dev/gemini-api/docs/pricing#gemini-1.5-pro",prices:{input_mtok:{base:1.25,tiers:[{start:128e3,price:2.5}]},cache_read_mtok:{base:.3125,tiers:[{start:128e3,price:.625}]},output_mtok:{base:5,tiers:[{start:128e3,price:10}]}}},{id:"gemma-3",name:"Gemma 3 (free)",description:"Lightweight, state-of the art, open model built from the same technology that powers our Gemini models.",match:{or:[{starts_with:"gemma-3-"},{equals:"gemma-3"}]},prices:{}},{id:"gemma-3n",name:"Gemma 3n (free)",description:"Our open model built for efficient performance on everyday devices like mobile phones, laptops, and tablets.",match:{or:[{starts_with:"gemma-3n"}]},prices:{}}]},{id:"groq",name:"Groq",pricing_urls:["https://groq.com/pricing/"],api_pattern:"https://api\\.groq\\.com",extractors:[{api_flavor:"default",root:"usage",model_path:"model",mappings:[{path:"prompt_tokens",dest:"input_tokens",required:!0},{path:"completion_tokens",dest:"output_tokens",required:!0}]}],models:[{id:"deepseek-r1-distill-llama-70b",name:"DeepSeek R1 Distill Llama 70B",match:{equals:"deepseek-r1-distill-llama-70b"},context_window:131072,prices:{input_mtok:.75,output_mtok:.99}},{id:"gemma-7b-it",match:{equals:"gemma-7b-it"},prices:{input_mtok:.07,output_mtok:.07}},{id:"gemma2-9b-it",name:"Gemma 2 9B 8k",match:{or:[{equals:"gemma2-9b-it"},{equals:"gemma2-9b"}]},prices:{input_mtok:.2,output_mtok:.2}},{id:"llama-3.1-405b-reasoning",match:{equals:"llama-3.1-405b-reasoning"},prices:{input_mtok:.59,output_mtok:.79}},{id:"llama-3.1-70b-versatile",match:{equals:"llama-3.1-70b-versatile"},prices:{input_mtok:.59,output_mtok:.79}},{id:"llama-3.1-8b-instant",name:"Llama 3.1 8B Instant 128k",match:{equals:"llama-3.1-8b-instant"},prices:{input_mtok:.05,output_mtok:.08}},{id:"llama-3.2-11b-text-preview",match:{equals:"llama-3.2-11b-text-preview"},prices:{input_mtok:.18,output_mtok:.18}},{id:"llama-3.2-11b-vision-preview",match:{equals:"llama-3.2-11b-vision-preview"},prices:{input_mtok:.18,output_mtok:.18}},{id:"llama-3.2-1b-preview",match:{equals:"llama-3.2-1b-preview"},prices:{input_mtok:.04,output_mtok:.04}},{id:"llama-3.2-3b-preview",match:{equals:"llama-3.2-3b-preview"},prices:{input_mtok:.06,output_mtok:.06}},{id:"llama-3.2-90b-text-preview",match:{equals:"llama-3.2-90b-text-preview"},prices:{input_mtok:.9,output_mtok:.9}},{id:"llama-3.2-90b-vision-preview",match:{equals:"llama-3.2-90b-vision-preview"},prices:{input_mtok:.9,output_mtok:.9}},{id:"llama-3.3-70b-specdec",match:{equals:"llama-3.3-70b-specdec"},prices:{input_mtok:.59,output_mtok:.99}},{id:"llama-3.3-70b-versatile",name:"Llama 3.3 70B Versatile 128k",match:{equals:"llama-3.3-70b-versatile"},prices:{input_mtok:.59,output_mtok:.79}},{id:"llama-guard-3-8b",match:{equals:"llama-guard-3-8b"},prices:{input_mtok:.2,output_mtok:.2}},{id:"llama2-70b-4096",match:{equals:"llama2-70b-4096"},prices:{input_mtok:.7,output_mtok:.8}},{id:"llama3-70b-8192",match:{equals:"llama3-70b-8192"},prices:{input_mtok:.59,output_mtok:.79}},{id:"llama3-8b-8192",match:{equals:"llama3-8b-8192"},prices:{input_mtok:.05,output_mtok:.08}},{id:"llama3-groq-70b-8192-tool-use-preview",match:{equals:"llama3-groq-70b-8192-tool-use-preview"},prices:{input_mtok:.89,output_mtok:.89}},{id:"llama3-groq-8b-8192-tool-use-preview",match:{equals:"llama3-groq-8b-8192-tool-use-preview"},prices:{input_mtok:.19,output_mtok:.19}},{id:"meta-llama/llama-4-maverick-17b-128e-instruct",name:"Llama 4 Maverick 17B 128E",match:{equals:"meta-llama/llama-4-maverick-17b-128e-instruct"},context_window:131072,prices:{input_mtok:.2,output_mtok:.6}},{id:"meta-llama/llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout (17Bx16E) 128k",match:{equals:"meta-llama/llama-4-scout-17b-16e-instruct"},prices:{input_mtok:.11,output_mtok:.34}},{id:"meta-llama/llama-guard-4-12b",name:"Llama Guard 4 12B",match:{equals:"meta-llama/llama-guard-4-12b"},context_window:131072,prices:{input_mtok:.2,output_mtok:.2}},{id:"mistral-saba-24b",match:{equals:"mistral-saba-24b"},prices:{input_mtok:.79,output_mtok:.79}},{id:"mixtral-8x7b-32768",match:{equals:"mixtral-8x7b-32768"},prices:{input_mtok:.24,output_mtok:.24}},{id:"moonshotai/kimi-k2-instruct",name:"Kimi K2 1T 128k",match:{or:[{equals:"moonshotai/kimi-k2-instruct"},{equals:"moonshotai/kimi-k2-instruct-0905"}]},context_window:131072,prices:{input_mtok:1,cache_read_mtok:.5,output_mtok:3}},{id:"openai/gpt-oss-120b",description:`GPT-OSS 120B is OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with
4
4
  120 billion parameters and 128 experts.
5
5
  `,match:{or:[{equals:"openai/gpt-oss-120b"},{equals:"openai/gpt-oss-safeguard-20b"}]},context_window:131072,prices:{input_mtok:.15,cache_read_mtok:.075,output_mtok:.6}},{id:"openai/gpt-oss-20b",description:`GPT-OSS 20B is OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with
package/dist/index.js CHANGED
@@ -1260,6 +1260,111 @@ const x = [
1260
1260
  pricing_urls: ["https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/#pricing"],
1261
1261
  api_pattern: "(https?://)?([^.]*\\.)?(?:openai\\.azure\\.com|azure-api\\.net|cognitiveservices\\.azure\\.com)",
1262
1262
  price_comments: 'These are prices for "*-Global" models, prices for "Regional" models are often slightly higher. Retired models are listed at https://learn.microsoft.com/th-th/azure/ai-foundry/openai/concepts/legacy-models',
1263
+ extractors: [
1264
+ {
1265
+ api_flavor: "chat",
1266
+ root: "usage",
1267
+ model_path: "model",
1268
+ mappings: [
1269
+ {
1270
+ path: "prompt_tokens",
1271
+ dest: "input_tokens",
1272
+ required: !0
1273
+ },
1274
+ {
1275
+ path: ["prompt_tokens_details", "cached_tokens"],
1276
+ dest: "cache_read_tokens",
1277
+ required: !1
1278
+ },
1279
+ {
1280
+ path: ["prompt_tokens_details", "audio_tokens"],
1281
+ dest: "input_audio_tokens",
1282
+ required: !1
1283
+ },
1284
+ {
1285
+ path: ["completion_tokens_details", "audio_tokens"],
1286
+ dest: "output_audio_tokens",
1287
+ required: !1
1288
+ },
1289
+ {
1290
+ path: "completion_tokens",
1291
+ dest: "output_tokens",
1292
+ required: !0
1293
+ }
1294
+ ]
1295
+ },
1296
+ {
1297
+ api_flavor: "responses",
1298
+ root: "usage",
1299
+ model_path: "model",
1300
+ mappings: [
1301
+ {
1302
+ path: "input_tokens",
1303
+ dest: "input_tokens",
1304
+ required: !0
1305
+ },
1306
+ {
1307
+ path: ["input_tokens_details", "cached_tokens"],
1308
+ dest: "cache_read_tokens",
1309
+ required: !1
1310
+ },
1311
+ {
1312
+ path: "output_tokens",
1313
+ dest: "output_tokens",
1314
+ required: !0
1315
+ }
1316
+ ]
1317
+ },
1318
+ {
1319
+ api_flavor: "embeddings",
1320
+ root: "usage",
1321
+ model_path: "model",
1322
+ mappings: [
1323
+ {
1324
+ path: "prompt_tokens",
1325
+ dest: "input_tokens",
1326
+ required: !0
1327
+ }
1328
+ ]
1329
+ },
1330
+ {
1331
+ api_flavor: "anthropic",
1332
+ root: "usage",
1333
+ model_path: "model",
1334
+ mappings: [
1335
+ {
1336
+ path: "input_tokens",
1337
+ dest: "input_tokens",
1338
+ required: !0
1339
+ },
1340
+ {
1341
+ path: "cache_creation_input_tokens",
1342
+ dest: "input_tokens",
1343
+ required: !1
1344
+ },
1345
+ {
1346
+ path: "cache_read_input_tokens",
1347
+ dest: "input_tokens",
1348
+ required: !1
1349
+ },
1350
+ {
1351
+ path: "cache_creation_input_tokens",
1352
+ dest: "cache_write_tokens",
1353
+ required: !1
1354
+ },
1355
+ {
1356
+ path: "cache_read_input_tokens",
1357
+ dest: "cache_read_tokens",
1358
+ required: !1
1359
+ },
1360
+ {
1361
+ path: "output_tokens",
1362
+ dest: "output_tokens",
1363
+ required: !0
1364
+ }
1365
+ ]
1366
+ }
1367
+ ],
1263
1368
  models: [
1264
1369
  {
1265
1370
  id: "ada",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pydantic/genai-prices",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "description": "Calculate prices for calling LLM inference APIs",
5
5
  "author": "Pydantic Team",
6
6
  "type": "module",