@pydantic/genai-prices 0.0.56 → 0.0.61

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
@@ -1,4 +1,4 @@
1
- const I = [
1
+ const Q = [
2
2
  {
3
3
  id: "anthropic",
4
4
  name: "Anthropic",
@@ -392,6 +392,35 @@ const I = [
392
392
  }
393
393
  ]
394
394
  },
395
+ {
396
+ id: "claude-opus-4-7",
397
+ name: "Claude Opus 4.7",
398
+ description: "Our most capable model for complex reasoning and agentic coding",
399
+ match: {
400
+ or: [
401
+ {
402
+ starts_with: "claude-opus-4-7"
403
+ },
404
+ {
405
+ starts_with: "claude-opus-4.7"
406
+ },
407
+ {
408
+ starts_with: "claude-4-7-opus"
409
+ },
410
+ {
411
+ starts_with: "claude-4.7-opus"
412
+ }
413
+ ]
414
+ },
415
+ context_window: 1e6,
416
+ 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",
417
+ prices: {
418
+ input_mtok: 5,
419
+ cache_write_mtok: 6.25,
420
+ cache_read_mtok: 0.5,
421
+ output_mtok: 25
422
+ }
423
+ },
395
424
  {
396
425
  id: "claude-sonnet-4-0",
397
426
  name: "Claude Sonnet 4",
@@ -848,6 +877,18 @@ const I = [
848
877
  }
849
878
  }
850
879
  },
880
+ {
881
+ id: "global.anthropic.claude-opus-4-7-v1:0",
882
+ match: {
883
+ contains: "global.anthropic.claude-opus-4-7"
884
+ },
885
+ prices: {
886
+ input_mtok: 5,
887
+ cache_write_mtok: 6.25,
888
+ cache_read_mtok: 0.5,
889
+ output_mtok: 25
890
+ }
891
+ },
851
892
  {
852
893
  id: "global.anthropic.claude-sonnet-4-20250514-v1:0",
853
894
  match: {
@@ -1092,6 +1133,39 @@ const I = [
1092
1133
  output_mtok: 6
1093
1134
  }
1094
1135
  },
1136
+ {
1137
+ id: "nvidia.nemotron-nano-3-30b:0",
1138
+ name: "Nemotron 3 Nano 30B",
1139
+ match: {
1140
+ contains: "nvidia.nemotron-nano-3-30b"
1141
+ },
1142
+ prices: {
1143
+ input_mtok: 0.06,
1144
+ output_mtok: 0.24
1145
+ }
1146
+ },
1147
+ {
1148
+ id: "nvidia.nemotron-nano-9b-v2:0",
1149
+ name: "Nemotron 2 Nano 9B",
1150
+ match: {
1151
+ contains: "nvidia.nemotron-nano-9b-v2"
1152
+ },
1153
+ prices: {
1154
+ input_mtok: 0.06,
1155
+ output_mtok: 0.23
1156
+ }
1157
+ },
1158
+ {
1159
+ id: "nvidia.nemotron-super-3-120b:0",
1160
+ name: "Nemotron 3 Super 120B",
1161
+ match: {
1162
+ contains: "nvidia.nemotron-super-3-120b"
1163
+ },
1164
+ prices: {
1165
+ input_mtok: 0.15,
1166
+ output_mtok: 0.65
1167
+ }
1168
+ },
1095
1169
  {
1096
1170
  id: "openai.gpt-oss-120b-1:0",
1097
1171
  name: "gpt-oss-120b",
@@ -1455,6 +1529,43 @@ const I = [
1455
1529
  }
1456
1530
  }
1457
1531
  },
1532
+ {
1533
+ id: "regional.anthropic.claude-opus-4-7-v1:0",
1534
+ match: {
1535
+ or: [
1536
+ {
1537
+ starts_with: "anthropic.claude-opus-4-7"
1538
+ },
1539
+ {
1540
+ starts_with: "claude-opus-4-7"
1541
+ },
1542
+ {
1543
+ contains: "us.anthropic.claude-opus-4-7"
1544
+ },
1545
+ {
1546
+ contains: "au.anthropic.claude-opus-4-7"
1547
+ },
1548
+ {
1549
+ contains: "apac.anthropic.claude-opus-4-7"
1550
+ },
1551
+ {
1552
+ contains: "eu.anthropic.claude-opus-4-7"
1553
+ },
1554
+ {
1555
+ contains: "us-gov.anthropic.claude-opus-4-7"
1556
+ },
1557
+ {
1558
+ contains: "jp.anthropic.claude-opus-4-7"
1559
+ }
1560
+ ]
1561
+ },
1562
+ prices: {
1563
+ input_mtok: 5.5,
1564
+ cache_write_mtok: 6.875,
1565
+ cache_read_mtok: 0.55,
1566
+ output_mtok: 27.5
1567
+ }
1568
+ },
1458
1569
  {
1459
1570
  id: "regional.anthropic.claude-sonnet-4-20250514-v1:0",
1460
1571
  match: {
@@ -2411,6 +2522,43 @@ Compared to other leading proprietary and open-weights models Command A delivers
2411
2522
  }
2412
2523
  }
2413
2524
  ]
2525
+ },
2526
+ {
2527
+ id: "deepseek-v4-flash",
2528
+ name: "DeepSeek V4 Flash",
2529
+ description: "DeepSeek-V4-Flash. Supports both non-thinking and thinking (default) modes, JSON output, tool calls, chat prefix completion, and FIM completion (non-thinking only).",
2530
+ match: {
2531
+ or: [
2532
+ {
2533
+ starts_with: "deepseek-v4-flash"
2534
+ }
2535
+ ]
2536
+ },
2537
+ context_window: 1e6,
2538
+ prices: {
2539
+ input_mtok: 0.14,
2540
+ cache_read_mtok: 28e-4,
2541
+ output_mtok: 0.28
2542
+ }
2543
+ },
2544
+ {
2545
+ id: "deepseek-v4-pro",
2546
+ name: "DeepSeek V4 Pro",
2547
+ description: "DeepSeek-V4-Pro. Supports both non-thinking and thinking (default) modes, JSON output, tool calls, chat prefix completion, and FIM completion (non-thinking only).",
2548
+ match: {
2549
+ or: [
2550
+ {
2551
+ starts_with: "deepseek-v4-pro"
2552
+ }
2553
+ ]
2554
+ },
2555
+ context_window: 1e6,
2556
+ price_comments: "Standard (non-promotional) pricing. DeepSeek is offering a temporary 75% promotional discount that is not reflected here.",
2557
+ prices: {
2558
+ input_mtok: 1.74,
2559
+ cache_read_mtok: 0.0145,
2560
+ output_mtok: 3.48
2561
+ }
2414
2562
  }
2415
2563
  ]
2416
2564
  },
@@ -2724,7 +2872,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
2724
2872
  },
2725
2873
  {
2726
2874
  path: "toolUsePromptTokenCount",
2727
- dest: "output_tokens",
2875
+ dest: "input_tokens",
2728
2876
  required: !1
2729
2877
  }
2730
2878
  ]
@@ -2972,6 +3120,33 @@ Compared to other leading proprietary and open-weights models Command A delivers
2972
3120
  }
2973
3121
  }
2974
3122
  },
3123
+ {
3124
+ id: "claude-opus-4-7",
3125
+ match: {
3126
+ or: [
3127
+ {
3128
+ contains: "claude-4-7-opus"
3129
+ },
3130
+ {
3131
+ contains: "claude-opus-4-7"
3132
+ },
3133
+ {
3134
+ contains: "claude-4.7-opus"
3135
+ },
3136
+ {
3137
+ contains: "claude-opus-4.7"
3138
+ }
3139
+ ]
3140
+ },
3141
+ context_window: 1e6,
3142
+ price_comments: "Flat pricing across full 1M context window. Ref: https://cloud.google.com/vertex-ai/generative-ai/pricing#claude-models",
3143
+ prices: {
3144
+ input_mtok: 5,
3145
+ cache_write_mtok: 6.25,
3146
+ cache_read_mtok: 0.5,
3147
+ output_mtok: 25
3148
+ }
3149
+ },
2975
3150
  {
2976
3151
  id: "gemini-1.0-pro-vision-001",
2977
3152
  name: "gemini 1.0 pro vision",
@@ -3079,17 +3254,10 @@ Compared to other leading proprietary and open-weights models Command A delivers
3079
3254
  context_window: 1e6,
3080
3255
  prices: {
3081
3256
  input_mtok: 0.1,
3082
- cache_read_mtok: {
3083
- base: 0.025,
3084
- tiers: [
3085
- {
3086
- start: 1e6,
3087
- price: 0.175
3088
- }
3089
- ]
3090
- },
3257
+ cache_read_mtok: 0.025,
3091
3258
  output_mtok: 0.4,
3092
- input_audio_mtok: 0.7
3259
+ input_audio_mtok: 0.7,
3260
+ cache_audio_read_mtok: 0.175
3093
3261
  }
3094
3262
  },
3095
3263
  {
@@ -3346,14 +3514,14 @@ Compared to other leading proprietary and open-weights models Command A delivers
3346
3514
  }
3347
3515
  },
3348
3516
  {
3349
- id: "gemini-3.1-flash-lite-preview",
3350
- name: "Gemini 3.1 Flash Lite Preview",
3517
+ id: "gemini-3.1-flash-lite",
3518
+ name: "Gemini 3.1 Flash Lite",
3351
3519
  description: "Google's fastest and most cost-efficient Gemini 3 series model, built for intelligence at scale. Optimized for high-volume, low-latency applications while maintaining strong multimodal capabilities.",
3352
3520
  match: {
3353
- starts_with: "gemini-3.1-flash-lite-preview"
3521
+ starts_with: "gemini-3.1-flash-lite"
3354
3522
  },
3355
3523
  context_window: 1e6,
3356
- price_comments: "See https://ai.google.dev/gemini-api/docs/pricing. Preview model - pricing may change before becoming stable.",
3524
+ price_comments: "See https://ai.google.dev/gemini-api/docs/pricing.",
3357
3525
  prices: {
3358
3526
  input_mtok: 0.25,
3359
3527
  cache_read_mtok: 0.025,
@@ -9343,6 +9511,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
9343
9511
  },
9344
9512
  context_window: 128e3,
9345
9513
  prices: {
9514
+ input_mtok: 2.5,
9346
9515
  output_mtok: 10,
9347
9516
  input_audio_mtok: 2.5
9348
9517
  }
@@ -9393,6 +9562,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
9393
9562
  starts_with: "gpt-4o-mini-audio"
9394
9563
  },
9395
9564
  prices: {
9565
+ input_mtok: 0.15,
9396
9566
  output_mtok: 0.6,
9397
9567
  input_audio_mtok: 0.15
9398
9568
  }
@@ -9429,6 +9599,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
9429
9599
  },
9430
9600
  prices: {
9431
9601
  input_mtok: 0.6,
9602
+ output_mtok: 12,
9432
9603
  output_audio_mtok: 12
9433
9604
  }
9434
9605
  },
@@ -9753,6 +9924,39 @@ Compared to other leading proprietary and open-weights models Command A delivers
9753
9924
  output_mtok: 168
9754
9925
  }
9755
9926
  },
9927
+ {
9928
+ id: "gpt-5.3",
9929
+ name: "GPT-5.3 Chat",
9930
+ description: "GPT-5.3 Instant model used in ChatGPT",
9931
+ match: {
9932
+ or: [
9933
+ {
9934
+ equals: "gpt-5.3"
9935
+ },
9936
+ {
9937
+ equals: "gpt-5-3"
9938
+ },
9939
+ {
9940
+ equals: "gpt-5.3-chat"
9941
+ },
9942
+ {
9943
+ equals: "gpt-5.3-chat-latest"
9944
+ },
9945
+ {
9946
+ equals: "gpt-5-3-chat"
9947
+ },
9948
+ {
9949
+ equals: "gpt-5-3-chat-latest"
9950
+ }
9951
+ ]
9952
+ },
9953
+ context_window: 128e3,
9954
+ prices: {
9955
+ input_mtok: 1.75,
9956
+ cache_read_mtok: 0.175,
9957
+ output_mtok: 14
9958
+ }
9959
+ },
9756
9960
  {
9757
9961
  id: "gpt-5.3-codex",
9758
9962
  name: "GPT-5.3-Codex",
@@ -9921,6 +10125,83 @@ Compared to other leading proprietary and open-weights models Command A delivers
9921
10125
  }
9922
10126
  }
9923
10127
  },
10128
+ {
10129
+ id: "gpt-5.5",
10130
+ name: "GPT-5.5",
10131
+ description: "The best model for coding and agentic tasks across industries",
10132
+ match: {
10133
+ or: [
10134
+ {
10135
+ equals: "gpt-5.5"
10136
+ },
10137
+ {
10138
+ equals: "gpt-5.5-2026-04-23"
10139
+ },
10140
+ {
10141
+ equals: "gpt-5.5-2026-04-24"
10142
+ },
10143
+ {
10144
+ equals: "gpt-5-5"
10145
+ },
10146
+ {
10147
+ equals: "gpt-5-5-2026-04-23"
10148
+ },
10149
+ {
10150
+ equals: "gpt-5-5-2026-04-24"
10151
+ },
10152
+ {
10153
+ equals: "gpt-5.5-chat"
10154
+ },
10155
+ {
10156
+ equals: "gpt-5.5-chat-latest"
10157
+ },
10158
+ {
10159
+ equals: "gpt-5-5-chat"
10160
+ },
10161
+ {
10162
+ equals: "gpt-5-5-chat-latest"
10163
+ },
10164
+ {
10165
+ equals: "gpt-5.5-codex"
10166
+ },
10167
+ {
10168
+ equals: "gpt-5-5-codex"
10169
+ }
10170
+ ]
10171
+ },
10172
+ context_window: 1e6,
10173
+ prices: {
10174
+ input_mtok: 5,
10175
+ cache_read_mtok: 0.5,
10176
+ output_mtok: 30
10177
+ }
10178
+ },
10179
+ {
10180
+ id: "gpt-5.5-pro",
10181
+ name: "GPT-5.5 Pro",
10182
+ description: "Version of GPT-5.5 that produces smarter and more precise responses.",
10183
+ match: {
10184
+ or: [
10185
+ {
10186
+ equals: "gpt-5.5-pro"
10187
+ },
10188
+ {
10189
+ equals: "gpt-5.5-pro-2026-04-23"
10190
+ },
10191
+ {
10192
+ equals: "gpt-5-5-pro"
10193
+ },
10194
+ {
10195
+ equals: "gpt-5-5-pro-2026-04-23"
10196
+ }
10197
+ ]
10198
+ },
10199
+ context_window: 1e6,
10200
+ prices: {
10201
+ input_mtok: 30,
10202
+ output_mtok: 180
10203
+ }
10204
+ },
9924
10205
  {
9925
10206
  id: "gpt-realtime",
9926
10207
  match: {
@@ -10242,6 +10523,45 @@ Compared to other leading proprietary and open-weights models Command A delivers
10242
10523
  name: "OpenRouter",
10243
10524
  pricing_urls: ["https://openrouter.ai/models"],
10244
10525
  api_pattern: "https://(api\\.)?openrouter\\.ai",
10526
+ extractors: [
10527
+ {
10528
+ api_flavor: "chat",
10529
+ root: "usage",
10530
+ model_path: "model",
10531
+ mappings: [
10532
+ {
10533
+ path: "prompt_tokens",
10534
+ dest: "input_tokens",
10535
+ required: !0
10536
+ },
10537
+ {
10538
+ path: ["prompt_tokens_details", "cached_tokens"],
10539
+ dest: "cache_read_tokens",
10540
+ required: !1
10541
+ },
10542
+ {
10543
+ path: ["prompt_tokens_details", "cache_write_tokens"],
10544
+ dest: "cache_write_tokens",
10545
+ required: !1
10546
+ },
10547
+ {
10548
+ path: ["prompt_tokens_details", "audio_tokens"],
10549
+ dest: "input_audio_tokens",
10550
+ required: !1
10551
+ },
10552
+ {
10553
+ path: ["completion_tokens_details", "audio_tokens"],
10554
+ dest: "output_audio_tokens",
10555
+ required: !1
10556
+ },
10557
+ {
10558
+ path: "completion_tokens",
10559
+ dest: "output_tokens",
10560
+ required: !0
10561
+ }
10562
+ ]
10563
+ }
10564
+ ],
10245
10565
  models: [
10246
10566
  {
10247
10567
  id: "01-ai/yi-large",
@@ -10633,6 +10953,18 @@ Compared to other leading proprietary and open-weights models Command A delivers
10633
10953
  {
10634
10954
  equals: "anthropic/claude-haiku-4.5"
10635
10955
  },
10956
+ {
10957
+ equals: "anthropic/claude-4.5-haiku-20251001"
10958
+ },
10959
+ {
10960
+ equals: "anthropic/claude-4.5-haiku-20251001:beta"
10961
+ },
10962
+ {
10963
+ equals: "anthropic/claude-haiku-4.5-20251001"
10964
+ },
10965
+ {
10966
+ equals: "anthropic/claude-haiku-4.5-20251001:beta"
10967
+ },
10636
10968
  {
10637
10969
  equals: "anthropic/claude-haiku-4.5:beta"
10638
10970
  }
@@ -10652,6 +10984,18 @@ Compared to other leading proprietary and open-weights models Command A delivers
10652
10984
  {
10653
10985
  equals: "anthropic/claude-opus-4.5"
10654
10986
  },
10987
+ {
10988
+ equals: "anthropic/claude-4.5-opus-20251124"
10989
+ },
10990
+ {
10991
+ equals: "anthropic/claude-4.5-opus-20251124:beta"
10992
+ },
10993
+ {
10994
+ equals: "anthropic/claude-opus-4.5-20251124"
10995
+ },
10996
+ {
10997
+ equals: "anthropic/claude-opus-4.5-20251124:beta"
10998
+ },
10655
10999
  {
10656
11000
  equals: "anthropic/claude-opus-4.5:beta"
10657
11001
  }
@@ -10671,48 +11015,51 @@ Compared to other leading proprietary and open-weights models Command A delivers
10671
11015
  {
10672
11016
  equals: "anthropic/claude-opus-4.6"
10673
11017
  },
11018
+ {
11019
+ equals: "anthropic/claude-4.6-opus-20260205"
11020
+ },
11021
+ {
11022
+ equals: "anthropic/claude-4.6-opus-20260205:beta"
11023
+ },
11024
+ {
11025
+ equals: "anthropic/claude-opus-4.6-20260205"
11026
+ },
11027
+ {
11028
+ equals: "anthropic/claude-opus-4.6-20260205:beta"
11029
+ },
10674
11030
  {
10675
11031
  equals: "anthropic/claude-opus-4.6:beta"
10676
11032
  }
10677
11033
  ]
10678
11034
  },
11035
+ context_window: 1e6,
11036
+ 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",
10679
11037
  prices: {
10680
- input_mtok: {
10681
- base: 5,
10682
- tiers: [
10683
- {
10684
- start: 2e5,
10685
- price: 10
10686
- }
10687
- ]
10688
- },
10689
- cache_write_mtok: {
10690
- base: 6.25,
10691
- tiers: [
10692
- {
10693
- start: 2e5,
10694
- price: 12.5
10695
- }
10696
- ]
10697
- },
10698
- cache_read_mtok: {
10699
- base: 0.5,
10700
- tiers: [
10701
- {
10702
- start: 2e5,
10703
- price: 1
10704
- }
10705
- ]
10706
- },
10707
- output_mtok: {
10708
- base: 25,
10709
- tiers: [
10710
- {
10711
- start: 2e5,
10712
- price: 37.5
10713
- }
10714
- ]
10715
- }
11038
+ input_mtok: 5,
11039
+ cache_write_mtok: 6.25,
11040
+ cache_read_mtok: 0.5,
11041
+ output_mtok: 25
11042
+ }
11043
+ },
11044
+ {
11045
+ id: "anthropic/claude-opus-4.7",
11046
+ match: {
11047
+ or: [
11048
+ {
11049
+ equals: "anthropic/claude-opus-4.7"
11050
+ },
11051
+ {
11052
+ equals: "anthropic/claude-opus-4.7:beta"
11053
+ }
11054
+ ]
11055
+ },
11056
+ context_window: 1e6,
11057
+ 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",
11058
+ prices: {
11059
+ input_mtok: 5,
11060
+ cache_write_mtok: 6.25,
11061
+ cache_read_mtok: 0.5,
11062
+ output_mtok: 25
10716
11063
  }
10717
11064
  },
10718
11065
  {
@@ -10722,12 +11069,25 @@ Compared to other leading proprietary and open-weights models Command A delivers
10722
11069
  {
10723
11070
  equals: "anthropic/claude-sonnet-4.5"
10724
11071
  },
11072
+ {
11073
+ equals: "anthropic/claude-4.5-sonnet-20250929"
11074
+ },
11075
+ {
11076
+ equals: "anthropic/claude-4.5-sonnet-20250929:beta"
11077
+ },
11078
+ {
11079
+ equals: "anthropic/claude-sonnet-4.5-20250929"
11080
+ },
11081
+ {
11082
+ equals: "anthropic/claude-sonnet-4.5-20250929:beta"
11083
+ },
10725
11084
  {
10726
11085
  equals: "anthropic/claude-sonnet-4.5:beta"
10727
11086
  }
10728
11087
  ]
10729
11088
  },
10730
11089
  context_window: 1e6,
11090
+ price_comments: "Tiered pricing: Unlike 4.6 models, Sonnet 4.5 has long-context surcharge. Ref: https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing",
10731
11091
  prices: {
10732
11092
  input_mtok: {
10733
11093
  base: 3,
@@ -10774,11 +11134,25 @@ Compared to other leading proprietary and open-weights models Command A delivers
10774
11134
  {
10775
11135
  equals: "anthropic/claude-sonnet-4.6"
10776
11136
  },
11137
+ {
11138
+ equals: "anthropic/claude-4.6-sonnet-20260217"
11139
+ },
11140
+ {
11141
+ equals: "anthropic/claude-4.6-sonnet-20260217:beta"
11142
+ },
11143
+ {
11144
+ equals: "anthropic/claude-sonnet-4.6-20260217"
11145
+ },
11146
+ {
11147
+ equals: "anthropic/claude-sonnet-4.6-20260217:beta"
11148
+ },
10777
11149
  {
10778
11150
  equals: "anthropic/claude-sonnet-4.6:beta"
10779
11151
  }
10780
11152
  ]
10781
11153
  },
11154
+ context_window: 1e6,
11155
+ 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",
10782
11156
  prices: {
10783
11157
  input_mtok: 3,
10784
11158
  cache_write_mtok: 3.75,
@@ -11677,6 +12051,19 @@ Compared to other leading proprietary and open-weights models Command A delivers
11677
12051
  },
11678
12052
  prices: {}
11679
12053
  },
12054
+ {
12055
+ id: "deepseek/deepseek-v3.2",
12056
+ name: "DeepSeek V3.2",
12057
+ match: {
12058
+ equals: "deepseek/deepseek-v3.2"
12059
+ },
12060
+ context_window: 131072,
12061
+ prices: {
12062
+ input_mtok: 0.252,
12063
+ cache_read_mtok: 0.0252,
12064
+ output_mtok: 0.378
12065
+ }
12066
+ },
11680
12067
  {
11681
12068
  id: "deepseek/deepseek-v3.2-exp",
11682
12069
  name: "DeepSeek V3.2 Experimental",
@@ -18201,6 +18588,30 @@ Compared to other leading proprietary and open-weights models Command A delivers
18201
18588
  output_mtok: 0.5
18202
18589
  }
18203
18590
  },
18591
+ {
18592
+ id: "grok-4.3",
18593
+ name: "Grok 4.3",
18594
+ description: "Most advanced flagship model, leading the industry in non-hallucination rate, agentic tool calling, and instruction following capabilities. Supports text and image inputs with text outputs, function calling, structured outputs, and reasoning.",
18595
+ match: {
18596
+ or: [
18597
+ {
18598
+ equals: "grok-4.3"
18599
+ },
18600
+ {
18601
+ equals: "grok-4.3-latest"
18602
+ },
18603
+ {
18604
+ equals: "grok-latest"
18605
+ }
18606
+ ]
18607
+ },
18608
+ context_window: 1e6,
18609
+ prices: {
18610
+ input_mtok: 1.25,
18611
+ cache_read_mtok: 0.2,
18612
+ output_mtok: 2.5
18613
+ }
18614
+ },
18204
18615
  {
18205
18616
  id: "grok-code-fast-1",
18206
18617
  name: "Grok Code Fast 1",
@@ -18228,243 +18639,244 @@ Compared to other leading proprietary and open-weights models Command A delivers
18228
18639
  ]
18229
18640
  }
18230
18641
  ];
18231
- function L(e, t, i) {
18232
- if (t <= 0) return 0;
18233
- let a = e.base;
18234
- for (const o of e.tiers)
18642
+ function S(t, e, i) {
18643
+ if (e <= 0) return 0;
18644
+ let a = t.base;
18645
+ for (const o of t.tiers)
18235
18646
  i > o.start && (a = o.price);
18236
- return a * t / 1e6;
18647
+ return a * e / 1e6;
18237
18648
  }
18238
- function l(e, t, i, a) {
18239
- return e === void 0 || t === void 0 ? 0 : typeof e == "number" ? e * t / 1e6 : L(e, t, a);
18649
+ function d(t, e, i, a) {
18650
+ return t === void 0 || e === void 0 ? 0 : typeof t == "number" ? t * e / 1e6 : S(t, e, a);
18240
18651
  }
18241
- function Q(e, t) {
18652
+ function A(t, e) {
18242
18653
  let i = 0, a = 0;
18243
- const o = e.input_tokens ?? 0, s = e.cache_read_tokens ?? 0, m = e.cache_write_tokens ?? 0, n = e.cache_audio_read_tokens ?? 0, r = e.output_audio_tokens ?? 0;
18244
- let u = e.input_audio_tokens ?? 0;
18245
- if (u -= n, u < 0)
18654
+ 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, p = t.output_audio_tokens ?? 0, u = e.cache_audio_read_mtok === void 0 ? 0 : n, c = e.cache_audio_read_mtok === void 0 && e.cache_read_mtok !== void 0 ? n : 0;
18655
+ let l = 0;
18656
+ if (e.input_audio_mtok !== void 0 && (l = s - u - c), l < 0)
18246
18657
  throw new Error("cache_audio_read_tokens cannot be greater than input_audio_tokens");
18247
- let p = e.input_tokens ?? 0;
18248
- if (p -= s, p -= m, p -= u, p < 0)
18249
- throw new Error("Uncached text input tokens cannot be negative");
18250
- let c = s;
18251
- if (c -= n, c < 0)
18658
+ let w = 0;
18659
+ if (e.cache_read_mtok !== void 0 && (w = r - u), w < 0)
18252
18660
  throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
18253
- i += l(t.input_mtok, p, "input_mtok", o), i += l(t.cache_read_mtok, c, "cache_read_mtok", o), i += l(t.cache_write_mtok, m, "cache_write_mtok", o), i += l(t.input_audio_mtok, u, "input_audio_mtok", o), i += l(t.cache_audio_read_mtok, n, "cache_audio_read_mtok", o);
18254
- let _ = e.output_tokens ?? 0;
18255
- if (_ -= r, _ < 0)
18661
+ const M = e.cache_write_mtok === void 0 ? 0 : m;
18662
+ let b = 0;
18663
+ if (e.input_mtok !== void 0 && (b = o - w - M - l - u), b < 0)
18664
+ throw new Error("Uncached text input tokens cannot be negative");
18665
+ 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, M, "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);
18666
+ let f = 0;
18667
+ if (e.output_mtok !== void 0 && (f = (t.output_tokens ?? 0) - (e.output_audio_mtok === void 0 ? 0 : p)), f < 0)
18256
18668
  throw new Error("output_audio_tokens cannot be greater than output_tokens");
18257
- a += l(t.output_mtok, _, "output_mtok", o), a += l(t.output_audio_mtok, e.output_audio_tokens, "output_audio_mtok", o);
18258
- let x = i + a;
18259
- return t.requests_kcount !== void 0 && (x += t.requests_kcount / 1e3), {
18669
+ a += d(e.output_mtok, f, "output_mtok", o), a += d(e.output_audio_mtok, t.output_audio_tokens, "output_audio_mtok", o);
18670
+ let y = i + a;
18671
+ return e.requests_kcount !== void 0 && (y += e.requests_kcount / 1e3), {
18260
18672
  input_price: i,
18261
18673
  output_price: a,
18262
- total_price: x
18674
+ total_price: y
18263
18675
  };
18264
18676
  }
18265
- function P(e, t) {
18266
- if (!Array.isArray(e.prices))
18267
- return e.prices;
18268
- for (let i = e.prices.length - 1; i >= 0; i--) {
18269
- const a = e.prices[i], o = a.constraint;
18677
+ function G(t, e) {
18678
+ if (!Array.isArray(t.prices))
18679
+ return t.prices;
18680
+ for (let i = t.prices.length - 1; i >= 0; i--) {
18681
+ const a = t.prices[i], o = a.constraint;
18270
18682
  if (o === void 0)
18271
18683
  return a.prices;
18272
18684
  if (o.type === "start_date") {
18273
- if (t >= new Date(o.start_date))
18685
+ if (e >= new Date(o.start_date))
18274
18686
  return a.prices;
18275
18687
  } else {
18276
- const s = t.toISOString().slice(11, 19), m = o.start_time, n = o.end_time;
18688
+ const r = e.toISOString().slice(11, 19), m = o.start_time, n = o.end_time;
18277
18689
  if (n < m) {
18278
- if (s >= m || s < n)
18690
+ if (r >= m || r < n)
18279
18691
  return a.prices;
18280
- } else if (s >= m && s < n)
18692
+ } else if (r >= m && r < n)
18281
18693
  return a.prices;
18282
18694
  }
18283
18695
  }
18284
- return e.prices[0].prices;
18696
+ return t.prices[0].prices;
18285
18697
  }
18286
- function g(e, t) {
18287
- return "or" in e ? e.or.some((i) => g(i, t)) : "and" in e ? e.and.every((i) => g(i, t)) : "equals" in e ? t === e.equals : "starts_with" in e ? t.startsWith(e.starts_with) : "ends_with" in e ? t.endsWith(e.ends_with) : "contains" in e ? t.includes(e.contains) : "regex" in e ? new RegExp(e.regex).test(t) : !1;
18698
+ function g(t, e) {
18699
+ 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;
18288
18700
  }
18289
- function T(e, t) {
18290
- const i = t.toLowerCase().trim(), a = e.find((o) => o.id === i);
18291
- return a || e.find((o) => o.provider_match && g(o.provider_match, i));
18701
+ function z(t, e) {
18702
+ const i = e.toLowerCase().trim(), a = t.find((o) => o.id === i);
18703
+ return a || t.find((o) => o.provider_match && g(o.provider_match, i));
18292
18704
  }
18293
- function b(e, { modelId: t, providerApiUrl: i, providerId: a }) {
18705
+ function x(t, { modelId: e, providerApiUrl: i, providerId: a }) {
18294
18706
  if (a) {
18295
- const o = T(e, a);
18707
+ const o = z(t, a);
18296
18708
  if (o || a.toLowerCase() !== "litellm")
18297
18709
  return o;
18298
18710
  }
18299
18711
  if (i)
18300
- return e.find((o) => new RegExp(o.api_pattern).test(i));
18301
- if (t)
18302
- return e.find((o) => o.model_match && g(o.model_match, t));
18712
+ return t.find((o) => new RegExp(o.api_pattern).test(i));
18713
+ if (e)
18714
+ return t.find((o) => o.model_match && g(o.model_match, e));
18303
18715
  }
18304
- function S(e, t) {
18305
- return e.find((i) => g(i.match, t));
18716
+ function R(t, e) {
18717
+ return t.find((i) => g(i.match, e));
18306
18718
  }
18307
- function M(e, t, i) {
18308
- const a = S(e.models, t);
18719
+ function P(t, e, i) {
18720
+ const a = R(t.models, e);
18309
18721
  if (a) return a;
18310
- if (e.fallback_model_providers && i)
18311
- for (const o of e.fallback_model_providers) {
18312
- const s = i.find((m) => m.id === o);
18313
- if (s) {
18314
- const m = M(s, t);
18722
+ if (t.fallback_model_providers && i)
18723
+ for (const o of t.fallback_model_providers) {
18724
+ const r = i.find((m) => m.id === o);
18725
+ if (r) {
18726
+ const m = P(r, e);
18315
18727
  if (m) return m;
18316
18728
  }
18317
18729
  }
18318
18730
  }
18319
- const A = "https://raw.githubusercontent.com/pydantic/genai-prices/main/prices/data.json";
18320
- let h = I, f = Promise.resolve(I), v = null;
18321
- function G(e) {
18322
- e !== null && ("then" in e ? (f = e, e.then((t) => {
18323
- t !== null && (h = t);
18324
- })) : (f = Promise.resolve(e), h = e));
18731
+ const C = "https://raw.githubusercontent.com/pydantic/genai-prices/main/prices/data.json";
18732
+ let h = Q, B = Promise.resolve(Q), I = null;
18733
+ function D(t) {
18734
+ t !== null && ("then" in t ? (B = t, t.then((e) => {
18735
+ e !== null && (h = e);
18736
+ })) : (B = Promise.resolve(t), h = t));
18325
18737
  }
18326
- function z(e) {
18327
- v = e;
18738
+ function N(t) {
18739
+ I = t;
18328
18740
  }
18329
- function N(e) {
18330
- e({
18331
- onCalc: z,
18332
- remoteDataUrl: A,
18333
- setProviderData: G
18741
+ function F(t) {
18742
+ t({
18743
+ onCalc: N,
18744
+ remoteDataUrl: C,
18745
+ setProviderData: D
18334
18746
  });
18335
18747
  }
18336
- function E() {
18337
- return f;
18748
+ function K() {
18749
+ return B;
18338
18750
  }
18339
- function V(e, t, i) {
18340
- v?.();
18341
- let a = t.toLowerCase().trim(), o = i?.providerId;
18751
+ function j(t, e, i) {
18752
+ I?.();
18753
+ let a = e.toLowerCase().trim(), o = i?.providerId;
18342
18754
  if (o && o.toLowerCase() === "litellm" && a.includes("/")) {
18343
- const p = a.indexOf("/"), c = a.slice(0, p), _ = a.slice(p + 1);
18344
- c && _ && b(h, { providerId: c }) && (o = c, a = _);
18755
+ const u = a.indexOf("/"), c = a.slice(0, u), l = a.slice(u + 1);
18756
+ c && l && x(h, { providerId: c }) && (o = c, a = l);
18345
18757
  }
18346
- const s = i?.provider ?? b(h, { modelId: a, providerApiUrl: i?.providerApiUrl, providerId: o });
18347
- if (!s) return null;
18348
- const m = M(s, a, h);
18758
+ const r = i?.provider ?? x(h, { modelId: a, providerApiUrl: i?.providerApiUrl, providerId: o });
18759
+ if (!r) return null;
18760
+ const m = P(r, a, h);
18349
18761
  if (!m) return null;
18350
- const n = i?.timestamp ?? /* @__PURE__ */ new Date(), r = P(m, n), u = Q(e, r);
18762
+ const n = i?.timestamp ?? /* @__PURE__ */ new Date(), s = G(m, n), p = A(t, s);
18351
18763
  return {
18352
18764
  auto_update_timestamp: void 0,
18353
18765
  model: m,
18354
- model_price: r,
18355
- provider: s,
18356
- ...u
18766
+ model_price: s,
18767
+ provider: r,
18768
+ ...p
18357
18769
  };
18358
18770
  }
18359
- function O(e) {
18360
- return v?.(), b(h, e);
18771
+ function H(t) {
18772
+ return I?.(), x(h, t);
18361
18773
  }
18362
- function F(e, t, i) {
18363
- if (i = i ?? "default", !e.extractors)
18774
+ function $(t, e, i) {
18775
+ if (i = i ?? "default", !t.extractors)
18364
18776
  throw new Error("No extraction logic defined for this provider");
18365
- const a = e.extractors.find((r) => r.api_flavor === i);
18777
+ const a = t.extractors.find((s) => s.api_flavor === i);
18366
18778
  if (!a) {
18367
- const r = e.extractors.map((u) => u.api_flavor).join(", ");
18368
- throw new Error(`Unknown apiFlavor '${i}', allowed values: ${r}`);
18779
+ const s = t.extractors.map((p) => p.api_flavor).join(", ");
18780
+ throw new Error(`Unknown apiFlavor '${i}', allowed values: ${s}`);
18369
18781
  }
18370
- if (!q.guard(t))
18371
- throw new Error(`Expected response data to be a mapping object, got ${d(t)}`);
18372
- const o = w(a.model_path, t, C, !1, []), s = y(a.root), m = w(s, t, q, !0, []), n = {};
18373
- for (const r of a.mappings) {
18374
- const u = w(r.path, m, D, r.required, s);
18375
- if (u !== null) {
18376
- const p = n[r.dest] ?? 0;
18377
- n[r.dest] = p + u;
18782
+ if (!q.guard(e))
18783
+ throw new Error(`Expected response data to be a mapping object, got ${_(e)}`);
18784
+ const o = v(a.model_path, e, V, !1, []), r = T(a.root), m = v(r, e, q, !0, []), n = {};
18785
+ for (const s of a.mappings) {
18786
+ const p = v(s.path, m, O, s.required, r);
18787
+ if (p !== null) {
18788
+ const u = n[s.dest] ?? 0;
18789
+ n[s.dest] = u + p;
18378
18790
  }
18379
18791
  }
18380
18792
  if (!Object.keys(n).length)
18381
18793
  throw new Error(`No usage information found at ${JSON.stringify(a.root)}`);
18382
18794
  return { model: o, usage: n };
18383
18795
  }
18384
- function w(e, t, i, a, o) {
18385
- const [s, ...m] = y(e).reverse();
18386
- if (typeof s != "string")
18387
- throw new Error(`Expected last step of path to be a string, got ${d(s)}`);
18796
+ function v(t, e, i, a, o) {
18797
+ const [r, ...m] = T(t).reverse();
18798
+ if (typeof r != "string")
18799
+ throw new Error(`Expected last step of path to be a string, got ${_(r)}`);
18388
18800
  m.reverse();
18389
- let n = t;
18390
- const r = [];
18391
- for (const p of m) {
18392
- if (r.push(p), typeof p == "object")
18801
+ let n = e;
18802
+ const s = [];
18803
+ for (const u of m) {
18804
+ if (s.push(u), typeof u == "object")
18393
18805
  if (Array.isArray(n))
18394
- n = R(p, n);
18806
+ n = E(u, n);
18395
18807
  else {
18396
18808
  if (a)
18397
- throw new Error(`Expected \`${k(o, r)}\` value to be a mapping, got ${d(n)}`);
18809
+ throw new Error(`Expected \`${k(o, s)}\` value to be a mapping, got ${_(n)}`);
18398
18810
  return null;
18399
18811
  }
18400
18812
  else if (q.guard(n))
18401
- n = n[p];
18813
+ n = n[u];
18402
18814
  else {
18403
18815
  if (a)
18404
- throw new Error(`Expected \`${k(o, r)}\` value to be a mapping, got ${d(n)}`);
18816
+ throw new Error(`Expected \`${k(o, s)}\` value to be a mapping, got ${_(n)}`);
18405
18817
  return null;
18406
18818
  }
18407
18819
  if (typeof n > "u")
18408
18820
  if (a) {
18409
- const c = typeof p == "object" ? "Unable to find item" : "Missing value";
18410
- throw new Error(`${c} at \`${k(o, r)}\``);
18821
+ const c = typeof u == "object" ? "Unable to find item" : "Missing value";
18822
+ throw new Error(`${c} at \`${k(o, s)}\``);
18411
18823
  } else
18412
18824
  return null;
18413
18825
  }
18414
18826
  if (!q.guard(n)) {
18415
18827
  if (a)
18416
- throw new Error(`Expected \`${k(o, r)}\` value to be a mapping, got ${d(n)}`);
18828
+ throw new Error(`Expected \`${k(o, s)}\` value to be a mapping, got ${_(n)}`);
18417
18829
  return null;
18418
18830
  }
18419
- const u = n[s];
18420
- if (typeof u > "u") {
18831
+ const p = n[r];
18832
+ if (typeof p > "u") {
18421
18833
  if (a)
18422
- throw r.push(s), new Error(`Missing value at \`${k(o, r)}\``);
18834
+ throw s.push(r), new Error(`Missing value at \`${k(o, s)}\``);
18423
18835
  return null;
18424
18836
  }
18425
- if (i.guard(u))
18426
- return u;
18837
+ if (i.guard(p))
18838
+ return p;
18427
18839
  if (a)
18428
- throw r.push(s), new Error(`Expected \`${k(o, r)}\` value to be a ${i.name}, got ${d(u)}`);
18840
+ throw s.push(r), new Error(`Expected \`${k(o, s)}\` value to be a ${i.name}, got ${_(p)}`);
18429
18841
  return null;
18430
18842
  }
18431
- function R(e, t) {
18432
- for (const i of t)
18843
+ function E(t, e) {
18844
+ for (const i of e)
18433
18845
  if (q.guard(i)) {
18434
- const a = i[e.field];
18435
- if (typeof a == "string" && g(e.match, a))
18846
+ const a = i[t.field];
18847
+ if (typeof a == "string" && g(t.match, a))
18436
18848
  return i;
18437
18849
  }
18438
18850
  }
18439
- function y(e) {
18440
- return Array.isArray(e) ? [...e] : [e];
18851
+ function T(t) {
18852
+ return Array.isArray(t) ? [...t] : [t];
18441
18853
  }
18442
- function d(e) {
18443
- return e === null ? "null" : Array.isArray(e) ? "array" : typeof e == "object" ? "mapping" : typeof e;
18854
+ function _(t) {
18855
+ return t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "mapping" : typeof t;
18444
18856
  }
18445
18857
  const q = {
18446
- guard: (e) => d(e) === "mapping",
18858
+ guard: (t) => _(t) === "mapping",
18447
18859
  name: "mapping"
18448
- }, C = {
18449
- guard: (e) => typeof e == "string",
18860
+ }, V = {
18861
+ guard: (t) => typeof t == "string",
18450
18862
  name: "string"
18451
- }, D = {
18452
- guard: (e) => typeof e == "number",
18863
+ }, O = {
18864
+ guard: (t) => typeof t == "number",
18453
18865
  name: "number"
18454
- }, k = (e, t) => [...e.map(B), ...t.map(B)].join("."), B = (e) => typeof e == "string" ? e : JSON.stringify(e);
18455
- class K {
18866
+ }, k = (t, e) => [...t.map(L), ...e.map(L)].join("."), L = (t) => typeof t == "string" ? t : JSON.stringify(t);
18867
+ class U {
18456
18868
  base;
18457
18869
  tiers;
18458
- constructor(t) {
18459
- this.base = t.base, this.tiers = [...t.tiers].sort((i, a) => i.start - a.start);
18870
+ constructor(e) {
18871
+ this.base = e.base, this.tiers = [...e.tiers].sort((i, a) => i.start - a.start);
18460
18872
  }
18461
18873
  }
18462
18874
  export {
18463
- A as REMOTE_DATA_JSON_URL,
18464
- K as TieredPrices,
18465
- V as calcPrice,
18466
- F as extractUsage,
18467
- O as findProvider,
18468
- N as updatePrices,
18469
- E as waitForUpdate
18875
+ C as REMOTE_DATA_JSON_URL,
18876
+ U as TieredPrices,
18877
+ j as calcPrice,
18878
+ $ as extractUsage,
18879
+ H as findProvider,
18880
+ F as updatePrices,
18881
+ K as waitForUpdate
18470
18882
  };