@pydantic/genai-prices 0.0.64 → 0.0.66
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 +689 -97
- package/dist/index.cjs +4 -4
- package/dist/index.js +640 -48
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -210,6 +210,22 @@ const Q = [
|
|
|
210
210
|
output_mtok: 15
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
|
+
{
|
|
214
|
+
id: "claude-fable-5",
|
|
215
|
+
name: "Claude Fable 5",
|
|
216
|
+
description: "Anthropic's most capable widely released model for demanding reasoning and long-horizon agentic work",
|
|
217
|
+
match: {
|
|
218
|
+
starts_with: "claude-fable-5"
|
|
219
|
+
},
|
|
220
|
+
context_window: 1e6,
|
|
221
|
+
price_comments: "Flat pricing across full 1M context window (no tiered pricing). Ref: https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing",
|
|
222
|
+
prices: {
|
|
223
|
+
input_mtok: 10,
|
|
224
|
+
cache_write_mtok: 12.5,
|
|
225
|
+
cache_read_mtok: 1,
|
|
226
|
+
output_mtok: 50
|
|
227
|
+
}
|
|
228
|
+
},
|
|
213
229
|
{
|
|
214
230
|
id: "claude-haiku-4-5",
|
|
215
231
|
name: "Claude Haiku 4.5",
|
|
@@ -845,6 +861,18 @@ const Q = [
|
|
|
845
861
|
output_mtok: 5.4
|
|
846
862
|
}
|
|
847
863
|
},
|
|
864
|
+
{
|
|
865
|
+
id: "global.anthropic.claude-fable-5-v1:0",
|
|
866
|
+
match: {
|
|
867
|
+
contains: "global.anthropic.claude-fable-5"
|
|
868
|
+
},
|
|
869
|
+
prices: {
|
|
870
|
+
input_mtok: 10,
|
|
871
|
+
cache_write_mtok: 12.5,
|
|
872
|
+
cache_read_mtok: 1,
|
|
873
|
+
output_mtok: 50
|
|
874
|
+
}
|
|
875
|
+
},
|
|
848
876
|
{
|
|
849
877
|
id: "global.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
850
878
|
match: {
|
|
@@ -1481,6 +1509,37 @@ const Q = [
|
|
|
1481
1509
|
output_mtok: 15
|
|
1482
1510
|
}
|
|
1483
1511
|
},
|
|
1512
|
+
{
|
|
1513
|
+
id: "regional.anthropic.claude-fable-5-v1:0",
|
|
1514
|
+
match: {
|
|
1515
|
+
or: [
|
|
1516
|
+
{
|
|
1517
|
+
starts_with: "anthropic.claude-fable-5"
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
starts_with: "claude-fable-5"
|
|
1521
|
+
},
|
|
1522
|
+
{
|
|
1523
|
+
contains: "us.anthropic.claude-fable-5"
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
contains: "au.anthropic.claude-fable-5"
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
contains: "eu.anthropic.claude-fable-5"
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
contains: "jp.anthropic.claude-fable-5"
|
|
1533
|
+
}
|
|
1534
|
+
]
|
|
1535
|
+
},
|
|
1536
|
+
prices: {
|
|
1537
|
+
input_mtok: 11,
|
|
1538
|
+
cache_write_mtok: 13.75,
|
|
1539
|
+
cache_read_mtok: 1.1,
|
|
1540
|
+
output_mtok: 55
|
|
1541
|
+
}
|
|
1542
|
+
},
|
|
1484
1543
|
{
|
|
1485
1544
|
id: "regional.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
1486
1545
|
match: {
|
|
@@ -3508,6 +3567,20 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3508
3567
|
output_mtok: 15
|
|
3509
3568
|
}
|
|
3510
3569
|
},
|
|
3570
|
+
{
|
|
3571
|
+
id: "claude-fable-5",
|
|
3572
|
+
match: {
|
|
3573
|
+
contains: "claude-fable-5"
|
|
3574
|
+
},
|
|
3575
|
+
context_window: 1e6,
|
|
3576
|
+
price_comments: "Flat pricing across full 1M context window. Ref: https://cloud.google.com/vertex-ai/generative-ai/pricing#claude-models",
|
|
3577
|
+
prices: {
|
|
3578
|
+
input_mtok: 10,
|
|
3579
|
+
cache_write_mtok: 12.5,
|
|
3580
|
+
cache_read_mtok: 1,
|
|
3581
|
+
output_mtok: 50
|
|
3582
|
+
}
|
|
3583
|
+
},
|
|
3511
3584
|
{
|
|
3512
3585
|
id: "claude-opus-4-6",
|
|
3513
3586
|
match: {
|
|
@@ -8552,6 +8625,197 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
8552
8625
|
}
|
|
8553
8626
|
]
|
|
8554
8627
|
},
|
|
8628
|
+
{
|
|
8629
|
+
id: "minimax",
|
|
8630
|
+
name: "MiniMax",
|
|
8631
|
+
pricing_urls: ["https://platform.minimax.io/docs/guides/pricing-paygo"],
|
|
8632
|
+
api_pattern: "https://api\\.minimax(i)?\\.(?:com|io)",
|
|
8633
|
+
price_comments: "Prices sourced from MiniMax international platform USD pricing (platform.minimax.io, May 2026). M2.1, M2.1-highspeed, and M2 are legacy models; prices inferred from CNY pricing at the equivalent 7.00 CNY/USD rate used by the international platform for current models.",
|
|
8634
|
+
model_match: {
|
|
8635
|
+
or: [
|
|
8636
|
+
{
|
|
8637
|
+
starts_with: "MiniMax-M"
|
|
8638
|
+
},
|
|
8639
|
+
{
|
|
8640
|
+
starts_with: "minimax-m"
|
|
8641
|
+
},
|
|
8642
|
+
{
|
|
8643
|
+
equals: "M2-her"
|
|
8644
|
+
},
|
|
8645
|
+
{
|
|
8646
|
+
equals: "m2-her"
|
|
8647
|
+
}
|
|
8648
|
+
]
|
|
8649
|
+
},
|
|
8650
|
+
extractors: [
|
|
8651
|
+
{
|
|
8652
|
+
api_flavor: "chat",
|
|
8653
|
+
root: "usage",
|
|
8654
|
+
model_path: "model",
|
|
8655
|
+
mappings: [
|
|
8656
|
+
{
|
|
8657
|
+
path: "prompt_tokens",
|
|
8658
|
+
dest: "input_tokens",
|
|
8659
|
+
required: !0
|
|
8660
|
+
},
|
|
8661
|
+
{
|
|
8662
|
+
path: ["prompt_tokens_details", "cached_tokens"],
|
|
8663
|
+
dest: "cache_read_tokens",
|
|
8664
|
+
required: !1
|
|
8665
|
+
},
|
|
8666
|
+
{
|
|
8667
|
+
path: "completion_tokens",
|
|
8668
|
+
dest: "output_tokens",
|
|
8669
|
+
required: !0
|
|
8670
|
+
}
|
|
8671
|
+
]
|
|
8672
|
+
}
|
|
8673
|
+
],
|
|
8674
|
+
models: [
|
|
8675
|
+
{
|
|
8676
|
+
id: "M2-her",
|
|
8677
|
+
name: "MiniMax M2-her",
|
|
8678
|
+
description: "MiniMax M2-her, a text dialogue model optimized for role-playing and multi-turn conversations. 64,000 token context window. No cache support.",
|
|
8679
|
+
match: {
|
|
8680
|
+
or: [
|
|
8681
|
+
{
|
|
8682
|
+
equals: "M2-her"
|
|
8683
|
+
},
|
|
8684
|
+
{
|
|
8685
|
+
equals: "m2-her"
|
|
8686
|
+
}
|
|
8687
|
+
]
|
|
8688
|
+
},
|
|
8689
|
+
context_window: 64e3,
|
|
8690
|
+
prices: {
|
|
8691
|
+
input_mtok: 0.3,
|
|
8692
|
+
output_mtok: 1.2
|
|
8693
|
+
}
|
|
8694
|
+
},
|
|
8695
|
+
{
|
|
8696
|
+
id: "MiniMax-M2",
|
|
8697
|
+
name: "MiniMax M2",
|
|
8698
|
+
description: "MiniMax M2 (legacy), a multimodal language model with 204,800 token context window. Supports agentic capabilities and advanced reasoning.",
|
|
8699
|
+
match: {
|
|
8700
|
+
or: [
|
|
8701
|
+
{
|
|
8702
|
+
equals: "MiniMax-M2"
|
|
8703
|
+
},
|
|
8704
|
+
{
|
|
8705
|
+
equals: "minimax-m2"
|
|
8706
|
+
},
|
|
8707
|
+
{
|
|
8708
|
+
equals: "MiniMax-M2.1"
|
|
8709
|
+
},
|
|
8710
|
+
{
|
|
8711
|
+
equals: "minimax-m2.1"
|
|
8712
|
+
},
|
|
8713
|
+
{
|
|
8714
|
+
equals: "MiniMax-M2.5"
|
|
8715
|
+
},
|
|
8716
|
+
{
|
|
8717
|
+
equals: "minimax-m2.5"
|
|
8718
|
+
}
|
|
8719
|
+
]
|
|
8720
|
+
},
|
|
8721
|
+
context_window: 204800,
|
|
8722
|
+
prices: {
|
|
8723
|
+
input_mtok: 0.3,
|
|
8724
|
+
cache_write_mtok: 0.375,
|
|
8725
|
+
cache_read_mtok: 0.03,
|
|
8726
|
+
output_mtok: 1.2
|
|
8727
|
+
}
|
|
8728
|
+
},
|
|
8729
|
+
{
|
|
8730
|
+
id: "MiniMax-M2.1-highspeed",
|
|
8731
|
+
name: "MiniMax M2.1 Highspeed",
|
|
8732
|
+
description: "MiniMax M2.1 highspeed variant (legacy) with higher throughput.",
|
|
8733
|
+
match: {
|
|
8734
|
+
or: [
|
|
8735
|
+
{
|
|
8736
|
+
contains: "M2.1-highspeed"
|
|
8737
|
+
},
|
|
8738
|
+
{
|
|
8739
|
+
contains: "m2.1-highspeed"
|
|
8740
|
+
}
|
|
8741
|
+
]
|
|
8742
|
+
},
|
|
8743
|
+
context_window: 204800,
|
|
8744
|
+
prices: {
|
|
8745
|
+
input_mtok: 0.6,
|
|
8746
|
+
cache_write_mtok: 0.375,
|
|
8747
|
+
cache_read_mtok: 0.03,
|
|
8748
|
+
output_mtok: 2.4
|
|
8749
|
+
}
|
|
8750
|
+
},
|
|
8751
|
+
{
|
|
8752
|
+
id: "MiniMax-M2.5-highspeed",
|
|
8753
|
+
name: "MiniMax M2.5 Highspeed",
|
|
8754
|
+
description: "MiniMax M2.5 highspeed variant with higher throughput.",
|
|
8755
|
+
match: {
|
|
8756
|
+
or: [
|
|
8757
|
+
{
|
|
8758
|
+
contains: "M2.5-highspeed"
|
|
8759
|
+
},
|
|
8760
|
+
{
|
|
8761
|
+
contains: "m2.5-highspeed"
|
|
8762
|
+
}
|
|
8763
|
+
]
|
|
8764
|
+
},
|
|
8765
|
+
context_window: 204800,
|
|
8766
|
+
prices: {
|
|
8767
|
+
input_mtok: 0.6,
|
|
8768
|
+
cache_write_mtok: 0.375,
|
|
8769
|
+
cache_read_mtok: 0.03,
|
|
8770
|
+
output_mtok: 2.4
|
|
8771
|
+
}
|
|
8772
|
+
},
|
|
8773
|
+
{
|
|
8774
|
+
id: "MiniMax-M2.7",
|
|
8775
|
+
name: "MiniMax M2.7",
|
|
8776
|
+
description: "MiniMax M2.7, a multimodal language model with 204,800 token context window. Achieves top performance in real-world engineering, office productivity, and character-rich interaction.",
|
|
8777
|
+
match: {
|
|
8778
|
+
or: [
|
|
8779
|
+
{
|
|
8780
|
+
equals: "MiniMax-M2.7"
|
|
8781
|
+
},
|
|
8782
|
+
{
|
|
8783
|
+
equals: "minimax-m2.7"
|
|
8784
|
+
}
|
|
8785
|
+
]
|
|
8786
|
+
},
|
|
8787
|
+
context_window: 204800,
|
|
8788
|
+
prices: {
|
|
8789
|
+
input_mtok: 0.3,
|
|
8790
|
+
cache_write_mtok: 0.375,
|
|
8791
|
+
cache_read_mtok: 0.06,
|
|
8792
|
+
output_mtok: 1.2
|
|
8793
|
+
}
|
|
8794
|
+
},
|
|
8795
|
+
{
|
|
8796
|
+
id: "MiniMax-M2.7-highspeed",
|
|
8797
|
+
name: "MiniMax M2.7 Highspeed",
|
|
8798
|
+
description: "MiniMax M2.7 highspeed variant with higher throughput.",
|
|
8799
|
+
match: {
|
|
8800
|
+
or: [
|
|
8801
|
+
{
|
|
8802
|
+
contains: "M2.7-highspeed"
|
|
8803
|
+
},
|
|
8804
|
+
{
|
|
8805
|
+
contains: "m2.7-highspeed"
|
|
8806
|
+
}
|
|
8807
|
+
]
|
|
8808
|
+
},
|
|
8809
|
+
context_window: 204800,
|
|
8810
|
+
prices: {
|
|
8811
|
+
input_mtok: 0.6,
|
|
8812
|
+
cache_write_mtok: 0.375,
|
|
8813
|
+
cache_read_mtok: 0.06,
|
|
8814
|
+
output_mtok: 2.4
|
|
8815
|
+
}
|
|
8816
|
+
}
|
|
8817
|
+
]
|
|
8818
|
+
},
|
|
8555
8819
|
{
|
|
8556
8820
|
id: "mistral",
|
|
8557
8821
|
name: "Mistral",
|
|
@@ -9034,6 +9298,20 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
9034
9298
|
output_mtok: 3
|
|
9035
9299
|
}
|
|
9036
9300
|
},
|
|
9301
|
+
{
|
|
9302
|
+
id: "kimi-k2.6",
|
|
9303
|
+
name: "Kimi K2.6",
|
|
9304
|
+
description: "Kimi's most capable model with enhanced long-context coding stability, improved instruction compliance and self-correction capabilities. Native multimodal architecture supporting text, image, and video input, thinking and non-thinking modes, and agent tasks. Supports automatic context caching, ToolCalls, JSON Mode, Partial Mode, and internet search.",
|
|
9305
|
+
match: {
|
|
9306
|
+
starts_with: "kimi-k2.6"
|
|
9307
|
+
},
|
|
9308
|
+
context_window: 262144,
|
|
9309
|
+
prices: {
|
|
9310
|
+
input_mtok: 0.95,
|
|
9311
|
+
cache_read_mtok: 0.16,
|
|
9312
|
+
output_mtok: 4
|
|
9313
|
+
}
|
|
9314
|
+
},
|
|
9037
9315
|
{
|
|
9038
9316
|
id: "moonshot-v1-128k",
|
|
9039
9317
|
name: "Moonshot V1 128K",
|
|
@@ -11434,6 +11712,27 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
11434
11712
|
output_mtok: 15
|
|
11435
11713
|
}
|
|
11436
11714
|
},
|
|
11715
|
+
{
|
|
11716
|
+
id: "anthropic/claude-fable-5",
|
|
11717
|
+
match: {
|
|
11718
|
+
or: [
|
|
11719
|
+
{
|
|
11720
|
+
equals: "anthropic/claude-fable-5"
|
|
11721
|
+
},
|
|
11722
|
+
{
|
|
11723
|
+
equals: "anthropic/claude-fable-5:beta"
|
|
11724
|
+
}
|
|
11725
|
+
]
|
|
11726
|
+
},
|
|
11727
|
+
context_window: 1e6,
|
|
11728
|
+
price_comments: "Flat pricing across full 1M context window (no tiered pricing). Ref: https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing",
|
|
11729
|
+
prices: {
|
|
11730
|
+
input_mtok: 10,
|
|
11731
|
+
cache_write_mtok: 12.5,
|
|
11732
|
+
cache_read_mtok: 1,
|
|
11733
|
+
output_mtok: 50
|
|
11734
|
+
}
|
|
11735
|
+
},
|
|
11437
11736
|
{
|
|
11438
11737
|
id: "anthropic/claude-haiku-4.5",
|
|
11439
11738
|
match: {
|
|
@@ -19146,9 +19445,302 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
19146
19445
|
}
|
|
19147
19446
|
}
|
|
19148
19447
|
]
|
|
19448
|
+
},
|
|
19449
|
+
{
|
|
19450
|
+
id: "zhipuai",
|
|
19451
|
+
name: "Zhipu AI",
|
|
19452
|
+
pricing_urls: ["https://open.bigmodel.cn/pricing", "https://docs.bigmodel.cn/cn/guide/start/model-overview"],
|
|
19453
|
+
api_pattern: "https://open\\.bigmodel\\.cn",
|
|
19454
|
+
price_comments: "Prices sourced from Zhipu AI open platform pricing (CNY, open.bigmodel.cn/pricing), converted to USD at 1 USD = 7.25 CNY (May 2026). Zhipu AI does not publish USD prices; CNY is the only billing currency. Flagship models (GLM-4.5-Air, GLM-4.7, GLM-5 series) have tiered pricing by input/output length; prices shown are for the cheapest tier ([0, 32k) input / [0, 0.2k) output where applicable). GLM-4 standard inference models (GLM-4-Air, GLM-4-Plus, etc.) bill input and output tokens at the same per-token rate per their pricing page. Cache write is temporarily free for flagship models (limited-time promotion, not included).",
|
|
19455
|
+
model_match: {
|
|
19456
|
+
or: [
|
|
19457
|
+
{
|
|
19458
|
+
starts_with: "GLM-"
|
|
19459
|
+
},
|
|
19460
|
+
{
|
|
19461
|
+
starts_with: "glm-"
|
|
19462
|
+
}
|
|
19463
|
+
]
|
|
19464
|
+
},
|
|
19465
|
+
extractors: [
|
|
19466
|
+
{
|
|
19467
|
+
api_flavor: "chat",
|
|
19468
|
+
root: "usage",
|
|
19469
|
+
model_path: "model",
|
|
19470
|
+
mappings: [
|
|
19471
|
+
{
|
|
19472
|
+
path: "prompt_tokens",
|
|
19473
|
+
dest: "input_tokens",
|
|
19474
|
+
required: !0
|
|
19475
|
+
},
|
|
19476
|
+
{
|
|
19477
|
+
path: ["prompt_tokens_details", "cached_tokens"],
|
|
19478
|
+
dest: "cache_read_tokens",
|
|
19479
|
+
required: !1
|
|
19480
|
+
},
|
|
19481
|
+
{
|
|
19482
|
+
path: "completion_tokens",
|
|
19483
|
+
dest: "output_tokens",
|
|
19484
|
+
required: !0
|
|
19485
|
+
}
|
|
19486
|
+
]
|
|
19487
|
+
}
|
|
19488
|
+
],
|
|
19489
|
+
models: [
|
|
19490
|
+
{
|
|
19491
|
+
id: "GLM-4-Air",
|
|
19492
|
+
name: "GLM-4-Air",
|
|
19493
|
+
description: "High-performance GLM-4 model with context caching. 128,000 token context window. Input and output billed at the same per-token rate.",
|
|
19494
|
+
match: {
|
|
19495
|
+
or: [
|
|
19496
|
+
{
|
|
19497
|
+
equals: "GLM-4-Air"
|
|
19498
|
+
},
|
|
19499
|
+
{
|
|
19500
|
+
equals: "glm-4-air"
|
|
19501
|
+
}
|
|
19502
|
+
]
|
|
19503
|
+
},
|
|
19504
|
+
context_window: 128e3,
|
|
19505
|
+
prices: {
|
|
19506
|
+
input_mtok: 0.069,
|
|
19507
|
+
cache_read_mtok: 0.034,
|
|
19508
|
+
output_mtok: 0.069
|
|
19509
|
+
}
|
|
19510
|
+
},
|
|
19511
|
+
{
|
|
19512
|
+
id: "GLM-4-AirX",
|
|
19513
|
+
name: "GLM-4-AirX",
|
|
19514
|
+
description: "Fastest GLM-4 model. 8,000 token context window. Does not support context caching. Input and output billed at the same per-token rate.",
|
|
19515
|
+
match: {
|
|
19516
|
+
or: [
|
|
19517
|
+
{
|
|
19518
|
+
equals: "GLM-4-AirX"
|
|
19519
|
+
},
|
|
19520
|
+
{
|
|
19521
|
+
equals: "glm-4-airx"
|
|
19522
|
+
}
|
|
19523
|
+
]
|
|
19524
|
+
},
|
|
19525
|
+
context_window: 8e3,
|
|
19526
|
+
prices: {
|
|
19527
|
+
input_mtok: 1.379,
|
|
19528
|
+
output_mtok: 1.379
|
|
19529
|
+
}
|
|
19530
|
+
},
|
|
19531
|
+
{
|
|
19532
|
+
id: "GLM-4-Assistant",
|
|
19533
|
+
name: "GLM-4-Assistant",
|
|
19534
|
+
description: "GLM-4 agent/assistant model. 128,000 token context window. Does not support context caching. Input and output billed at the same per-token rate.",
|
|
19535
|
+
match: {
|
|
19536
|
+
or: [
|
|
19537
|
+
{
|
|
19538
|
+
equals: "GLM-4-Assistant"
|
|
19539
|
+
},
|
|
19540
|
+
{
|
|
19541
|
+
equals: "glm-4-assistant"
|
|
19542
|
+
}
|
|
19543
|
+
]
|
|
19544
|
+
},
|
|
19545
|
+
context_window: 128e3,
|
|
19546
|
+
prices: {
|
|
19547
|
+
input_mtok: 0.69,
|
|
19548
|
+
output_mtok: 0.69
|
|
19549
|
+
}
|
|
19550
|
+
},
|
|
19551
|
+
{
|
|
19552
|
+
id: "GLM-4-FlashX-250414",
|
|
19553
|
+
name: "GLM-4-FlashX-250414",
|
|
19554
|
+
description: "Fast and cheap GLM-4 model with context caching. 128,000 token context window. Input and output billed at the same per-token rate.",
|
|
19555
|
+
match: {
|
|
19556
|
+
or: [
|
|
19557
|
+
{
|
|
19558
|
+
equals: "GLM-4-FlashX-250414"
|
|
19559
|
+
},
|
|
19560
|
+
{
|
|
19561
|
+
equals: "glm-4-flashx-250414"
|
|
19562
|
+
}
|
|
19563
|
+
]
|
|
19564
|
+
},
|
|
19565
|
+
context_window: 128e3,
|
|
19566
|
+
prices: {
|
|
19567
|
+
input_mtok: 0.014,
|
|
19568
|
+
cache_read_mtok: 7e-3,
|
|
19569
|
+
output_mtok: 0.014
|
|
19570
|
+
}
|
|
19571
|
+
},
|
|
19572
|
+
{
|
|
19573
|
+
id: "GLM-4-Long",
|
|
19574
|
+
name: "GLM-4-Long",
|
|
19575
|
+
description: "GLM-4 model optimized for long inputs with context caching. 1,000,000 token context window. Input and output billed at the same per-token rate.",
|
|
19576
|
+
match: {
|
|
19577
|
+
or: [
|
|
19578
|
+
{
|
|
19579
|
+
equals: "GLM-4-Long"
|
|
19580
|
+
},
|
|
19581
|
+
{
|
|
19582
|
+
equals: "glm-4-long"
|
|
19583
|
+
}
|
|
19584
|
+
]
|
|
19585
|
+
},
|
|
19586
|
+
context_window: 1e6,
|
|
19587
|
+
prices: {
|
|
19588
|
+
input_mtok: 0.138,
|
|
19589
|
+
cache_read_mtok: 0.069,
|
|
19590
|
+
output_mtok: 0.138
|
|
19591
|
+
}
|
|
19592
|
+
},
|
|
19593
|
+
{
|
|
19594
|
+
id: "GLM-4-Plus",
|
|
19595
|
+
name: "GLM-4-Plus",
|
|
19596
|
+
description: "Flagship GLM-4 model with context caching. 128,000 token context window. Input and output billed at the same per-token rate.",
|
|
19597
|
+
match: {
|
|
19598
|
+
or: [
|
|
19599
|
+
{
|
|
19600
|
+
equals: "GLM-4-Plus"
|
|
19601
|
+
},
|
|
19602
|
+
{
|
|
19603
|
+
equals: "glm-4-plus"
|
|
19604
|
+
}
|
|
19605
|
+
]
|
|
19606
|
+
},
|
|
19607
|
+
context_window: 128e3,
|
|
19608
|
+
prices: {
|
|
19609
|
+
input_mtok: 0.69,
|
|
19610
|
+
cache_read_mtok: 0.345,
|
|
19611
|
+
output_mtok: 0.69
|
|
19612
|
+
}
|
|
19613
|
+
},
|
|
19614
|
+
{
|
|
19615
|
+
id: "GLM-4.5-Air",
|
|
19616
|
+
name: "GLM-4.5-Air",
|
|
19617
|
+
description: "Zhipu AI's GLM-4.5-Air flagship model with context caching. 128,000 token context window. Tiered pricing; prices shown for [0, 32k) input / [0, 0.2k) output tier.",
|
|
19618
|
+
match: {
|
|
19619
|
+
or: [
|
|
19620
|
+
{
|
|
19621
|
+
equals: "GLM-4.5-Air"
|
|
19622
|
+
},
|
|
19623
|
+
{
|
|
19624
|
+
equals: "glm-4.5-air"
|
|
19625
|
+
}
|
|
19626
|
+
]
|
|
19627
|
+
},
|
|
19628
|
+
context_window: 128e3,
|
|
19629
|
+
prices: {
|
|
19630
|
+
input_mtok: 0.11,
|
|
19631
|
+
cache_read_mtok: 0.022,
|
|
19632
|
+
output_mtok: 0.276
|
|
19633
|
+
}
|
|
19634
|
+
},
|
|
19635
|
+
{
|
|
19636
|
+
id: "GLM-4.7",
|
|
19637
|
+
name: "GLM-4.7",
|
|
19638
|
+
description: "Zhipu AI's GLM-4.7 flagship model with context caching. 200,000 token context window. Tiered pricing; prices shown for [0, 32k) input / [0, 0.2k) output tier.",
|
|
19639
|
+
match: {
|
|
19640
|
+
or: [
|
|
19641
|
+
{
|
|
19642
|
+
equals: "GLM-4.7"
|
|
19643
|
+
},
|
|
19644
|
+
{
|
|
19645
|
+
equals: "glm-4.7"
|
|
19646
|
+
}
|
|
19647
|
+
]
|
|
19648
|
+
},
|
|
19649
|
+
context_window: 2e5,
|
|
19650
|
+
prices: {
|
|
19651
|
+
input_mtok: 0.276,
|
|
19652
|
+
cache_read_mtok: 0.055,
|
|
19653
|
+
output_mtok: 1.103
|
|
19654
|
+
}
|
|
19655
|
+
},
|
|
19656
|
+
{
|
|
19657
|
+
id: "GLM-4.7-FlashX",
|
|
19658
|
+
name: "GLM-4.7-FlashX",
|
|
19659
|
+
description: "Fast and affordable GLM-4.7 model with context caching. 200,000 token context window.",
|
|
19660
|
+
match: {
|
|
19661
|
+
or: [
|
|
19662
|
+
{
|
|
19663
|
+
equals: "GLM-4.7-FlashX"
|
|
19664
|
+
},
|
|
19665
|
+
{
|
|
19666
|
+
equals: "glm-4.7-flashx"
|
|
19667
|
+
}
|
|
19668
|
+
]
|
|
19669
|
+
},
|
|
19670
|
+
context_window: 2e5,
|
|
19671
|
+
prices: {
|
|
19672
|
+
input_mtok: 0.069,
|
|
19673
|
+
cache_read_mtok: 0.014,
|
|
19674
|
+
output_mtok: 0.414
|
|
19675
|
+
}
|
|
19676
|
+
},
|
|
19677
|
+
{
|
|
19678
|
+
id: "GLM-5",
|
|
19679
|
+
name: "GLM-5",
|
|
19680
|
+
description: "Zhipu AI GLM-5 model with context caching. 200,000 token context window. Tiered pricing; prices shown for [0, 32k) input tier.",
|
|
19681
|
+
match: {
|
|
19682
|
+
or: [
|
|
19683
|
+
{
|
|
19684
|
+
equals: "GLM-5"
|
|
19685
|
+
},
|
|
19686
|
+
{
|
|
19687
|
+
equals: "glm-5"
|
|
19688
|
+
}
|
|
19689
|
+
]
|
|
19690
|
+
},
|
|
19691
|
+
context_window: 2e5,
|
|
19692
|
+
prices: {
|
|
19693
|
+
input_mtok: 0.552,
|
|
19694
|
+
cache_read_mtok: 0.138,
|
|
19695
|
+
output_mtok: 2.483
|
|
19696
|
+
}
|
|
19697
|
+
},
|
|
19698
|
+
{
|
|
19699
|
+
id: "GLM-5-Turbo",
|
|
19700
|
+
name: "GLM-5-Turbo",
|
|
19701
|
+
description: "Zhipu AI GLM-5 Turbo model with context caching. 200,000 token context window. Tiered pricing; prices shown for [0, 32k) input tier.",
|
|
19702
|
+
match: {
|
|
19703
|
+
or: [
|
|
19704
|
+
{
|
|
19705
|
+
equals: "GLM-5-Turbo"
|
|
19706
|
+
},
|
|
19707
|
+
{
|
|
19708
|
+
equals: "glm-5-turbo"
|
|
19709
|
+
}
|
|
19710
|
+
]
|
|
19711
|
+
},
|
|
19712
|
+
context_window: 2e5,
|
|
19713
|
+
prices: {
|
|
19714
|
+
input_mtok: 0.69,
|
|
19715
|
+
cache_read_mtok: 0.166,
|
|
19716
|
+
output_mtok: 3.034
|
|
19717
|
+
}
|
|
19718
|
+
},
|
|
19719
|
+
{
|
|
19720
|
+
id: "GLM-5.1",
|
|
19721
|
+
name: "GLM-5.1",
|
|
19722
|
+
description: "Zhipu AI's latest flagship model supporting long-horizon tasks, structured output, function calling, and context caching. 200,000 token context window. Tiered pricing; prices shown for [0, 32k) input tier.",
|
|
19723
|
+
match: {
|
|
19724
|
+
or: [
|
|
19725
|
+
{
|
|
19726
|
+
equals: "GLM-5.1"
|
|
19727
|
+
},
|
|
19728
|
+
{
|
|
19729
|
+
equals: "glm-5.1"
|
|
19730
|
+
}
|
|
19731
|
+
]
|
|
19732
|
+
},
|
|
19733
|
+
context_window: 2e5,
|
|
19734
|
+
prices: {
|
|
19735
|
+
input_mtok: 0.828,
|
|
19736
|
+
cache_read_mtok: 0.179,
|
|
19737
|
+
output_mtok: 3.31
|
|
19738
|
+
}
|
|
19739
|
+
}
|
|
19740
|
+
]
|
|
19149
19741
|
}
|
|
19150
19742
|
];
|
|
19151
|
-
function
|
|
19743
|
+
function A(t, e, i) {
|
|
19152
19744
|
if (e <= 0) return 0;
|
|
19153
19745
|
let a = t.base;
|
|
19154
19746
|
for (const o of t.tiers)
|
|
@@ -19156,34 +19748,34 @@ function S(t, e, i) {
|
|
|
19156
19748
|
return a * e / 1e6;
|
|
19157
19749
|
}
|
|
19158
19750
|
function d(t, e, i, a) {
|
|
19159
|
-
return t === void 0 || e === void 0 ? 0 : typeof t == "number" ? t * e / 1e6 :
|
|
19751
|
+
return t === void 0 || e === void 0 ? 0 : typeof t == "number" ? t * e / 1e6 : A(t, e, a);
|
|
19160
19752
|
}
|
|
19161
|
-
function
|
|
19753
|
+
function T(t, e) {
|
|
19162
19754
|
let i = 0, a = 0;
|
|
19163
|
-
const o = t.input_tokens ?? 0, r = t.cache_read_tokens ?? 0, m = t.cache_write_tokens ?? 0, n = t.cache_audio_read_tokens ?? 0, s = t.input_audio_tokens ?? 0,
|
|
19755
|
+
const o = t.input_tokens ?? 0, r = t.cache_read_tokens ?? 0, m = t.cache_write_tokens ?? 0, n = t.cache_audio_read_tokens ?? 0, s = t.input_audio_tokens ?? 0, c = t.output_audio_tokens ?? 0, u = e.cache_audio_read_mtok === void 0 ? 0 : n, p = e.cache_audio_read_mtok === void 0 && e.cache_read_mtok !== void 0 ? n : 0;
|
|
19164
19756
|
let l = 0;
|
|
19165
|
-
if (e.input_audio_mtok !== void 0 && (l = s - u -
|
|
19757
|
+
if (e.input_audio_mtok !== void 0 && (l = s - u - p), l < 0)
|
|
19166
19758
|
throw new Error("cache_audio_read_tokens cannot be greater than input_audio_tokens");
|
|
19167
19759
|
let w = 0;
|
|
19168
19760
|
if (e.cache_read_mtok !== void 0 && (w = r - u), w < 0)
|
|
19169
19761
|
throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
|
|
19170
|
-
const
|
|
19762
|
+
const I = e.cache_write_mtok === void 0 ? 0 : m;
|
|
19171
19763
|
let b = 0;
|
|
19172
|
-
if (e.input_mtok !== void 0 && (b = o - w -
|
|
19764
|
+
if (e.input_mtok !== void 0 && (b = o - w - I - l - u), b < 0)
|
|
19173
19765
|
throw new Error("Uncached text input tokens cannot be negative");
|
|
19174
|
-
i += d(e.input_mtok, b, "input_mtok", o), i += d(e.cache_read_mtok, w, "cache_read_mtok", o), i += d(e.cache_write_mtok,
|
|
19766
|
+
i += d(e.input_mtok, b, "input_mtok", o), i += d(e.cache_read_mtok, w, "cache_read_mtok", o), i += d(e.cache_write_mtok, I, "cache_write_mtok", o), i += d(e.input_audio_mtok, l, "input_audio_mtok", o), i += d(e.cache_audio_read_mtok, u, "cache_audio_read_mtok", o);
|
|
19175
19767
|
let f = 0;
|
|
19176
|
-
if (e.output_mtok !== void 0 && (f = (t.output_tokens ?? 0) - (e.output_audio_mtok === void 0 ? 0 :
|
|
19768
|
+
if (e.output_mtok !== void 0 && (f = (t.output_tokens ?? 0) - (e.output_audio_mtok === void 0 ? 0 : c)), f < 0)
|
|
19177
19769
|
throw new Error("output_audio_tokens cannot be greater than output_tokens");
|
|
19178
19770
|
a += d(e.output_mtok, f, "output_mtok", o), a += d(e.output_audio_mtok, t.output_audio_tokens, "output_audio_mtok", o);
|
|
19179
|
-
let
|
|
19180
|
-
return e.requests_kcount !== void 0 && (
|
|
19771
|
+
let L = i + a;
|
|
19772
|
+
return e.requests_kcount !== void 0 && (L += e.requests_kcount / 1e3), {
|
|
19181
19773
|
input_price: i,
|
|
19182
19774
|
output_price: a,
|
|
19183
|
-
total_price:
|
|
19775
|
+
total_price: L
|
|
19184
19776
|
};
|
|
19185
19777
|
}
|
|
19186
|
-
function
|
|
19778
|
+
function S(t, e) {
|
|
19187
19779
|
if (!Array.isArray(t.prices))
|
|
19188
19780
|
return t.prices;
|
|
19189
19781
|
for (let i = t.prices.length - 1; i >= 0; i--) {
|
|
@@ -19205,7 +19797,7 @@ function G(t, e) {
|
|
|
19205
19797
|
return t.prices[0].prices;
|
|
19206
19798
|
}
|
|
19207
19799
|
function g(t, e) {
|
|
19208
|
-
return "or" in t ? t.or.some((i) => g(i, e)) : "and" in t ? t.and.every((i) => g(i, 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;
|
|
19800
|
+
return "or" in t ? t.or.some((i) => g(i, e)) : "and" in t ? t.and.every((i) => g(i, e)) : "equals" in t ? e.toLowerCase() === t.equals.toLowerCase() : "starts_with" in t ? e.toLowerCase().startsWith(t.starts_with.toLowerCase()) : "ends_with" in t ? e.toLowerCase().endsWith(t.ends_with.toLowerCase()) : "contains" in t ? e.toLowerCase().includes(t.contains.toLowerCase()) : "regex" in t ? new RegExp(t.regex).test(e) : !1;
|
|
19209
19801
|
}
|
|
19210
19802
|
function z(t, e) {
|
|
19211
19803
|
const i = e.toLowerCase().trim(), a = t.find((o) => o.id === i);
|
|
@@ -19222,11 +19814,11 @@ function x(t, { modelId: e, providerApiUrl: i, providerId: a }) {
|
|
|
19222
19814
|
if (e)
|
|
19223
19815
|
return t.find((o) => o.model_match && g(o.model_match, e));
|
|
19224
19816
|
}
|
|
19225
|
-
function
|
|
19817
|
+
function C(t, e) {
|
|
19226
19818
|
return t.find((i) => g(i.match, e));
|
|
19227
19819
|
}
|
|
19228
19820
|
function P(t, e, i) {
|
|
19229
|
-
const a =
|
|
19821
|
+
const a = C(t.models, e);
|
|
19230
19822
|
if (a) return a;
|
|
19231
19823
|
if (t.fallback_model_providers && i)
|
|
19232
19824
|
for (const o of t.fallback_model_providers) {
|
|
@@ -19237,20 +19829,20 @@ function P(t, e, i) {
|
|
|
19237
19829
|
}
|
|
19238
19830
|
}
|
|
19239
19831
|
}
|
|
19240
|
-
const
|
|
19241
|
-
let h = Q, B = Promise.resolve(Q),
|
|
19832
|
+
const R = "https://raw.githubusercontent.com/pydantic/genai-prices/main/prices/data.json";
|
|
19833
|
+
let h = Q, B = Promise.resolve(Q), M = null;
|
|
19242
19834
|
function D(t) {
|
|
19243
19835
|
t !== null && ("then" in t ? (B = t, t.then((e) => {
|
|
19244
19836
|
e !== null && (h = e);
|
|
19245
19837
|
})) : (B = Promise.resolve(t), h = t));
|
|
19246
19838
|
}
|
|
19247
19839
|
function N(t) {
|
|
19248
|
-
|
|
19840
|
+
M = t;
|
|
19249
19841
|
}
|
|
19250
19842
|
function O(t) {
|
|
19251
19843
|
t({
|
|
19252
19844
|
onCalc: N,
|
|
19253
|
-
remoteDataUrl:
|
|
19845
|
+
remoteDataUrl: R,
|
|
19254
19846
|
setProviderData: D
|
|
19255
19847
|
});
|
|
19256
19848
|
}
|
|
@@ -19258,44 +19850,44 @@ function K() {
|
|
|
19258
19850
|
return B;
|
|
19259
19851
|
}
|
|
19260
19852
|
function j(t, e, i) {
|
|
19261
|
-
|
|
19853
|
+
M?.();
|
|
19262
19854
|
let a = e.toLowerCase().trim(), o = i?.providerId;
|
|
19263
19855
|
if (o && o.toLowerCase() === "litellm" && a.includes("/")) {
|
|
19264
|
-
const u = a.indexOf("/"),
|
|
19265
|
-
|
|
19856
|
+
const u = a.indexOf("/"), p = a.slice(0, u), l = a.slice(u + 1);
|
|
19857
|
+
p && l && x(h, { providerId: p }) && (o = p, a = l);
|
|
19266
19858
|
}
|
|
19267
19859
|
const r = i?.provider ?? x(h, { modelId: a, providerApiUrl: i?.providerApiUrl, providerId: o });
|
|
19268
19860
|
if (!r) return null;
|
|
19269
19861
|
const m = P(r, a, h);
|
|
19270
19862
|
if (!m) return null;
|
|
19271
|
-
const n = i?.timestamp ?? /* @__PURE__ */ new Date(), s =
|
|
19863
|
+
const n = i?.timestamp ?? /* @__PURE__ */ new Date(), s = S(m, n), c = T(t, s);
|
|
19272
19864
|
return {
|
|
19273
19865
|
auto_update_timestamp: void 0,
|
|
19274
19866
|
model: m,
|
|
19275
19867
|
model_price: s,
|
|
19276
19868
|
provider: r,
|
|
19277
|
-
...
|
|
19869
|
+
...c
|
|
19278
19870
|
};
|
|
19279
19871
|
}
|
|
19280
19872
|
function H(t) {
|
|
19281
|
-
return
|
|
19873
|
+
return M?.(), x(h, t);
|
|
19282
19874
|
}
|
|
19283
|
-
function
|
|
19875
|
+
function U(t, e, i) {
|
|
19284
19876
|
if (i = i ?? "default", !t.extractors)
|
|
19285
19877
|
throw new Error("No extraction logic defined for this provider");
|
|
19286
19878
|
const a = t.extractors.find((s) => s.api_flavor === i);
|
|
19287
19879
|
if (!a) {
|
|
19288
|
-
const s = t.extractors.map((
|
|
19880
|
+
const s = t.extractors.map((c) => c.api_flavor).join(", ");
|
|
19289
19881
|
throw new Error(`Unknown apiFlavor '${i}', allowed values: ${s}`);
|
|
19290
19882
|
}
|
|
19291
19883
|
if (!q.guard(e))
|
|
19292
19884
|
throw new Error(`Expected response data to be a mapping object, got ${_(e)}`);
|
|
19293
|
-
const o = v(a.model_path, e,
|
|
19885
|
+
const o = v(a.model_path, e, F, !1, []), r = G(a.root), m = v(r, e, q, !0, []), n = {};
|
|
19294
19886
|
for (const s of a.mappings) {
|
|
19295
|
-
const
|
|
19296
|
-
if (
|
|
19887
|
+
const c = v(s.path, m, E, s.required, r);
|
|
19888
|
+
if (c !== null) {
|
|
19297
19889
|
const u = n[s.dest] ?? 0;
|
|
19298
|
-
n[s.dest] = u +
|
|
19890
|
+
n[s.dest] = u + c;
|
|
19299
19891
|
}
|
|
19300
19892
|
}
|
|
19301
19893
|
if (!Object.keys(n).length)
|
|
@@ -19303,7 +19895,7 @@ function $(t, e, i) {
|
|
|
19303
19895
|
return { model: o, usage: n };
|
|
19304
19896
|
}
|
|
19305
19897
|
function v(t, e, i, a, o) {
|
|
19306
|
-
const [r, ...m] =
|
|
19898
|
+
const [r, ...m] = G(t).reverse();
|
|
19307
19899
|
if (typeof r != "string")
|
|
19308
19900
|
throw new Error(`Expected last step of path to be a string, got ${_(r)}`);
|
|
19309
19901
|
m.reverse();
|
|
@@ -19327,8 +19919,8 @@ function v(t, e, i, a, o) {
|
|
|
19327
19919
|
}
|
|
19328
19920
|
if (typeof n > "u")
|
|
19329
19921
|
if (a) {
|
|
19330
|
-
const
|
|
19331
|
-
throw new Error(`${
|
|
19922
|
+
const p = typeof u == "object" ? "Unable to find item" : "Missing value";
|
|
19923
|
+
throw new Error(`${p} at \`${k(o, s)}\``);
|
|
19332
19924
|
} else
|
|
19333
19925
|
return null;
|
|
19334
19926
|
}
|
|
@@ -19337,16 +19929,16 @@ function v(t, e, i, a, o) {
|
|
|
19337
19929
|
throw new Error(`Expected \`${k(o, s)}\` value to be a mapping, got ${_(n)}`);
|
|
19338
19930
|
return null;
|
|
19339
19931
|
}
|
|
19340
|
-
const
|
|
19341
|
-
if (typeof
|
|
19932
|
+
const c = n[r];
|
|
19933
|
+
if (typeof c > "u") {
|
|
19342
19934
|
if (a)
|
|
19343
19935
|
throw s.push(r), new Error(`Missing value at \`${k(o, s)}\``);
|
|
19344
19936
|
return null;
|
|
19345
19937
|
}
|
|
19346
|
-
if (i.guard(
|
|
19347
|
-
return
|
|
19938
|
+
if (i.guard(c))
|
|
19939
|
+
return c;
|
|
19348
19940
|
if (a)
|
|
19349
|
-
throw s.push(r), new Error(`Expected \`${k(o, s)}\` value to be a ${i.name}, got ${_(
|
|
19941
|
+
throw s.push(r), new Error(`Expected \`${k(o, s)}\` value to be a ${i.name}, got ${_(c)}`);
|
|
19350
19942
|
return null;
|
|
19351
19943
|
}
|
|
19352
19944
|
function V(t, e) {
|
|
@@ -19357,7 +19949,7 @@ function V(t, e) {
|
|
|
19357
19949
|
return i;
|
|
19358
19950
|
}
|
|
19359
19951
|
}
|
|
19360
|
-
function
|
|
19952
|
+
function G(t) {
|
|
19361
19953
|
return Array.isArray(t) ? [...t] : [t];
|
|
19362
19954
|
}
|
|
19363
19955
|
function _(t) {
|
|
@@ -19366,14 +19958,14 @@ function _(t) {
|
|
|
19366
19958
|
const q = {
|
|
19367
19959
|
guard: (t) => _(t) === "mapping",
|
|
19368
19960
|
name: "mapping"
|
|
19369
|
-
},
|
|
19961
|
+
}, F = {
|
|
19370
19962
|
guard: (t) => typeof t == "string",
|
|
19371
19963
|
name: "string"
|
|
19372
|
-
},
|
|
19964
|
+
}, E = {
|
|
19373
19965
|
guard: (t) => typeof t == "number",
|
|
19374
19966
|
name: "number"
|
|
19375
|
-
}, k = (t, e) => [...t.map(
|
|
19376
|
-
class
|
|
19967
|
+
}, k = (t, e) => [...t.map(y), ...e.map(y)].join("."), y = (t) => typeof t == "string" ? t : JSON.stringify(t);
|
|
19968
|
+
class $ {
|
|
19377
19969
|
base;
|
|
19378
19970
|
tiers;
|
|
19379
19971
|
constructor(e) {
|
|
@@ -19381,10 +19973,10 @@ class U {
|
|
|
19381
19973
|
}
|
|
19382
19974
|
}
|
|
19383
19975
|
export {
|
|
19384
|
-
|
|
19385
|
-
|
|
19976
|
+
R as REMOTE_DATA_JSON_URL,
|
|
19977
|
+
$ as TieredPrices,
|
|
19386
19978
|
j as calcPrice,
|
|
19387
|
-
|
|
19979
|
+
U as extractUsage,
|
|
19388
19980
|
H as findProvider,
|
|
19389
19981
|
O as updatePrices,
|
|
19390
19982
|
K as waitForUpdate
|