@pydantic/genai-prices 0.0.41 → 0.0.42
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 +522 -209
- package/dist/index.cjs +2 -2
- package/dist/index.js +348 -35
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -459,29 +459,52 @@ const x = [
|
|
|
459
459
|
required: !0
|
|
460
460
|
}
|
|
461
461
|
]
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
api_flavor: "anthropic",
|
|
465
|
+
root: "usage",
|
|
466
|
+
model_path: "model",
|
|
467
|
+
mappings: [
|
|
468
|
+
{
|
|
469
|
+
path: "input_tokens",
|
|
470
|
+
dest: "input_tokens",
|
|
471
|
+
required: !0
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
path: "cache_creation_input_tokens",
|
|
475
|
+
dest: "input_tokens",
|
|
476
|
+
required: !1
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
path: "cache_read_input_tokens",
|
|
480
|
+
dest: "input_tokens",
|
|
481
|
+
required: !1
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
path: "cache_creation_input_tokens",
|
|
485
|
+
dest: "cache_write_tokens",
|
|
486
|
+
required: !1
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
path: "cache_read_input_tokens",
|
|
490
|
+
dest: "cache_read_tokens",
|
|
491
|
+
required: !1
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
path: "output_tokens",
|
|
495
|
+
dest: "output_tokens",
|
|
496
|
+
required: !0
|
|
497
|
+
}
|
|
498
|
+
]
|
|
462
499
|
}
|
|
463
500
|
],
|
|
464
501
|
models: [
|
|
465
502
|
{
|
|
466
|
-
id: "
|
|
467
|
-
|
|
468
|
-
contains: "llama3-8b-instruct-v1"
|
|
469
|
-
},
|
|
470
|
-
prices: {
|
|
471
|
-
input_mtok: 0.3,
|
|
472
|
-
output_mtok: 0.6
|
|
473
|
-
}
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
id: "nova-lite-v1",
|
|
477
|
-
name: "Nova Lite 1.0",
|
|
503
|
+
id: "amazon.nova-lite-v1:0",
|
|
504
|
+
name: "Nova Lite",
|
|
478
505
|
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.",
|
|
479
506
|
match: {
|
|
480
|
-
|
|
481
|
-
{
|
|
482
|
-
contains: "nova-lite-v1"
|
|
483
|
-
}
|
|
484
|
-
]
|
|
507
|
+
contains: "nova-lite"
|
|
485
508
|
},
|
|
486
509
|
prices: {
|
|
487
510
|
input_mtok: 0.06,
|
|
@@ -490,15 +513,11 @@ const x = [
|
|
|
490
513
|
}
|
|
491
514
|
},
|
|
492
515
|
{
|
|
493
|
-
id: "nova-micro-v1",
|
|
494
|
-
name: "Nova Micro
|
|
516
|
+
id: "amazon.nova-micro-v1:0",
|
|
517
|
+
name: "Nova Micro",
|
|
495
518
|
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.",
|
|
496
519
|
match: {
|
|
497
|
-
|
|
498
|
-
{
|
|
499
|
-
contains: "nova-micro-v1"
|
|
500
|
-
}
|
|
501
|
-
]
|
|
520
|
+
contains: "nova-micro"
|
|
502
521
|
},
|
|
503
522
|
prices: {
|
|
504
523
|
input_mtok: 0.035,
|
|
@@ -507,21 +526,315 @@ const x = [
|
|
|
507
526
|
}
|
|
508
527
|
},
|
|
509
528
|
{
|
|
510
|
-
id: "nova-
|
|
511
|
-
name: "Nova
|
|
529
|
+
id: "amazon.nova-premier-v1:0",
|
|
530
|
+
name: "Nova Premier",
|
|
531
|
+
match: {
|
|
532
|
+
contains: "nova-premier"
|
|
533
|
+
},
|
|
534
|
+
prices: {
|
|
535
|
+
input_mtok: 2.5,
|
|
536
|
+
cache_read_mtok: 0.625,
|
|
537
|
+
output_mtok: 12.5
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
id: "amazon.nova-pro-v1:0",
|
|
542
|
+
name: "Nova Pro",
|
|
512
543
|
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).",
|
|
513
544
|
match: {
|
|
514
|
-
|
|
515
|
-
{
|
|
516
|
-
contains: "nova-pro-v1"
|
|
517
|
-
}
|
|
518
|
-
]
|
|
545
|
+
contains: "nova-pro"
|
|
519
546
|
},
|
|
520
547
|
prices: {
|
|
521
548
|
input_mtok: 0.8,
|
|
522
549
|
cache_read_mtok: 0.2,
|
|
523
550
|
output_mtok: 3.2
|
|
524
551
|
}
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
id: "amazon.nova-sonic-v1:0",
|
|
555
|
+
name: "Nova Sonic",
|
|
556
|
+
match: {
|
|
557
|
+
contains: "nova-sonic"
|
|
558
|
+
},
|
|
559
|
+
prices: {
|
|
560
|
+
input_mtok: 0.06,
|
|
561
|
+
output_mtok: 0.24,
|
|
562
|
+
input_audio_mtok: 3.4,
|
|
563
|
+
output_audio_mtok: 13.6
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
id: "amazon.titan-embed-text-v1",
|
|
568
|
+
name: "Titan Embeddings G1 - Text",
|
|
569
|
+
match: {
|
|
570
|
+
contains: "titan-embed-text"
|
|
571
|
+
},
|
|
572
|
+
prices: {
|
|
573
|
+
input_mtok: 0.1
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
id: "amazon.titan-text-express-v1",
|
|
578
|
+
name: "Titan Text G1 - Express",
|
|
579
|
+
match: {
|
|
580
|
+
contains: "titan-text-express"
|
|
581
|
+
},
|
|
582
|
+
prices: {
|
|
583
|
+
input_mtok: 0.2,
|
|
584
|
+
output_mtok: 0.6
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
id: "amazon.titan-text-lite-v1",
|
|
589
|
+
name: "Titan Text G1 - Lite",
|
|
590
|
+
match: {
|
|
591
|
+
contains: "titan-text-lite"
|
|
592
|
+
},
|
|
593
|
+
prices: {
|
|
594
|
+
input_mtok: 0.15,
|
|
595
|
+
output_mtok: 0.2
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
id: "anthropic.claude-3-haiku-20240307-v1:0",
|
|
600
|
+
name: "Claude 3 Haiku",
|
|
601
|
+
match: {
|
|
602
|
+
contains: "claude-3-haiku-20240307"
|
|
603
|
+
},
|
|
604
|
+
prices: {
|
|
605
|
+
input_mtok: 0.25
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
id: "deepseek.r1-v1:0",
|
|
610
|
+
name: "DeepSeek-R1",
|
|
611
|
+
match: {
|
|
612
|
+
contains: "r1"
|
|
613
|
+
},
|
|
614
|
+
prices: {
|
|
615
|
+
input_mtok: 1.35,
|
|
616
|
+
output_mtok: 5.4
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
id: "meta.llama3-1-70b-instruct-v1:0",
|
|
621
|
+
name: "Llama 3.1 70B Instruct",
|
|
622
|
+
match: {
|
|
623
|
+
contains: "llama3-1-70b-instruct"
|
|
624
|
+
},
|
|
625
|
+
prices: {
|
|
626
|
+
input_mtok: 0.72,
|
|
627
|
+
output_mtok: 0.72
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
id: "meta.llama3-1-8b-instruct-v1:0",
|
|
632
|
+
name: "Llama 3.1 8B Instruct",
|
|
633
|
+
match: {
|
|
634
|
+
contains: "llama3-1-8b-instruct"
|
|
635
|
+
},
|
|
636
|
+
prices: {
|
|
637
|
+
input_mtok: 0.22,
|
|
638
|
+
output_mtok: 0.22
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
id: "meta.llama3-2-11b-instruct-v1:0",
|
|
643
|
+
name: "Llama 3.2 11B Instruct",
|
|
644
|
+
match: {
|
|
645
|
+
contains: "llama3-2-11b-instruct"
|
|
646
|
+
},
|
|
647
|
+
prices: {
|
|
648
|
+
input_mtok: 0.16,
|
|
649
|
+
output_mtok: 0.16
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
id: "meta.llama3-2-1b-instruct-v1:0",
|
|
654
|
+
name: "Llama 3.2 1B Instruct",
|
|
655
|
+
match: {
|
|
656
|
+
contains: "llama3-2-1b-instruct"
|
|
657
|
+
},
|
|
658
|
+
prices: {
|
|
659
|
+
input_mtok: 0.1,
|
|
660
|
+
output_mtok: 0.1
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
id: "meta.llama3-2-3b-instruct-v1:0",
|
|
665
|
+
name: "Llama 3.2 3B Instruct",
|
|
666
|
+
match: {
|
|
667
|
+
contains: "llama3-2-3b-instruct"
|
|
668
|
+
},
|
|
669
|
+
prices: {
|
|
670
|
+
input_mtok: 0.15,
|
|
671
|
+
output_mtok: 0.15
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
id: "meta.llama3-2-90b-instruct-v1:0",
|
|
676
|
+
name: "Llama 3.2 90B Instruct",
|
|
677
|
+
match: {
|
|
678
|
+
contains: "llama3-2-90b-instruct"
|
|
679
|
+
},
|
|
680
|
+
prices: {
|
|
681
|
+
input_mtok: 0.72,
|
|
682
|
+
output_mtok: 0.72
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
id: "meta.llama3-3-70b-instruct-v1:0",
|
|
687
|
+
name: "Llama 3.3 70B Instruct",
|
|
688
|
+
match: {
|
|
689
|
+
contains: "llama3-3-70b-instruct"
|
|
690
|
+
},
|
|
691
|
+
prices: {
|
|
692
|
+
input_mtok: 0.72,
|
|
693
|
+
output_mtok: 0.72
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
id: "meta.llama3-70b-instruct-v1:0",
|
|
698
|
+
name: "Llama 3 70B Instruct",
|
|
699
|
+
match: {
|
|
700
|
+
contains: "llama3-70b-instruct"
|
|
701
|
+
},
|
|
702
|
+
prices: {
|
|
703
|
+
input_mtok: 2.65,
|
|
704
|
+
output_mtok: 3.5
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
id: "meta.llama3-8b-instruct-v1:0",
|
|
709
|
+
name: "Llama 3 8B Instruct",
|
|
710
|
+
match: {
|
|
711
|
+
contains: "llama3-8b-instruct"
|
|
712
|
+
},
|
|
713
|
+
prices: {
|
|
714
|
+
input_mtok: 0.3,
|
|
715
|
+
output_mtok: 0.6
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
id: "meta.llama4-maverick-17b-instruct-v1:0",
|
|
720
|
+
name: "Llama 4 Maverick 17B Instruct",
|
|
721
|
+
match: {
|
|
722
|
+
contains: "llama4-maverick-17b-instruct"
|
|
723
|
+
},
|
|
724
|
+
prices: {
|
|
725
|
+
input_mtok: 0.24,
|
|
726
|
+
output_mtok: 0.97
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
id: "meta.llama4-scout-17b-instruct-v1:0",
|
|
731
|
+
name: "Llama 4 Scout 17B Instruct",
|
|
732
|
+
match: {
|
|
733
|
+
contains: "llama4-scout-17b-instruct"
|
|
734
|
+
},
|
|
735
|
+
prices: {
|
|
736
|
+
input_mtok: 0.17,
|
|
737
|
+
output_mtok: 0.66
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
id: "mistral.mistral-7b-instruct-v0:2",
|
|
742
|
+
name: "Mistral 7B Instruct",
|
|
743
|
+
match: {
|
|
744
|
+
contains: "mistral-7b-instruct"
|
|
745
|
+
},
|
|
746
|
+
prices: {
|
|
747
|
+
input_mtok: 0.15,
|
|
748
|
+
output_mtok: 0.2
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
id: "mistral.mistral-large-2402-v1:0",
|
|
753
|
+
name: "Mistral Large (24.02)",
|
|
754
|
+
match: {
|
|
755
|
+
contains: "mistral-large-2402"
|
|
756
|
+
},
|
|
757
|
+
prices: {
|
|
758
|
+
input_mtok: 4,
|
|
759
|
+
output_mtok: 12
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
id: "mistral.mistral-small-2402-v1:0",
|
|
764
|
+
name: "Mistral Small (24.02)",
|
|
765
|
+
match: {
|
|
766
|
+
contains: "mistral-small-2402"
|
|
767
|
+
},
|
|
768
|
+
prices: {
|
|
769
|
+
input_mtok: 1,
|
|
770
|
+
output_mtok: 3
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
id: "mistral.mixtral-8x7b-instruct-v0:1",
|
|
775
|
+
name: "Mixtral 8x7B Instruct",
|
|
776
|
+
match: {
|
|
777
|
+
contains: "mixtral-8x7b-instruct"
|
|
778
|
+
},
|
|
779
|
+
prices: {
|
|
780
|
+
input_mtok: 0.45,
|
|
781
|
+
output_mtok: 0.7
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
id: "mistral.pixtral-large-2502-v1:0",
|
|
786
|
+
name: "Pixtral Large (25.02)",
|
|
787
|
+
match: {
|
|
788
|
+
contains: "pixtral-large-2502"
|
|
789
|
+
},
|
|
790
|
+
prices: {
|
|
791
|
+
input_mtok: 2,
|
|
792
|
+
output_mtok: 6
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
id: "openai.gpt-oss-120b-1:0",
|
|
797
|
+
name: "gpt-oss-120b",
|
|
798
|
+
match: {
|
|
799
|
+
contains: "gpt-oss-120b"
|
|
800
|
+
},
|
|
801
|
+
prices: {
|
|
802
|
+
input_mtok: 0.15,
|
|
803
|
+
output_mtok: 0.6
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
id: "openai.gpt-oss-20b-1:0",
|
|
808
|
+
name: "gpt-oss-20b",
|
|
809
|
+
match: {
|
|
810
|
+
contains: "gpt-oss-20b"
|
|
811
|
+
},
|
|
812
|
+
prices: {
|
|
813
|
+
input_mtok: 0.07,
|
|
814
|
+
output_mtok: 0.3
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
id: "qwen.qwen3-32b-v1:0",
|
|
819
|
+
name: "Qwen3 32B (dense)",
|
|
820
|
+
match: {
|
|
821
|
+
contains: "qwen3-32b"
|
|
822
|
+
},
|
|
823
|
+
prices: {
|
|
824
|
+
input_mtok: 0.15,
|
|
825
|
+
output_mtok: 0.6
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
id: "qwen.qwen3-coder-30b-a3b-v1:0",
|
|
830
|
+
name: "Qwen3-Coder-30B-A3B-Instruct",
|
|
831
|
+
match: {
|
|
832
|
+
contains: "qwen3-coder-30b-a3b"
|
|
833
|
+
},
|
|
834
|
+
prices: {
|
|
835
|
+
input_mtok: 0.15,
|
|
836
|
+
output_mtok: 0.6
|
|
837
|
+
}
|
|
525
838
|
}
|
|
526
839
|
]
|
|
527
840
|
},
|
|
@@ -11960,7 +12273,7 @@ function I(t, e) {
|
|
|
11960
12273
|
total_price: w
|
|
11961
12274
|
};
|
|
11962
12275
|
}
|
|
11963
|
-
function
|
|
12276
|
+
function L(t, e) {
|
|
11964
12277
|
if (!Array.isArray(t.prices))
|
|
11965
12278
|
return t.prices;
|
|
11966
12279
|
for (let a = t.prices.length - 1; a >= 0; a--) {
|
|
@@ -11984,13 +12297,13 @@ function P(t, e) {
|
|
|
11984
12297
|
function h(t, e) {
|
|
11985
12298
|
return "or" in t ? t.or.some((a) => h(a, e)) : "and" in t ? t.and.every((a) => h(a, e)) : "equals" in t ? e === t.equals : "starts_with" in t ? e.startsWith(t.starts_with) : "ends_with" in t ? e.endsWith(t.ends_with) : "contains" in t ? e.includes(t.contains) : "regex" in t ? new RegExp(t.regex).test(e) : !1;
|
|
11986
12299
|
}
|
|
11987
|
-
function
|
|
12300
|
+
function P(t, e) {
|
|
11988
12301
|
const a = e.toLowerCase().trim(), i = t.find((o) => o.id === a);
|
|
11989
12302
|
return i || t.find((o) => o.provider_match && h(o.provider_match, a));
|
|
11990
12303
|
}
|
|
11991
12304
|
function B(t, { modelId: e, providerApiUrl: a, providerId: i }) {
|
|
11992
12305
|
if (i)
|
|
11993
|
-
return
|
|
12306
|
+
return P(t, i);
|
|
11994
12307
|
if (a)
|
|
11995
12308
|
return t.find((o) => new RegExp(o.api_pattern).test(a));
|
|
11996
12309
|
if (e)
|
|
@@ -12025,7 +12338,7 @@ function O(t, e, a) {
|
|
|
12025
12338
|
if (!o) return null;
|
|
12026
12339
|
const m = T(o.models, i);
|
|
12027
12340
|
if (!m) return null;
|
|
12028
|
-
const r = a?.timestamp ?? /* @__PURE__ */ new Date(), s =
|
|
12341
|
+
const r = a?.timestamp ?? /* @__PURE__ */ new Date(), s = L(m, r), n = I(t, s);
|
|
12029
12342
|
return {
|
|
12030
12343
|
auto_update_timestamp: void 0,
|
|
12031
12344
|
model: m,
|