@pydantic/genai-prices 0.0.38 → 0.0.39

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/index.js CHANGED
@@ -463,13 +463,13 @@ const x = [
463
463
  ],
464
464
  models: [
465
465
  {
466
- id: "meta.llama3-8b-instruct-v1%3A0",
466
+ id: "meta.llama3-8b-instruct-v1:0",
467
467
  match: {
468
- equals: "meta.llama3-8b-instruct-v1%3A0"
468
+ contains: "llama3-8b-instruct-v1"
469
469
  },
470
470
  prices: {
471
- input_mtok: 220,
472
- output_mtok: 720
471
+ input_mtok: 0.3,
472
+ output_mtok: 0.6
473
473
  }
474
474
  },
475
475
  {
@@ -479,15 +479,13 @@ const x = [
479
479
  match: {
480
480
  or: [
481
481
  {
482
- equals: "nova-lite-v1"
483
- },
484
- {
485
- equals: "amazon.nova-lite-v1:0"
482
+ contains: "nova-lite-v1"
486
483
  }
487
484
  ]
488
485
  },
489
486
  prices: {
490
487
  input_mtok: 0.06,
488
+ cache_read_mtok: 0.015,
491
489
  output_mtok: 0.24
492
490
  }
493
491
  },
@@ -498,15 +496,13 @@ const x = [
498
496
  match: {
499
497
  or: [
500
498
  {
501
- equals: "nova-micro-v1"
502
- },
503
- {
504
- equals: "amazon.nova-micro-v1:0"
499
+ contains: "nova-micro-v1"
505
500
  }
506
501
  ]
507
502
  },
508
503
  prices: {
509
504
  input_mtok: 0.035,
505
+ cache_read_mtok: 875e-5,
510
506
  output_mtok: 0.14
511
507
  }
512
508
  },
@@ -517,15 +513,13 @@ const x = [
517
513
  match: {
518
514
  or: [
519
515
  {
520
- equals: "nova-pro-v1"
521
- },
522
- {
523
- equals: "amazon.nova-pro-v1:0"
516
+ contains: "nova-pro-v1"
524
517
  }
525
518
  ]
526
519
  },
527
520
  prices: {
528
521
  input_mtok: 0.8,
522
+ cache_read_mtok: 0.2,
529
523
  output_mtok: 3.2
530
524
  }
531
525
  }
@@ -1302,6 +1296,135 @@ const x = [
1302
1296
  }
1303
1297
  ]
1304
1298
  },
1299
+ {
1300
+ id: "cerebras",
1301
+ name: "Cerebras",
1302
+ pricing_urls: ["https://www.cerebras.ai/pricing#pricing", "https://inference-docs.cerebras.ai/models/openai-oss"],
1303
+ api_pattern: "https://api\\.cerebras\\.ai",
1304
+ model_match: {
1305
+ contains: "cerebras"
1306
+ },
1307
+ provider_match: {
1308
+ contains: "cerebras"
1309
+ },
1310
+ extractors: [
1311
+ {
1312
+ api_flavor: "chat",
1313
+ root: "usage",
1314
+ model_path: "model",
1315
+ mappings: [
1316
+ {
1317
+ path: "prompt_tokens",
1318
+ dest: "input_tokens",
1319
+ required: !0
1320
+ },
1321
+ {
1322
+ path: "completion_tokens",
1323
+ dest: "output_tokens",
1324
+ required: !0
1325
+ }
1326
+ ]
1327
+ }
1328
+ ],
1329
+ models: [
1330
+ {
1331
+ id: "gpt-oss-120b",
1332
+ name: "GPT-OSS 120B",
1333
+ 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).",
1334
+ match: {
1335
+ or: [
1336
+ {
1337
+ equals: "gpt-oss-120b"
1338
+ },
1339
+ {
1340
+ starts_with: "cerebras/gpt-oss-120b"
1341
+ },
1342
+ {
1343
+ starts_with: "cerebras:gpt-oss-120b"
1344
+ }
1345
+ ]
1346
+ },
1347
+ context_window: 131072,
1348
+ price_comments: "Developer tier pricing. Free tier: 65k context, Paid tier: 131k context.",
1349
+ prices: {
1350
+ input_mtok: 0.35,
1351
+ output_mtok: 0.75
1352
+ }
1353
+ },
1354
+ {
1355
+ id: "llama-3.3-70b",
1356
+ name: "Llama 3.3 70B",
1357
+ 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).",
1358
+ match: {
1359
+ or: [
1360
+ {
1361
+ equals: "llama-3.3-70b"
1362
+ },
1363
+ {
1364
+ starts_with: "cerebras/llama-3.3-70b"
1365
+ },
1366
+ {
1367
+ starts_with: "cerebras:llama-3.3-70b"
1368
+ }
1369
+ ]
1370
+ },
1371
+ context_window: 128e3,
1372
+ price_comments: "Developer tier pricing. Free tier: 65k context, Paid tier: 128k context.",
1373
+ prices: {
1374
+ input_mtok: 0.85,
1375
+ output_mtok: 1.2
1376
+ }
1377
+ },
1378
+ {
1379
+ id: "llama3.1-8b",
1380
+ name: "Llama 3.1 8B",
1381
+ 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).",
1382
+ match: {
1383
+ or: [
1384
+ {
1385
+ equals: "llama3.1-8b"
1386
+ },
1387
+ {
1388
+ starts_with: "cerebras/llama3.1-8b"
1389
+ },
1390
+ {
1391
+ starts_with: "cerebras:llama3.1-8b"
1392
+ }
1393
+ ]
1394
+ },
1395
+ context_window: 32768,
1396
+ price_comments: "Developer tier pricing. Free tier: 8k context, Paid tier: 32k context.",
1397
+ prices: {
1398
+ input_mtok: 0.1,
1399
+ output_mtok: 0.1
1400
+ }
1401
+ },
1402
+ {
1403
+ id: "qwen-3-32b",
1404
+ name: "Qwen 3 32B",
1405
+ 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).",
1406
+ match: {
1407
+ or: [
1408
+ {
1409
+ equals: "qwen-3-32b"
1410
+ },
1411
+ {
1412
+ starts_with: "cerebras/qwen-3-32b"
1413
+ },
1414
+ {
1415
+ starts_with: "cerebras:qwen-3-32b"
1416
+ }
1417
+ ]
1418
+ },
1419
+ context_window: 131072,
1420
+ price_comments: "Developer tier pricing. Free tier: 65k context, Paid tier: 131k context.",
1421
+ prices: {
1422
+ input_mtok: 0.4,
1423
+ output_mtok: 0.8
1424
+ }
1425
+ }
1426
+ ]
1427
+ },
1305
1428
  {
1306
1429
  id: "cohere",
1307
1430
  name: "Cohere",
@@ -2400,6 +2523,16 @@ Compared to other leading proprietary and open-weights models Command A delivers
2400
2523
  output_mtok: 0.99
2401
2524
  }
2402
2525
  },
2526
+ {
2527
+ id: "gemma-7b-it",
2528
+ match: {
2529
+ equals: "gemma-7b-it"
2530
+ },
2531
+ prices: {
2532
+ input_mtok: 0.07,
2533
+ output_mtok: 0.07
2534
+ }
2535
+ },
2403
2536
  {
2404
2537
  id: "gemma2-9b-it",
2405
2538
  name: "Gemma 2 9B 8k",
@@ -2418,6 +2551,26 @@ Compared to other leading proprietary and open-weights models Command A delivers
2418
2551
  output_mtok: 0.2
2419
2552
  }
2420
2553
  },
2554
+ {
2555
+ id: "llama-3.1-405b-reasoning",
2556
+ match: {
2557
+ equals: "llama-3.1-405b-reasoning"
2558
+ },
2559
+ prices: {
2560
+ input_mtok: 0.59,
2561
+ output_mtok: 0.79
2562
+ }
2563
+ },
2564
+ {
2565
+ id: "llama-3.1-70b-versatile",
2566
+ match: {
2567
+ equals: "llama-3.1-70b-versatile"
2568
+ },
2569
+ prices: {
2570
+ input_mtok: 0.59,
2571
+ output_mtok: 0.79
2572
+ }
2573
+ },
2421
2574
  {
2422
2575
  id: "llama-3.1-8b-instant",
2423
2576
  name: "Llama 3.1 8B Instant 128k",
@@ -2429,6 +2582,76 @@ Compared to other leading proprietary and open-weights models Command A delivers
2429
2582
  output_mtok: 0.08
2430
2583
  }
2431
2584
  },
2585
+ {
2586
+ id: "llama-3.2-11b-text-preview",
2587
+ match: {
2588
+ equals: "llama-3.2-11b-text-preview"
2589
+ },
2590
+ prices: {
2591
+ input_mtok: 0.18,
2592
+ output_mtok: 0.18
2593
+ }
2594
+ },
2595
+ {
2596
+ id: "llama-3.2-11b-vision-preview",
2597
+ match: {
2598
+ equals: "llama-3.2-11b-vision-preview"
2599
+ },
2600
+ prices: {
2601
+ input_mtok: 0.18,
2602
+ output_mtok: 0.18
2603
+ }
2604
+ },
2605
+ {
2606
+ id: "llama-3.2-1b-preview",
2607
+ match: {
2608
+ equals: "llama-3.2-1b-preview"
2609
+ },
2610
+ prices: {
2611
+ input_mtok: 0.04,
2612
+ output_mtok: 0.04
2613
+ }
2614
+ },
2615
+ {
2616
+ id: "llama-3.2-3b-preview",
2617
+ match: {
2618
+ equals: "llama-3.2-3b-preview"
2619
+ },
2620
+ prices: {
2621
+ input_mtok: 0.06,
2622
+ output_mtok: 0.06
2623
+ }
2624
+ },
2625
+ {
2626
+ id: "llama-3.2-90b-text-preview",
2627
+ match: {
2628
+ equals: "llama-3.2-90b-text-preview"
2629
+ },
2630
+ prices: {
2631
+ input_mtok: 0.9,
2632
+ output_mtok: 0.9
2633
+ }
2634
+ },
2635
+ {
2636
+ id: "llama-3.2-90b-vision-preview",
2637
+ match: {
2638
+ equals: "llama-3.2-90b-vision-preview"
2639
+ },
2640
+ prices: {
2641
+ input_mtok: 0.9,
2642
+ output_mtok: 0.9
2643
+ }
2644
+ },
2645
+ {
2646
+ id: "llama-3.3-70b-specdec",
2647
+ match: {
2648
+ equals: "llama-3.3-70b-specdec"
2649
+ },
2650
+ prices: {
2651
+ input_mtok: 0.59,
2652
+ output_mtok: 0.99
2653
+ }
2654
+ },
2432
2655
  {
2433
2656
  id: "llama-3.3-70b-versatile",
2434
2657
  name: "Llama 3.3 70B Versatile 128k",
@@ -2440,6 +2663,16 @@ Compared to other leading proprietary and open-weights models Command A delivers
2440
2663
  output_mtok: 0.79
2441
2664
  }
2442
2665
  },
2666
+ {
2667
+ id: "llama-guard-3-8b",
2668
+ match: {
2669
+ equals: "llama-guard-3-8b"
2670
+ },
2671
+ prices: {
2672
+ input_mtok: 0.2,
2673
+ output_mtok: 0.2
2674
+ }
2675
+ },
2443
2676
  {
2444
2677
  id: "llama2-70b-4096",
2445
2678
  match: {
@@ -2525,15 +2758,43 @@ Compared to other leading proprietary and open-weights models Command A delivers
2525
2758
  output_mtok: 0.2
2526
2759
  }
2527
2760
  },
2761
+ {
2762
+ id: "mistral-saba-24b",
2763
+ match: {
2764
+ equals: "mistral-saba-24b"
2765
+ },
2766
+ prices: {
2767
+ input_mtok: 0.79,
2768
+ output_mtok: 0.79
2769
+ }
2770
+ },
2771
+ {
2772
+ id: "mixtral-8x7b-32768",
2773
+ match: {
2774
+ equals: "mixtral-8x7b-32768"
2775
+ },
2776
+ prices: {
2777
+ input_mtok: 0.24,
2778
+ output_mtok: 0.24
2779
+ }
2780
+ },
2528
2781
  {
2529
2782
  id: "moonshotai/kimi-k2-instruct",
2530
2783
  name: "Kimi K2 1T 128k",
2531
2784
  match: {
2532
- equals: "moonshotai/kimi-k2-instruct"
2785
+ or: [
2786
+ {
2787
+ equals: "moonshotai/kimi-k2-instruct"
2788
+ },
2789
+ {
2790
+ equals: "moonshotai/kimi-k2-instruct-0905"
2791
+ }
2792
+ ]
2533
2793
  },
2534
2794
  context_window: 131072,
2535
2795
  prices: {
2536
2796
  input_mtok: 1,
2797
+ cache_read_mtok: 0.5,
2537
2798
  output_mtok: 3
2538
2799
  }
2539
2800
  },
@@ -2543,12 +2804,20 @@ Compared to other leading proprietary and open-weights models Command A delivers
2543
2804
  120 billion parameters and 128 experts.
2544
2805
  `,
2545
2806
  match: {
2546
- equals: "openai/gpt-oss-120b"
2807
+ or: [
2808
+ {
2809
+ equals: "openai/gpt-oss-120b"
2810
+ },
2811
+ {
2812
+ equals: "openai/gpt-oss-safeguard-20b"
2813
+ }
2814
+ ]
2547
2815
  },
2548
2816
  context_window: 131072,
2549
2817
  prices: {
2550
2818
  input_mtok: 0.15,
2551
- output_mtok: 0.75
2819
+ cache_read_mtok: 0.075,
2820
+ output_mtok: 0.6
2552
2821
  }
2553
2822
  },
2554
2823
  {
@@ -2561,8 +2830,9 @@ Compared to other leading proprietary and open-weights models Command A delivers
2561
2830
  },
2562
2831
  context_window: 131072,
2563
2832
  prices: {
2564
- input_mtok: 0.1,
2565
- output_mtok: 0.5
2833
+ input_mtok: 0.075,
2834
+ cache_read_mtok: 0.0375,
2835
+ output_mtok: 0.3
2566
2836
  }
2567
2837
  },
2568
2838
  {
@@ -3376,6 +3646,18 @@ Compared to other leading proprietary and open-weights models Command A delivers
3376
3646
  required: !0
3377
3647
  }
3378
3648
  ]
3649
+ },
3650
+ {
3651
+ api_flavor: "embeddings",
3652
+ root: "usage",
3653
+ model_path: "model",
3654
+ mappings: [
3655
+ {
3656
+ path: "prompt_tokens",
3657
+ dest: "input_tokens",
3658
+ required: !0
3659
+ }
3660
+ ]
3379
3661
  }
3380
3662
  ],
3381
3663
  models: [
@@ -4087,11 +4369,42 @@ Compared to other leading proprietary and open-weights models Command A delivers
4087
4369
  }
4088
4370
  ]
4089
4371
  },
4372
+ context_window: 4e5,
4090
4373
  prices: {
4091
4374
  input_mtok: 15,
4092
4375
  output_mtok: 120
4093
4376
  }
4094
4377
  },
4378
+ {
4379
+ id: "gpt-5.1",
4380
+ name: "GPT-5.1",
4381
+ description: "The best model for coding and agentic tasks across industries",
4382
+ match: {
4383
+ or: [
4384
+ {
4385
+ equals: "gpt-5.1"
4386
+ },
4387
+ {
4388
+ equals: "gpt-5.1-2025-11-13"
4389
+ },
4390
+ {
4391
+ equals: "gpt-5.1-codex"
4392
+ },
4393
+ {
4394
+ equals: "gpt-5.1-mini"
4395
+ },
4396
+ {
4397
+ equals: "gpt-5.1-chat-latest"
4398
+ }
4399
+ ]
4400
+ },
4401
+ context_window: 4e5,
4402
+ prices: {
4403
+ input_mtok: 1.25,
4404
+ cache_read_mtok: 0.125,
4405
+ output_mtok: 10
4406
+ }
4407
+ },
4095
4408
  {
4096
4409
  id: "gpt-realtime",
4097
4410
  match: {
@@ -11600,7 +11913,7 @@ function L(t, e) {
11600
11913
  const a = e.toLowerCase().trim(), i = t.find((o) => o.id === a);
11601
11914
  return i || t.find((o) => o.provider_match && h(o.provider_match, a));
11602
11915
  }
11603
- function y(t, { modelId: e, providerApiUrl: a, providerId: i }) {
11916
+ function B(t, { modelId: e, providerApiUrl: a, providerId: i }) {
11604
11917
  if (i)
11605
11918
  return L(t, i);
11606
11919
  if (a)
@@ -11618,22 +11931,22 @@ function S(t) {
11618
11931
  e !== null && (g = e);
11619
11932
  })) : (b = Promise.resolve(t), g = t));
11620
11933
  }
11621
- function A(t) {
11934
+ function R(t) {
11622
11935
  f = t;
11623
11936
  }
11624
- function N(t) {
11937
+ function Q(t) {
11625
11938
  t({
11626
- onCalc: A,
11939
+ onCalc: R,
11627
11940
  remoteDataUrl: G,
11628
11941
  setProviderData: S
11629
11942
  });
11630
11943
  }
11631
- function Q() {
11944
+ function N() {
11632
11945
  return b;
11633
11946
  }
11634
11947
  function O(t, e, a) {
11635
11948
  f?.();
11636
- const i = e.toLowerCase().trim(), o = a?.provider ?? y(g, { modelId: i, providerApiUrl: a?.providerApiUrl, providerId: a?.providerId });
11949
+ const i = e.toLowerCase().trim(), o = a?.provider ?? B(g, { modelId: i, providerApiUrl: a?.providerApiUrl, providerId: a?.providerId });
11637
11950
  if (!o) return null;
11638
11951
  const m = T(o.models, i);
11639
11952
  if (!m) return null;
@@ -11646,10 +11959,10 @@ function O(t, e, a) {
11646
11959
  ...n
11647
11960
  };
11648
11961
  }
11649
- function E(t) {
11650
- return f?.(), y(g, t);
11962
+ function D(t) {
11963
+ return f?.(), B(g, t);
11651
11964
  }
11652
- function D(t, e, a) {
11965
+ function E(t, e, a) {
11653
11966
  if (a = a ?? "default", !t.extractors)
11654
11967
  throw new Error("No extraction logic defined for this provider");
11655
11968
  const i = t.extractors.find((n) => n.api_flavor === a);
@@ -11659,7 +11972,7 @@ function D(t, e, a) {
11659
11972
  }
11660
11973
  if (!_.guard(e))
11661
11974
  throw new Error(`Expected response data to be a mapping object, got ${c(e)}`);
11662
- const o = q(i.model_path, e, C, !1, []), m = B(i.root), r = q(m, e, _, !0, []), s = {};
11975
+ const o = q(i.model_path, e, C, !1, []), m = y(i.root), r = q(m, e, _, !0, []), s = {};
11663
11976
  for (const n of i.mappings) {
11664
11977
  const u = q(n.path, r, z, n.required, m);
11665
11978
  if (u !== null) {
@@ -11672,7 +11985,7 @@ function D(t, e, a) {
11672
11985
  return { model: o, usage: s };
11673
11986
  }
11674
11987
  function q(t, e, a, i, o) {
11675
- const [m, ...r] = B(t).reverse();
11988
+ const [m, ...r] = y(t).reverse();
11676
11989
  if (typeof m != "string")
11677
11990
  throw new Error(`Expected last step of path to be a string, got ${c(m)}`);
11678
11991
  r.reverse();
@@ -11681,7 +11994,7 @@ function q(t, e, a, i, o) {
11681
11994
  for (const p of r) {
11682
11995
  if (n.push(p), typeof p == "object")
11683
11996
  if (Array.isArray(s))
11684
- s = R(p, s);
11997
+ s = A(p, s);
11685
11998
  else {
11686
11999
  if (i)
11687
12000
  throw new Error(`Expected \`${d(o, n)}\` value to be a mapping, got ${c(s)}`);
@@ -11718,7 +12031,7 @@ function q(t, e, a, i, o) {
11718
12031
  throw n.push(m), new Error(`Expected \`${d(o, n)}\` value to be a ${a.name}, got ${c(u)}`);
11719
12032
  return null;
11720
12033
  }
11721
- function R(t, e) {
12034
+ function A(t, e) {
11722
12035
  for (const a of e)
11723
12036
  if (_.guard(a)) {
11724
12037
  const i = a[t.field];
@@ -11726,7 +12039,7 @@ function R(t, e) {
11726
12039
  return a;
11727
12040
  }
11728
12041
  }
11729
- function B(t) {
12042
+ function y(t) {
11730
12043
  return Array.isArray(t) ? [...t] : [t];
11731
12044
  }
11732
12045
  function c(t) {
@@ -11745,8 +12058,8 @@ const _ = {
11745
12058
  export {
11746
12059
  G as REMOTE_DATA_JSON_URL,
11747
12060
  O as calcPrice,
11748
- D as extractUsage,
11749
- E as findProvider,
11750
- N as updatePrices,
11751
- Q as waitForUpdate
12061
+ E as extractUsage,
12062
+ D as findProvider,
12063
+ Q as updatePrices,
12064
+ N as waitForUpdate
11752
12065
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pydantic/genai-prices",
3
- "version": "0.0.38",
3
+ "version": "0.0.39",
4
4
  "description": "Calculate prices for calling LLM inference APIs",
5
5
  "author": "Pydantic Team",
6
6
  "type": "module",