@pydantic/genai-prices 0.0.48 → 0.0.50

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 x = [
1
+ const B = [
2
2
  {
3
3
  id: "anthropic",
4
4
  name: "Anthropic",
@@ -912,6 +912,17 @@ const x = [
912
912
  output_mtok: 0.6
913
913
  }
914
914
  },
915
+ {
916
+ id: "qwen.qwen3-coder-480b-a35b-v1:0",
917
+ name: "Qwen3-Coder-480B-A35B-Instruct",
918
+ match: {
919
+ contains: "qwen.qwen3-coder-480b-a35b-v1"
920
+ },
921
+ prices: {
922
+ input_mtok: 0.45,
923
+ output_mtok: 1.8
924
+ }
925
+ },
915
926
  {
916
927
  id: "regional.anthropic.claude-3-5-haiku-20241022-v1:0",
917
928
  match: {
@@ -3227,6 +3238,51 @@ Compared to other leading proprietary and open-weights models Command A delivers
3227
3238
  }
3228
3239
  }
3229
3240
  },
3241
+ {
3242
+ id: "gemini-3-flash-preview",
3243
+ name: "Gemini 3 Flash Preview",
3244
+ description: "Google's ultra-fast frontier model optimized for speed and efficiency. Delivers state-of-the-art performance while maintaining low latency and cost, with improved reasoning and coding capabilities.",
3245
+ match: {
3246
+ or: [
3247
+ {
3248
+ equals: "gemini-3-flash-preview"
3249
+ },
3250
+ {
3251
+ starts_with: "gemini-3-flash-preview-"
3252
+ }
3253
+ ]
3254
+ },
3255
+ context_window: 1e6,
3256
+ price_comments: "See https://ai.google.dev/gemini-api/docs/pricing. Standard pricing shown; Batch API offers 50% discount on input/output.",
3257
+ prices: {
3258
+ input_mtok: 0.5,
3259
+ cache_read_mtok: 0.05,
3260
+ output_mtok: 3,
3261
+ input_audio_mtok: 1,
3262
+ cache_audio_read_mtok: 0.1
3263
+ }
3264
+ },
3265
+ {
3266
+ id: "gemini-3-pro-image-preview",
3267
+ name: "Gemini 3 Pro Image Preview",
3268
+ description: "Google's image generation model optimized for high-quality image generation. Supports 1K/2K and 4K resolution outputs with flexible pricing based on image dimensions.",
3269
+ match: {
3270
+ or: [
3271
+ {
3272
+ starts_with: "gemini-3-pro-image-preview"
3273
+ },
3274
+ {
3275
+ equals: "gemini-3-pro-image-preview"
3276
+ }
3277
+ ]
3278
+ },
3279
+ context_window: 1e6,
3280
+ price_comments: "See https://ai.google.dev/gemini-api/docs/pricing#gemini-3-pro-image. Image output is priced at $120 per 1M tokens, with each 1K/2K image = 1120 tokens = $0.134/image and each 4K image = 2000 tokens = $0.24/image.",
3281
+ prices: {
3282
+ input_mtok: 2,
3283
+ output_mtok: 120
3284
+ }
3285
+ },
3230
3286
  {
3231
3287
  id: "gemini-3-pro-preview",
3232
3288
  name: "Gemini 3 Pro Preview",
@@ -3237,7 +3293,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
3237
3293
  starts_with: "gemini-3-pro-preview"
3238
3294
  },
3239
3295
  {
3240
- starts_with: "gemini-3-pro-image-preview"
3296
+ equals: "gemini-3-pro-text-preview"
3241
3297
  }
3242
3298
  ]
3243
3299
  },
@@ -4091,41 +4147,22 @@ Compared to other leading proprietary and open-weights models Command A delivers
4091
4147
  }
4092
4148
  },
4093
4149
  {
4094
- id: "Qwen/Qwen3-Coder-480B-A35B-Instruct",
4095
- name: "Qwen3-Coder-480B-A35B-Instruct",
4096
- match: {
4097
- or: [
4098
- {
4099
- equals: "qwen/qwen3-coder-480b-a35b-instruct"
4100
- },
4101
- {
4102
- equals: "qwen/qwen3-coder-480b-a35b-instruct-fast"
4103
- }
4104
- ]
4105
- },
4106
- context_window: 262144,
4107
- prices: {
4108
- input_mtok: 0.45,
4109
- output_mtok: 1.8
4110
- }
4111
- },
4112
- {
4113
- id: "SentientAGI/Dobby-Unhinged-Llama-3.3-70B",
4114
- name: "Dobby-Unhinged-Llama-3.3-70B",
4150
+ id: "deepseek-ai/DeepSeek-R1-0528",
4151
+ name: "DeepSeek-R1-0528",
4115
4152
  match: {
4116
4153
  or: [
4117
4154
  {
4118
- equals: "sentientagi/dobby-unhinged-llama-3.3-70b"
4155
+ equals: "deepseek-ai/deepseek-r1-0528"
4119
4156
  },
4120
4157
  {
4121
- equals: "sentientagi/dobby-unhinged-llama-3.3-70b-fast"
4158
+ equals: "deepseek-ai/deepseek-r1-0528-fast"
4122
4159
  }
4123
4160
  ]
4124
4161
  },
4125
- context_window: 131072,
4162
+ context_window: 163840,
4126
4163
  prices: {
4127
- input_mtok: 0.9,
4128
- output_mtok: 0.9
4164
+ input_mtok: 3,
4165
+ output_mtok: 8
4129
4166
  }
4130
4167
  },
4131
4168
  {
@@ -5548,8 +5585,8 @@ Compared to other leading proprietary and open-weights models Command A delivers
5548
5585
  },
5549
5586
  context_window: 262144,
5550
5587
  prices: {
5551
- input_mtok: 0.29,
5552
- output_mtok: 1.2
5588
+ input_mtok: 0.3,
5589
+ output_mtok: 1.3
5553
5590
  }
5554
5591
  },
5555
5592
  {
@@ -5919,25 +5956,6 @@ Compared to other leading proprietary and open-weights models Command A delivers
5919
5956
  output_mtok: 0.072
5920
5957
  }
5921
5958
  },
5922
- {
5923
- id: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
5924
- name: "DeepSeek-R1-Distill-Llama-70B",
5925
- match: {
5926
- or: [
5927
- {
5928
- equals: "deepseek-ai/deepseek-r1-distill-llama-70b"
5929
- },
5930
- {
5931
- equals: "deepseek-ai/deepseek-r1-distill-llama-70b-fast"
5932
- }
5933
- ]
5934
- },
5935
- context_window: 8192,
5936
- prices: {
5937
- input_mtok: 0.64,
5938
- output_mtok: 0.64
5939
- }
5940
- },
5941
5959
  {
5942
5960
  id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B",
5943
5961
  name: "DeepSeek-R1-Distill-Qwen-14B",
@@ -6039,6 +6057,25 @@ Compared to other leading proprietary and open-weights models Command A delivers
6039
6057
  output_mtok: 0.8
6040
6058
  }
6041
6059
  },
6060
+ {
6061
+ id: "deepseek-ai/DeepSeek-V3.2",
6062
+ name: "DeepSeek-V3.2",
6063
+ match: {
6064
+ or: [
6065
+ {
6066
+ equals: "deepseek-ai/deepseek-v3.2"
6067
+ },
6068
+ {
6069
+ equals: "deepseek-ai/deepseek-v3.2-fast"
6070
+ }
6071
+ ]
6072
+ },
6073
+ context_window: 163840,
6074
+ prices: {
6075
+ input_mtok: 0.269,
6076
+ output_mtok: 0.4
6077
+ }
6078
+ },
6042
6079
  {
6043
6080
  id: "deepseek-ai/DeepSeek-V3.2-Exp",
6044
6081
  name: "DeepSeek-V3.2-Exp",
@@ -6111,8 +6148,8 @@ Compared to other leading proprietary and open-weights models Command A delivers
6111
6148
  },
6112
6149
  context_window: 131072,
6113
6150
  prices: {
6114
- input_mtok: 0.104,
6115
- output_mtok: 0.312
6151
+ input_mtok: 0.108,
6152
+ output_mtok: 0.32
6116
6153
  }
6117
6154
  },
6118
6155
  {
@@ -6249,22 +6286,22 @@ Compared to other leading proprietary and open-weights models Command A delivers
6249
6286
  }
6250
6287
  },
6251
6288
  {
6252
- id: "zai-org/GLM-4-32B-0414",
6253
- name: "GLM-4-32B-0414",
6289
+ id: "zai-org/AutoGLM-Phone-9B-Multilingual",
6290
+ name: "AutoGLM-Phone-9B-Multilingual",
6254
6291
  match: {
6255
6292
  or: [
6256
6293
  {
6257
- equals: "zai-org/glm-4-32b-0414"
6294
+ equals: "zai-org/autoglm-phone-9b-multilingual"
6258
6295
  },
6259
6296
  {
6260
- equals: "zai-org/glm-4-32b-0414-fast"
6297
+ equals: "zai-org/autoglm-phone-9b-multilingual-fast"
6261
6298
  }
6262
6299
  ]
6263
6300
  },
6264
- context_window: 32e3,
6301
+ context_window: 65536,
6265
6302
  prices: {
6266
- input_mtok: 0.55,
6267
- output_mtok: 1.66
6303
+ input_mtok: 0.035,
6304
+ output_mtok: 0.138
6268
6305
  }
6269
6306
  },
6270
6307
  {
@@ -6361,6 +6398,25 @@ Compared to other leading proprietary and open-weights models Command A delivers
6361
6398
  input_mtok: 0.44,
6362
6399
  output_mtok: 1.76
6363
6400
  }
6401
+ },
6402
+ {
6403
+ id: "zai-org/GLM-4.6V-Flash",
6404
+ name: "GLM-4.6V-Flash",
6405
+ match: {
6406
+ or: [
6407
+ {
6408
+ equals: "zai-org/glm-4.6v-flash"
6409
+ },
6410
+ {
6411
+ equals: "zai-org/glm-4.6v-flash-fast"
6412
+ }
6413
+ ]
6414
+ },
6415
+ context_window: 131072,
6416
+ prices: {
6417
+ input_mtok: 0.3,
6418
+ output_mtok: 0.9
6419
+ }
6364
6420
  }
6365
6421
  ]
6366
6422
  },
@@ -6803,17 +6859,17 @@ Compared to other leading proprietary and open-weights models Command A delivers
6803
6859
  ]
6804
6860
  },
6805
6861
  {
6806
- id: "huggingface_publicai",
6807
- name: "HuggingFace (publicai)",
6862
+ id: "huggingface_ovhcloud",
6863
+ name: "HuggingFace (ovhcloud)",
6808
6864
  pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
6809
- api_pattern: "https://router\\.huggingface\\.co/publicai",
6865
+ api_pattern: "https://router\\.huggingface\\.co/ovhcloud",
6810
6866
  provider_match: {
6811
6867
  and: [
6812
6868
  {
6813
6869
  contains: "huggingface"
6814
6870
  },
6815
6871
  {
6816
- contains: "publicai"
6872
+ contains: "ovhcloud"
6817
6873
  }
6818
6874
  ]
6819
6875
  },
@@ -6853,109 +6909,57 @@ Compared to other leading proprietary and open-weights models Command A delivers
6853
6909
  ],
6854
6910
  models: [
6855
6911
  {
6856
- id: "aisingapore/Gemma-SEA-LION-v4-27B-IT",
6857
- name: "Gemma-SEA-LION-v4-27B-IT",
6858
- match: {
6859
- or: [
6860
- {
6861
- equals: "aisingapore/gemma-sea-lion-v4-27b-it"
6862
- },
6863
- {
6864
- equals: "aisingapore/gemma-sea-lion-v4-27b-it-fast"
6865
- }
6866
- ]
6867
- },
6868
- prices: {}
6869
- },
6870
- {
6871
- id: "aisingapore/Qwen-SEA-LION-v4-32B-IT",
6872
- name: "Qwen-SEA-LION-v4-32B-IT",
6873
- match: {
6874
- or: [
6875
- {
6876
- equals: "aisingapore/qwen-sea-lion-v4-32b-it"
6877
- },
6878
- {
6879
- equals: "aisingapore/qwen-sea-lion-v4-32b-it-fast"
6880
- }
6881
- ]
6882
- },
6883
- prices: {}
6884
- },
6885
- {
6886
- id: "allenai/Olmo-3-32B-Think",
6887
- name: "Olmo-3-32B-Think",
6888
- match: {
6889
- or: [
6890
- {
6891
- equals: "allenai/olmo-3-32b-think"
6892
- },
6893
- {
6894
- equals: "allenai/olmo-3-32b-think-fast"
6895
- }
6896
- ]
6897
- },
6898
- prices: {}
6899
- },
6900
- {
6901
- id: "allenai/Olmo-3-7B-Instruct",
6902
- name: "Olmo-3-7B-Instruct",
6903
- match: {
6904
- or: [
6905
- {
6906
- equals: "allenai/olmo-3-7b-instruct"
6907
- },
6908
- {
6909
- equals: "allenai/olmo-3-7b-instruct-fast"
6910
- }
6911
- ]
6912
- },
6913
- prices: {}
6914
- },
6915
- {
6916
- id: "allenai/Olmo-3-7B-Think",
6917
- name: "Olmo-3-7B-Think",
6912
+ id: "Qwen/Qwen2.5-VL-72B-Instruct",
6913
+ name: "Qwen2.5-VL-72B-Instruct",
6918
6914
  match: {
6919
6915
  or: [
6920
6916
  {
6921
- equals: "allenai/olmo-3-7b-think"
6917
+ equals: "qwen/qwen2.5-vl-72b-instruct"
6922
6918
  },
6923
6919
  {
6924
- equals: "allenai/olmo-3-7b-think-fast"
6920
+ equals: "qwen/qwen2.5-vl-72b-instruct-fast"
6925
6921
  }
6926
6922
  ]
6927
6923
  },
6928
- prices: {}
6924
+ context_window: 32768,
6925
+ prices: {
6926
+ input_mtok: 1.01,
6927
+ output_mtok: 1.01
6928
+ }
6929
6929
  },
6930
6930
  {
6931
- id: "swiss-ai/Apertus-8B-Instruct-2509",
6932
- name: "Apertus-8B-Instruct-2509",
6931
+ id: "Qwen/Qwen3-Coder-30B-A3B-Instruct",
6932
+ name: "Qwen3-Coder-30B-A3B-Instruct",
6933
6933
  match: {
6934
6934
  or: [
6935
6935
  {
6936
- equals: "swiss-ai/apertus-8b-instruct-2509"
6936
+ equals: "qwen/qwen3-coder-30b-a3b-instruct"
6937
6937
  },
6938
6938
  {
6939
- equals: "swiss-ai/apertus-8b-instruct-2509-fast"
6939
+ equals: "qwen/qwen3-coder-30b-a3b-instruct-fast"
6940
6940
  }
6941
6941
  ]
6942
6942
  },
6943
- prices: {}
6943
+ context_window: 262144,
6944
+ prices: {
6945
+ input_mtok: 0.07,
6946
+ output_mtok: 0.26
6947
+ }
6944
6948
  }
6945
6949
  ]
6946
6950
  },
6947
6951
  {
6948
- id: "huggingface_sambanova",
6949
- name: "HuggingFace (sambanova)",
6952
+ id: "huggingface_publicai",
6953
+ name: "HuggingFace (publicai)",
6950
6954
  pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
6951
- api_pattern: "https://router\\.huggingface\\.co/sambanova",
6955
+ api_pattern: "https://router\\.huggingface\\.co/publicai",
6952
6956
  provider_match: {
6953
6957
  and: [
6954
6958
  {
6955
6959
  contains: "huggingface"
6956
6960
  },
6957
6961
  {
6958
- contains: "sambanova"
6962
+ contains: "publicai"
6959
6963
  }
6960
6964
  ]
6961
6965
  },
@@ -6995,50 +6999,252 @@ Compared to other leading proprietary and open-weights models Command A delivers
6995
6999
  ],
6996
7000
  models: [
6997
7001
  {
6998
- id: "Qwen/Qwen3-32B",
6999
- name: "Qwen3-32B",
7002
+ id: "aisingapore/Gemma-SEA-LION-v4-27B-IT",
7003
+ name: "Gemma-SEA-LION-v4-27B-IT",
7000
7004
  match: {
7001
7005
  or: [
7002
7006
  {
7003
- equals: "qwen/qwen3-32b"
7007
+ equals: "aisingapore/gemma-sea-lion-v4-27b-it"
7004
7008
  },
7005
7009
  {
7006
- equals: "qwen/qwen3-32b-fast"
7010
+ equals: "aisingapore/gemma-sea-lion-v4-27b-it-fast"
7007
7011
  }
7008
7012
  ]
7009
7013
  },
7010
- context_window: 32768,
7011
- prices: {
7012
- input_mtok: 0.4,
7013
- output_mtok: 0.8
7014
- }
7014
+ prices: {}
7015
7015
  },
7016
7016
  {
7017
- id: "deepseek-ai/DeepSeek-R1-0528",
7018
- name: "DeepSeek-R1-0528",
7017
+ id: "aisingapore/Qwen-SEA-LION-v4-32B-IT",
7018
+ name: "Qwen-SEA-LION-v4-32B-IT",
7019
7019
  match: {
7020
7020
  or: [
7021
7021
  {
7022
- equals: "deepseek-ai/deepseek-r1-0528"
7022
+ equals: "aisingapore/qwen-sea-lion-v4-32b-it"
7023
7023
  },
7024
7024
  {
7025
- equals: "deepseek-ai/deepseek-r1-0528-fast"
7025
+ equals: "aisingapore/qwen-sea-lion-v4-32b-it-fast"
7026
7026
  }
7027
7027
  ]
7028
7028
  },
7029
- context_window: 131072,
7030
- prices: {
7031
- input_mtok: 5,
7032
- output_mtok: 7
7033
- }
7029
+ prices: {}
7034
7030
  },
7035
7031
  {
7036
- id: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
7037
- name: "DeepSeek-R1-Distill-Llama-70B",
7032
+ id: "allenai/Olmo-3-7B-Instruct",
7033
+ name: "Olmo-3-7B-Instruct",
7038
7034
  match: {
7039
7035
  or: [
7040
7036
  {
7041
- equals: "deepseek-ai/deepseek-r1-distill-llama-70b"
7037
+ equals: "allenai/olmo-3-7b-instruct"
7038
+ },
7039
+ {
7040
+ equals: "allenai/olmo-3-7b-instruct-fast"
7041
+ }
7042
+ ]
7043
+ },
7044
+ prices: {}
7045
+ },
7046
+ {
7047
+ id: "allenai/Olmo-3-7B-Think",
7048
+ name: "Olmo-3-7B-Think",
7049
+ match: {
7050
+ or: [
7051
+ {
7052
+ equals: "allenai/olmo-3-7b-think"
7053
+ },
7054
+ {
7055
+ equals: "allenai/olmo-3-7b-think-fast"
7056
+ }
7057
+ ]
7058
+ },
7059
+ prices: {}
7060
+ },
7061
+ {
7062
+ id: "allenai/Olmo-3.1-32B-Instruct",
7063
+ name: "Olmo-3.1-32B-Instruct",
7064
+ match: {
7065
+ or: [
7066
+ {
7067
+ equals: "allenai/olmo-3.1-32b-instruct"
7068
+ },
7069
+ {
7070
+ equals: "allenai/olmo-3.1-32b-instruct-fast"
7071
+ }
7072
+ ]
7073
+ },
7074
+ prices: {}
7075
+ },
7076
+ {
7077
+ id: "allenai/Olmo-3.1-32B-Think",
7078
+ name: "Olmo-3.1-32B-Think",
7079
+ match: {
7080
+ or: [
7081
+ {
7082
+ equals: "allenai/olmo-3.1-32b-think"
7083
+ },
7084
+ {
7085
+ equals: "allenai/olmo-3.1-32b-think-fast"
7086
+ }
7087
+ ]
7088
+ },
7089
+ prices: {}
7090
+ },
7091
+ {
7092
+ id: "dicta-il/DictaLM-3.0-24B-Thinking",
7093
+ name: "DictaLM-3.0-24B-Thinking",
7094
+ match: {
7095
+ or: [
7096
+ {
7097
+ equals: "dicta-il/dictalm-3.0-24b-thinking"
7098
+ },
7099
+ {
7100
+ equals: "dicta-il/dictalm-3.0-24b-thinking-fast"
7101
+ }
7102
+ ]
7103
+ },
7104
+ prices: {}
7105
+ },
7106
+ {
7107
+ id: "swiss-ai/Apertus-70B-Instruct-2509",
7108
+ name: "Apertus-70B-Instruct-2509",
7109
+ match: {
7110
+ or: [
7111
+ {
7112
+ equals: "swiss-ai/apertus-70b-instruct-2509"
7113
+ },
7114
+ {
7115
+ equals: "swiss-ai/apertus-70b-instruct-2509-fast"
7116
+ }
7117
+ ]
7118
+ },
7119
+ prices: {}
7120
+ },
7121
+ {
7122
+ id: "swiss-ai/Apertus-8B-Instruct-2509",
7123
+ name: "Apertus-8B-Instruct-2509",
7124
+ match: {
7125
+ or: [
7126
+ {
7127
+ equals: "swiss-ai/apertus-8b-instruct-2509"
7128
+ },
7129
+ {
7130
+ equals: "swiss-ai/apertus-8b-instruct-2509-fast"
7131
+ }
7132
+ ]
7133
+ },
7134
+ prices: {}
7135
+ },
7136
+ {
7137
+ id: "utter-project/EuroLLM-22B-Instruct-2512",
7138
+ name: "EuroLLM-22B-Instruct-2512",
7139
+ match: {
7140
+ or: [
7141
+ {
7142
+ equals: "utter-project/eurollm-22b-instruct-2512"
7143
+ },
7144
+ {
7145
+ equals: "utter-project/eurollm-22b-instruct-2512-fast"
7146
+ }
7147
+ ]
7148
+ },
7149
+ prices: {}
7150
+ }
7151
+ ]
7152
+ },
7153
+ {
7154
+ id: "huggingface_sambanova",
7155
+ name: "HuggingFace (sambanova)",
7156
+ pricing_urls: ["https://router.huggingface.co/v1/models", "https://huggingface.co/inference/models"],
7157
+ api_pattern: "https://router\\.huggingface\\.co/sambanova",
7158
+ provider_match: {
7159
+ and: [
7160
+ {
7161
+ contains: "huggingface"
7162
+ },
7163
+ {
7164
+ contains: "sambanova"
7165
+ }
7166
+ ]
7167
+ },
7168
+ extractors: [
7169
+ {
7170
+ api_flavor: "chat",
7171
+ root: "usage",
7172
+ model_path: "model",
7173
+ mappings: [
7174
+ {
7175
+ path: "prompt_tokens",
7176
+ dest: "input_tokens",
7177
+ required: !0
7178
+ },
7179
+ {
7180
+ path: ["prompt_tokens_details", "cached_tokens"],
7181
+ dest: "cache_read_tokens",
7182
+ required: !1
7183
+ },
7184
+ {
7185
+ path: ["prompt_tokens_details", "audio_tokens"],
7186
+ dest: "input_audio_tokens",
7187
+ required: !1
7188
+ },
7189
+ {
7190
+ path: ["completion_tokens_details", "audio_tokens"],
7191
+ dest: "output_audio_tokens",
7192
+ required: !1
7193
+ },
7194
+ {
7195
+ path: "completion_tokens",
7196
+ dest: "output_tokens",
7197
+ required: !0
7198
+ }
7199
+ ]
7200
+ }
7201
+ ],
7202
+ models: [
7203
+ {
7204
+ id: "Qwen/Qwen3-32B",
7205
+ name: "Qwen3-32B",
7206
+ match: {
7207
+ or: [
7208
+ {
7209
+ equals: "qwen/qwen3-32b"
7210
+ },
7211
+ {
7212
+ equals: "qwen/qwen3-32b-fast"
7213
+ }
7214
+ ]
7215
+ },
7216
+ context_window: 32768,
7217
+ prices: {
7218
+ input_mtok: 0.4,
7219
+ output_mtok: 0.8
7220
+ }
7221
+ },
7222
+ {
7223
+ id: "deepseek-ai/DeepSeek-R1-0528",
7224
+ name: "DeepSeek-R1-0528",
7225
+ match: {
7226
+ or: [
7227
+ {
7228
+ equals: "deepseek-ai/deepseek-r1-0528"
7229
+ },
7230
+ {
7231
+ equals: "deepseek-ai/deepseek-r1-0528-fast"
7232
+ }
7233
+ ]
7234
+ },
7235
+ context_window: 131072,
7236
+ prices: {
7237
+ input_mtok: 5,
7238
+ output_mtok: 7
7239
+ }
7240
+ },
7241
+ {
7242
+ id: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
7243
+ name: "DeepSeek-R1-Distill-Llama-70B",
7244
+ match: {
7245
+ or: [
7246
+ {
7247
+ equals: "deepseek-ai/deepseek-r1-distill-llama-70b"
7042
7248
  },
7043
7249
  {
7044
7250
  equals: "deepseek-ai/deepseek-r1-distill-llama-70b-fast"
@@ -7051,6 +7257,25 @@ Compared to other leading proprietary and open-weights models Command A delivers
7051
7257
  output_mtok: 1.4
7052
7258
  }
7053
7259
  },
7260
+ {
7261
+ id: "deepseek-ai/DeepSeek-V3-0324",
7262
+ name: "DeepSeek-V3-0324",
7263
+ match: {
7264
+ or: [
7265
+ {
7266
+ equals: "deepseek-ai/deepseek-v3-0324"
7267
+ },
7268
+ {
7269
+ equals: "deepseek-ai/deepseek-v3-0324-fast"
7270
+ }
7271
+ ]
7272
+ },
7273
+ context_window: 131072,
7274
+ prices: {
7275
+ input_mtok: 3,
7276
+ output_mtok: 4.5
7277
+ }
7278
+ },
7054
7279
  {
7055
7280
  id: "meta-llama/Llama-3.1-8B-Instruct",
7056
7281
  name: "Llama-3.1-8B-Instruct",
@@ -7179,6 +7404,25 @@ Compared to other leading proprietary and open-weights models Command A delivers
7179
7404
  }
7180
7405
  ],
7181
7406
  models: [
7407
+ {
7408
+ id: "EssentialAI/rnj-1-instruct",
7409
+ name: "rnj-1-instruct",
7410
+ match: {
7411
+ or: [
7412
+ {
7413
+ equals: "essentialai/rnj-1-instruct"
7414
+ },
7415
+ {
7416
+ equals: "essentialai/rnj-1-instruct-fast"
7417
+ }
7418
+ ]
7419
+ },
7420
+ context_window: 32768,
7421
+ prices: {
7422
+ input_mtok: 0.15,
7423
+ output_mtok: 0.15
7424
+ }
7425
+ },
7182
7426
  {
7183
7427
  id: "Qwen/Qwen2.5-72B-Instruct",
7184
7428
  name: "Qwen2.5-72B-Instruct",
@@ -7311,6 +7555,41 @@ Compared to other leading proprietary and open-weights models Command A delivers
7311
7555
  output_mtok: 1.5
7312
7556
  }
7313
7557
  },
7558
+ {
7559
+ id: "Qwen/Qwen3-VL-32B-Instruct",
7560
+ name: "Qwen3-VL-32B-Instruct",
7561
+ match: {
7562
+ or: [
7563
+ {
7564
+ equals: "qwen/qwen3-vl-32b-instruct"
7565
+ },
7566
+ {
7567
+ equals: "qwen/qwen3-vl-32b-instruct-fast"
7568
+ }
7569
+ ]
7570
+ },
7571
+ context_window: 262144,
7572
+ prices: {
7573
+ input_mtok: 0.5,
7574
+ output_mtok: 1.5
7575
+ }
7576
+ },
7577
+ {
7578
+ id: "ServiceNow-AI/Apriel-1.6-15b-Thinker",
7579
+ name: "Apriel-1.6-15b-Thinker",
7580
+ match: {
7581
+ or: [
7582
+ {
7583
+ equals: "servicenow-ai/apriel-1.6-15b-thinker"
7584
+ },
7585
+ {
7586
+ equals: "servicenow-ai/apriel-1.6-15b-thinker-fast"
7587
+ }
7588
+ ]
7589
+ },
7590
+ context_window: 131072,
7591
+ prices: {}
7592
+ },
7314
7593
  {
7315
7594
  id: "deepcogito/cogito-671b-v2.1",
7316
7595
  name: "cogito-671b-v2.1",
@@ -15846,11 +16125,357 @@ Compared to other leading proprietary and open-weights models Command A delivers
15846
16125
  ]
15847
16126
  },
15848
16127
  {
15849
- id: "perplexity",
15850
- name: "Perplexity",
15851
- pricing_urls: ["https://docs.perplexity.ai/guides/pricing"],
15852
- api_pattern: "https://api\\.perplexity\\.ai",
15853
- price_comments: "Prices per request vary based on usage, this is not represented here, instead we just take the highest price shown for `requests_kcount`.",
16128
+ id: "ovhcloud",
16129
+ name: "OVHcloud AI Endpoints",
16130
+ pricing_urls: ["https://oai.endpoints.kepler.ai.cloud.ovh.net/v1/models"],
16131
+ api_pattern: "https://oai\\.endpoints\\.kepler\\.ai\\.cloud\\.ovh\\.net",
16132
+ extractors: [
16133
+ {
16134
+ api_flavor: "chat",
16135
+ root: "usage",
16136
+ model_path: "model",
16137
+ mappings: [
16138
+ {
16139
+ path: "prompt_tokens",
16140
+ dest: "input_tokens",
16141
+ required: !0
16142
+ },
16143
+ {
16144
+ path: ["prompt_tokens_details", "cached_tokens"],
16145
+ dest: "cache_read_tokens",
16146
+ required: !1
16147
+ },
16148
+ {
16149
+ path: ["prompt_tokens_details", "audio_tokens"],
16150
+ dest: "input_audio_tokens",
16151
+ required: !1
16152
+ },
16153
+ {
16154
+ path: ["completion_tokens_details", "audio_tokens"],
16155
+ dest: "output_audio_tokens",
16156
+ required: !1
16157
+ },
16158
+ {
16159
+ path: "completion_tokens",
16160
+ dest: "output_tokens",
16161
+ required: !0
16162
+ }
16163
+ ]
16164
+ }
16165
+ ],
16166
+ models: [
16167
+ {
16168
+ id: "BGE-M3",
16169
+ name: "BGE-M3",
16170
+ match: {
16171
+ or: [
16172
+ {
16173
+ equals: "BGE-M3"
16174
+ },
16175
+ {
16176
+ equals: "bge-m3"
16177
+ }
16178
+ ]
16179
+ },
16180
+ context_window: 8192,
16181
+ prices: {
16182
+ input_mtok: 0.01
16183
+ }
16184
+ },
16185
+ {
16186
+ id: "DeepSeek-R1-Distill-Llama-70B",
16187
+ name: "DeepSeek-R1-Distill-Llama-70B",
16188
+ match: {
16189
+ or: [
16190
+ {
16191
+ equals: "DeepSeek-R1-Distill-Llama-70B"
16192
+ },
16193
+ {
16194
+ equals: "deepseek-r1-distill-llama-70b"
16195
+ }
16196
+ ]
16197
+ },
16198
+ context_window: 131072,
16199
+ prices: {
16200
+ input_mtok: 0.74,
16201
+ output_mtok: 0.74
16202
+ }
16203
+ },
16204
+ {
16205
+ id: "Llama-3.1-8B-Instruct",
16206
+ name: "Llama-3.1-8B-Instruct",
16207
+ match: {
16208
+ or: [
16209
+ {
16210
+ equals: "Llama-3.1-8B-Instruct"
16211
+ },
16212
+ {
16213
+ equals: "llama-3.1-8b-instruct"
16214
+ }
16215
+ ]
16216
+ },
16217
+ context_window: 131072,
16218
+ prices: {
16219
+ input_mtok: 0.11,
16220
+ output_mtok: 0.11
16221
+ }
16222
+ },
16223
+ {
16224
+ id: "Meta-Llama-3_1-70B-Instruct",
16225
+ name: "Meta-Llama-3_1-70B-Instruct",
16226
+ match: {
16227
+ or: [
16228
+ {
16229
+ equals: "Meta-Llama-3_1-70B-Instruct"
16230
+ },
16231
+ {
16232
+ equals: "meta-llama-3_1-70b-instruct"
16233
+ }
16234
+ ]
16235
+ },
16236
+ context_window: 131072,
16237
+ prices: {
16238
+ input_mtok: 0.74,
16239
+ output_mtok: 0.74
16240
+ }
16241
+ },
16242
+ {
16243
+ id: "Meta-Llama-3_3-70B-Instruct",
16244
+ name: "Meta-Llama-3_3-70B-Instruct",
16245
+ match: {
16246
+ or: [
16247
+ {
16248
+ equals: "Meta-Llama-3_3-70B-Instruct"
16249
+ },
16250
+ {
16251
+ equals: "meta-llama-3_3-70b-instruct"
16252
+ }
16253
+ ]
16254
+ },
16255
+ context_window: 131072,
16256
+ prices: {
16257
+ input_mtok: 0.74,
16258
+ output_mtok: 0.74
16259
+ }
16260
+ },
16261
+ {
16262
+ id: "Mistral-7B-Instruct-v0.3",
16263
+ name: "Mistral-7B-Instruct-v0.3",
16264
+ match: {
16265
+ or: [
16266
+ {
16267
+ equals: "Mistral-7B-Instruct-v0.3"
16268
+ },
16269
+ {
16270
+ equals: "mistral-7b-instruct-v0.3"
16271
+ }
16272
+ ]
16273
+ },
16274
+ context_window: 65536,
16275
+ prices: {
16276
+ input_mtok: 0.11,
16277
+ output_mtok: 0.11
16278
+ }
16279
+ },
16280
+ {
16281
+ id: "Mistral-Nemo-Instruct-2407",
16282
+ name: "Mistral-Nemo-Instruct-2407",
16283
+ match: {
16284
+ or: [
16285
+ {
16286
+ equals: "Mistral-Nemo-Instruct-2407"
16287
+ },
16288
+ {
16289
+ equals: "mistral-nemo-instruct-2407"
16290
+ }
16291
+ ]
16292
+ },
16293
+ context_window: 65536,
16294
+ prices: {
16295
+ input_mtok: 0.14,
16296
+ output_mtok: 0.14
16297
+ }
16298
+ },
16299
+ {
16300
+ id: "Mistral-Small-3.2-24B-Instruct-2506",
16301
+ name: "Mistral-Small-3.2-24B-Instruct-2506",
16302
+ match: {
16303
+ or: [
16304
+ {
16305
+ equals: "Mistral-Small-3.2-24B-Instruct-2506"
16306
+ },
16307
+ {
16308
+ equals: "mistral-small-3.2-24b-instruct-2506"
16309
+ }
16310
+ ]
16311
+ },
16312
+ context_window: 131072,
16313
+ prices: {
16314
+ input_mtok: 0.1,
16315
+ output_mtok: 0.31
16316
+ }
16317
+ },
16318
+ {
16319
+ id: "Mixtral-8x7B-Instruct-v0.1",
16320
+ name: "Mixtral-8x7B-Instruct-v0.1",
16321
+ match: {
16322
+ or: [
16323
+ {
16324
+ equals: "Mixtral-8x7B-Instruct-v0.1"
16325
+ },
16326
+ {
16327
+ equals: "mixtral-8x7b-instruct-v0.1"
16328
+ }
16329
+ ]
16330
+ },
16331
+ context_window: 32768,
16332
+ prices: {
16333
+ input_mtok: 0.7,
16334
+ output_mtok: 0.7
16335
+ }
16336
+ },
16337
+ {
16338
+ id: "Qwen2.5-Coder-32B-Instruct",
16339
+ name: "Qwen2.5-Coder-32B-Instruct",
16340
+ match: {
16341
+ or: [
16342
+ {
16343
+ equals: "Qwen2.5-Coder-32B-Instruct"
16344
+ },
16345
+ {
16346
+ equals: "qwen2.5-coder-32b-instruct"
16347
+ }
16348
+ ]
16349
+ },
16350
+ context_window: 32768,
16351
+ prices: {
16352
+ input_mtok: 0.96,
16353
+ output_mtok: 0.96
16354
+ }
16355
+ },
16356
+ {
16357
+ id: "Qwen2.5-VL-72B-Instruct",
16358
+ name: "Qwen2.5-VL-72B-Instruct",
16359
+ match: {
16360
+ or: [
16361
+ {
16362
+ equals: "Qwen2.5-VL-72B-Instruct"
16363
+ },
16364
+ {
16365
+ equals: "qwen2.5-vl-72b-instruct"
16366
+ }
16367
+ ]
16368
+ },
16369
+ context_window: 32768,
16370
+ prices: {
16371
+ input_mtok: 1.01,
16372
+ output_mtok: 1.01
16373
+ }
16374
+ },
16375
+ {
16376
+ id: "Qwen3-32B",
16377
+ name: "Qwen3-32B",
16378
+ match: {
16379
+ or: [
16380
+ {
16381
+ equals: "Qwen3-32B"
16382
+ },
16383
+ {
16384
+ equals: "qwen3-32b"
16385
+ }
16386
+ ]
16387
+ },
16388
+ context_window: 32768,
16389
+ prices: {
16390
+ input_mtok: 0.09,
16391
+ output_mtok: 0.25
16392
+ }
16393
+ },
16394
+ {
16395
+ id: "Qwen3-Coder-30B-A3B-Instruct",
16396
+ name: "Qwen3-Coder-30B-A3B-Instruct",
16397
+ match: {
16398
+ or: [
16399
+ {
16400
+ equals: "Qwen3-Coder-30B-A3B-Instruct"
16401
+ },
16402
+ {
16403
+ equals: "qwen3-coder-30b-a3b-instruct"
16404
+ }
16405
+ ]
16406
+ },
16407
+ context_window: 262144,
16408
+ prices: {
16409
+ input_mtok: 0.07,
16410
+ output_mtok: 0.26
16411
+ }
16412
+ },
16413
+ {
16414
+ id: "bge-base-en-v1.5",
16415
+ name: "bge-base-en-v1.5",
16416
+ match: {
16417
+ equals: "bge-base-en-v1.5"
16418
+ },
16419
+ context_window: 512,
16420
+ prices: {
16421
+ input_mtok: 0.01
16422
+ }
16423
+ },
16424
+ {
16425
+ id: "bge-multilingual-gemma2",
16426
+ name: "bge-multilingual-gemma2",
16427
+ match: {
16428
+ equals: "bge-multilingual-gemma2"
16429
+ },
16430
+ context_window: 8192,
16431
+ prices: {
16432
+ input_mtok: 0.01
16433
+ }
16434
+ },
16435
+ {
16436
+ id: "gpt-oss-120b",
16437
+ name: "gpt-oss-120b",
16438
+ match: {
16439
+ equals: "gpt-oss-120b"
16440
+ },
16441
+ context_window: 131072,
16442
+ prices: {
16443
+ input_mtok: 0.09,
16444
+ output_mtok: 0.47
16445
+ }
16446
+ },
16447
+ {
16448
+ id: "gpt-oss-20b",
16449
+ name: "gpt-oss-20b",
16450
+ match: {
16451
+ equals: "gpt-oss-20b"
16452
+ },
16453
+ context_window: 131072,
16454
+ prices: {
16455
+ input_mtok: 0.05,
16456
+ output_mtok: 0.18
16457
+ }
16458
+ },
16459
+ {
16460
+ id: "llava-next-mistral-7b",
16461
+ name: "llava-next-mistral-7b",
16462
+ match: {
16463
+ equals: "llava-next-mistral-7b"
16464
+ },
16465
+ context_window: 32768,
16466
+ prices: {
16467
+ input_mtok: 0.32,
16468
+ output_mtok: 0.32
16469
+ }
16470
+ }
16471
+ ]
16472
+ },
16473
+ {
16474
+ id: "perplexity",
16475
+ name: "Perplexity",
16476
+ pricing_urls: ["https://docs.perplexity.ai/guides/pricing"],
16477
+ api_pattern: "https://api\\.perplexity\\.ai",
16478
+ price_comments: "Prices per request vary based on usage, this is not represented here, instead we just take the highest price shown for `requests_kcount`.",
15854
16479
  models: [
15855
16480
  {
15856
16481
  id: "llama-3.1-sonar-large-128k-online",
@@ -16957,49 +17582,114 @@ Compared to other leading proprietary and open-weights models Command A delivers
16957
17582
  cache_read_mtok: 0.75,
16958
17583
  output_mtok: 15
16959
17584
  }
17585
+ },
17586
+ {
17587
+ id: "grok-4-1-fast-non-reasoning",
17588
+ name: "Grok 4.1 Fast Non-Reasoning",
17589
+ description: "A frontier multimodal model optimized specifically for high-performance agentic tool calling.",
17590
+ match: {
17591
+ or: [
17592
+ {
17593
+ equals: "grok-4-1-fast-non-reasoning"
17594
+ },
17595
+ {
17596
+ equals: "grok-4-1-fast-non-reasoning-latest"
17597
+ }
17598
+ ]
17599
+ },
17600
+ context_window: 2e6,
17601
+ prices: {
17602
+ input_mtok: 0.2,
17603
+ cache_read_mtok: 0.05,
17604
+ output_mtok: 0.5
17605
+ }
17606
+ },
17607
+ {
17608
+ id: "grok-4-1-fast-reasoning",
17609
+ name: "Grok 4.1 Fast Reasoning",
17610
+ description: "A frontier multimodal model optimized specifically for high-performance agentic tool calling.",
17611
+ match: {
17612
+ or: [
17613
+ {
17614
+ equals: "grok-4-1-fast"
17615
+ },
17616
+ {
17617
+ equals: "grok-4-1-fast-reasoning"
17618
+ },
17619
+ {
17620
+ equals: "grok-4-1-fast-reasoning-latest"
17621
+ }
17622
+ ]
17623
+ },
17624
+ context_window: 2e6,
17625
+ prices: {
17626
+ input_mtok: 0.2,
17627
+ cache_read_mtok: 0.05,
17628
+ output_mtok: 0.5
17629
+ }
17630
+ },
17631
+ {
17632
+ id: "grok-code-fast-1",
17633
+ name: "Grok Code Fast 1",
17634
+ description: "A speedy and economical reasoning model that excels at agentic coding.",
17635
+ match: {
17636
+ or: [
17637
+ {
17638
+ equals: "grok-code-fast"
17639
+ },
17640
+ {
17641
+ equals: "grok-code-fast-1"
17642
+ },
17643
+ {
17644
+ equals: "grok-code-fast-1-0825"
17645
+ }
17646
+ ]
17647
+ },
17648
+ context_window: 256e3,
17649
+ prices: {
17650
+ input_mtok: 0.2,
17651
+ cache_read_mtok: 0.02,
17652
+ output_mtok: 1.5
17653
+ }
16960
17654
  }
16961
17655
  ]
16962
17656
  }
16963
17657
  ];
16964
- function y(t, e) {
17658
+ function y(t, e, a) {
16965
17659
  if (e <= 0) return 0;
16966
- let a = 0;
16967
- const i = [...t.tiers].sort((r, n) => r.start - n.start), o = i[0]?.start ?? e, m = Math.min(e, o);
16968
- a += m * t.base / 1e6;
16969
- for (let r = 0; r < i.length; r++) {
16970
- const n = i[r], s = i[r + 1]?.start ?? 1 / 0, u = Math.max(0, Math.min(e, s) - n.start);
16971
- u > 0 && (a += u * n.price / 1e6);
16972
- }
16973
- return a;
17660
+ let i = t.base;
17661
+ for (const o of t.tiers)
17662
+ a > o.start && (i = o.price);
17663
+ return i * e / 1e6;
16974
17664
  }
16975
- function c(t, e, a) {
16976
- return t === void 0 || e === void 0 ? 0 : typeof t == "number" ? t * e / 1e6 : y(t, e);
17665
+ function c(t, e, a, i) {
17666
+ return t === void 0 || e === void 0 ? 0 : typeof t == "number" ? t * e / 1e6 : y(t, e, i);
16977
17667
  }
16978
- function M(t, e) {
17668
+ function L(t, e) {
16979
17669
  let a = 0, i = 0;
16980
- const o = t.cache_read_tokens ?? 0, m = t.cache_write_tokens ?? 0, r = t.cache_audio_read_tokens ?? 0, n = t.output_audio_tokens ?? 0;
16981
- let s = t.input_audio_tokens ?? 0;
16982
- if (s -= r, s < 0)
17670
+ const o = t.input_tokens ?? 0, r = t.cache_read_tokens ?? 0, u = t.cache_write_tokens ?? 0, n = t.cache_audio_read_tokens ?? 0, s = t.output_audio_tokens ?? 0;
17671
+ let m = t.input_audio_tokens ?? 0;
17672
+ if (m -= n, m < 0)
16983
17673
  throw new Error("cache_audio_read_tokens cannot be greater than input_audio_tokens");
16984
- let u = t.input_tokens ?? 0;
16985
- if (u -= o, u -= m, u -= s, u < 0)
17674
+ let p = t.input_tokens ?? 0;
17675
+ if (p -= r, p -= u, p -= m, p < 0)
16986
17676
  throw new Error("Uncached text input tokens cannot be negative");
16987
- let p = o;
16988
- if (p -= r, p < 0)
16989
- throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
16990
- a += c(e.input_mtok, u), a += c(e.cache_read_mtok, p), a += c(e.cache_write_mtok, m), a += c(e.input_audio_mtok, s), a += c(e.cache_audio_read_mtok, r);
16991
- let k = t.output_tokens ?? 0;
17677
+ let k = r;
16992
17678
  if (k -= n, k < 0)
17679
+ throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
17680
+ a += c(e.input_mtok, p, "input_mtok", o), a += c(e.cache_read_mtok, k, "cache_read_mtok", o), a += c(e.cache_write_mtok, u, "cache_write_mtok", o), a += c(e.input_audio_mtok, m, "input_audio_mtok", o), a += c(e.cache_audio_read_mtok, n, "cache_audio_read_mtok", o);
17681
+ let q = t.output_tokens ?? 0;
17682
+ if (q -= s, q < 0)
16993
17683
  throw new Error("output_audio_tokens cannot be greater than output_tokens");
16994
- i += c(e.output_mtok, k), i += c(e.output_audio_mtok, t.output_audio_tokens);
16995
- let f = a + i;
16996
- return e.requests_kcount !== void 0 && (f += e.requests_kcount / 1e3), {
17684
+ i += c(e.output_mtok, q, "output_mtok", o), i += c(e.output_audio_mtok, t.output_audio_tokens, "output_audio_mtok", o);
17685
+ let v = a + i;
17686
+ return e.requests_kcount !== void 0 && (v += e.requests_kcount / 1e3), {
16997
17687
  input_price: a,
16998
17688
  output_price: i,
16999
- total_price: f
17689
+ total_price: v
17000
17690
  };
17001
17691
  }
17002
- function L(t, e) {
17692
+ function Q(t, e) {
17003
17693
  if (!Array.isArray(t.prices))
17004
17694
  return t.prices;
17005
17695
  for (let a = t.prices.length - 1; a >= 0; a--) {
@@ -17010,11 +17700,11 @@ function L(t, e) {
17010
17700
  if (e >= new Date(o.start_date))
17011
17701
  return i.prices;
17012
17702
  } else {
17013
- const m = e.toISOString().slice(11, 19), r = o.start_time, n = o.end_time;
17014
- if (n < r) {
17015
- if (m >= r || m < n)
17703
+ const r = e.toISOString().slice(11, 19), u = o.start_time, n = o.end_time;
17704
+ if (n < u) {
17705
+ if (r >= u || r < n)
17016
17706
  return i.prices;
17017
- } else if (m >= r && m < n)
17707
+ } else if (r >= u && r < n)
17018
17708
  return i.prices;
17019
17709
  }
17020
17710
  }
@@ -17023,92 +17713,92 @@ function L(t, e) {
17023
17713
  function _(t, e) {
17024
17714
  return "or" in t ? t.or.some((a) => _(a, e)) : "and" in t ? t.and.every((a) => _(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;
17025
17715
  }
17026
- function Q(t, e) {
17716
+ function T(t, e) {
17027
17717
  const a = e.toLowerCase().trim(), i = t.find((o) => o.id === a);
17028
17718
  return i || t.find((o) => o.provider_match && _(o.provider_match, a));
17029
17719
  }
17030
- function B(t, { modelId: e, providerApiUrl: a, providerId: i }) {
17720
+ function I(t, { modelId: e, providerApiUrl: a, providerId: i }) {
17031
17721
  if (i)
17032
- return Q(t, i);
17722
+ return T(t, i);
17033
17723
  if (a)
17034
17724
  return t.find((o) => new RegExp(o.api_pattern).test(a));
17035
17725
  if (e)
17036
17726
  return t.find((o) => o.model_match && _(o.model_match, e));
17037
17727
  }
17038
- function T(t, e) {
17728
+ function P(t, e) {
17039
17729
  return t.find((a) => _(a.match, e));
17040
17730
  }
17041
- const P = "https://raw.githubusercontent.com/pydantic/genai-prices/main/prices/data.json";
17042
- let g = x, w = Promise.resolve(x), b = null;
17043
- function S(t) {
17044
- t !== null && ("then" in t ? (w = t, t.then((e) => {
17731
+ const S = "https://raw.githubusercontent.com/pydantic/genai-prices/main/prices/data.json";
17732
+ let g = B, b = Promise.resolve(B), f = null;
17733
+ function A(t) {
17734
+ t !== null && ("then" in t ? (b = t, t.then((e) => {
17045
17735
  e !== null && (g = e);
17046
- })) : (w = Promise.resolve(t), g = t));
17736
+ })) : (b = Promise.resolve(t), g = t));
17047
17737
  }
17048
- function A(t) {
17049
- b = t;
17738
+ function G(t) {
17739
+ f = t;
17050
17740
  }
17051
- function z(t) {
17741
+ function C(t) {
17052
17742
  t({
17053
- onCalc: A,
17054
- remoteDataUrl: P,
17055
- setProviderData: S
17743
+ onCalc: G,
17744
+ remoteDataUrl: S,
17745
+ setProviderData: A
17056
17746
  });
17057
17747
  }
17058
- function C() {
17059
- return w;
17748
+ function N() {
17749
+ return b;
17060
17750
  }
17061
- function N(t, e, a) {
17062
- b?.();
17063
- const i = e.toLowerCase().trim(), o = a?.provider ?? B(g, { modelId: i, providerApiUrl: a?.providerApiUrl, providerId: a?.providerId });
17751
+ function V(t, e, a) {
17752
+ f?.();
17753
+ const i = e.toLowerCase().trim(), o = a?.provider ?? I(g, { modelId: i, providerApiUrl: a?.providerApiUrl, providerId: a?.providerId });
17064
17754
  if (!o) return null;
17065
- const m = T(o.models, i);
17066
- if (!m) return null;
17067
- const r = a?.timestamp ?? /* @__PURE__ */ new Date(), n = L(m, r), s = M(t, n);
17755
+ const r = P(o.models, i);
17756
+ if (!r) return null;
17757
+ const u = a?.timestamp ?? /* @__PURE__ */ new Date(), n = Q(r, u), s = L(t, n);
17068
17758
  return {
17069
17759
  auto_update_timestamp: void 0,
17070
- model: m,
17760
+ model: r,
17071
17761
  model_price: n,
17072
17762
  provider: o,
17073
17763
  ...s
17074
17764
  };
17075
17765
  }
17076
17766
  function E(t) {
17077
- return b?.(), B(g, t);
17767
+ return f?.(), I(g, t);
17078
17768
  }
17079
- function V(t, e, a) {
17769
+ function O(t, e, a) {
17080
17770
  if (a = a ?? "default", !t.extractors)
17081
17771
  throw new Error("No extraction logic defined for this provider");
17082
17772
  const i = t.extractors.find((s) => s.api_flavor === a);
17083
17773
  if (!i) {
17084
- const s = t.extractors.map((u) => u.api_flavor).join(", ");
17774
+ const s = t.extractors.map((m) => m.api_flavor).join(", ");
17085
17775
  throw new Error(`Unknown apiFlavor '${a}', allowed values: ${s}`);
17086
17776
  }
17087
17777
  if (!h.guard(e))
17088
17778
  throw new Error(`Expected response data to be a mapping object, got ${l(e)}`);
17089
- const o = q(i.model_path, e, R, !1, []), m = I(i.root), r = q(m, e, h, !0, []), n = {};
17779
+ const o = w(i.model_path, e, D, !1, []), r = M(i.root), u = w(r, e, h, !0, []), n = {};
17090
17780
  for (const s of i.mappings) {
17091
- const u = q(s.path, r, D, s.required, m);
17092
- if (u !== null) {
17781
+ const m = w(s.path, u, z, s.required, r);
17782
+ if (m !== null) {
17093
17783
  const p = n[s.dest] ?? 0;
17094
- n[s.dest] = p + u;
17784
+ n[s.dest] = p + m;
17095
17785
  }
17096
17786
  }
17097
17787
  if (!Object.keys(n).length)
17098
17788
  throw new Error(`No usage information found at ${JSON.stringify(i.root)}`);
17099
17789
  return { model: o, usage: n };
17100
17790
  }
17101
- function q(t, e, a, i, o) {
17102
- const [m, ...r] = I(t).reverse();
17103
- if (typeof m != "string")
17104
- throw new Error(`Expected last step of path to be a string, got ${l(m)}`);
17105
- r.reverse();
17791
+ function w(t, e, a, i, o) {
17792
+ const [r, ...u] = M(t).reverse();
17793
+ if (typeof r != "string")
17794
+ throw new Error(`Expected last step of path to be a string, got ${l(r)}`);
17795
+ u.reverse();
17106
17796
  let n = e;
17107
17797
  const s = [];
17108
- for (const p of r) {
17798
+ for (const p of u) {
17109
17799
  if (s.push(p), typeof p == "object")
17110
17800
  if (Array.isArray(n))
17111
- n = G(p, n);
17801
+ n = R(p, n);
17112
17802
  else {
17113
17803
  if (i)
17114
17804
  throw new Error(`Expected \`${d(o, s)}\` value to be a mapping, got ${l(n)}`);
@@ -17133,19 +17823,19 @@ function q(t, e, a, i, o) {
17133
17823
  throw new Error(`Expected \`${d(o, s)}\` value to be a mapping, got ${l(n)}`);
17134
17824
  return null;
17135
17825
  }
17136
- const u = n[m];
17137
- if (typeof u > "u") {
17826
+ const m = n[r];
17827
+ if (typeof m > "u") {
17138
17828
  if (i)
17139
- throw s.push(m), new Error(`Missing value at \`${d(o, s)}\``);
17829
+ throw s.push(r), new Error(`Missing value at \`${d(o, s)}\``);
17140
17830
  return null;
17141
17831
  }
17142
- if (a.guard(u))
17143
- return u;
17832
+ if (a.guard(m))
17833
+ return m;
17144
17834
  if (i)
17145
- throw s.push(m), new Error(`Expected \`${d(o, s)}\` value to be a ${a.name}, got ${l(u)}`);
17835
+ throw s.push(r), new Error(`Expected \`${d(o, s)}\` value to be a ${a.name}, got ${l(m)}`);
17146
17836
  return null;
17147
17837
  }
17148
- function G(t, e) {
17838
+ function R(t, e) {
17149
17839
  for (const a of e)
17150
17840
  if (h.guard(a)) {
17151
17841
  const i = a[t.field];
@@ -17153,7 +17843,7 @@ function G(t, e) {
17153
17843
  return a;
17154
17844
  }
17155
17845
  }
17156
- function I(t) {
17846
+ function M(t) {
17157
17847
  return Array.isArray(t) ? [...t] : [t];
17158
17848
  }
17159
17849
  function l(t) {
@@ -17162,18 +17852,26 @@ function l(t) {
17162
17852
  const h = {
17163
17853
  guard: (t) => l(t) === "mapping",
17164
17854
  name: "mapping"
17165
- }, R = {
17855
+ }, D = {
17166
17856
  guard: (t) => typeof t == "string",
17167
17857
  name: "string"
17168
- }, D = {
17858
+ }, z = {
17169
17859
  guard: (t) => typeof t == "number",
17170
17860
  name: "number"
17171
- }, d = (t, e) => [...t.map(v), ...e.map(v)].join("."), v = (t) => typeof t == "string" ? t : JSON.stringify(t);
17861
+ }, d = (t, e) => [...t.map(x), ...e.map(x)].join("."), x = (t) => typeof t == "string" ? t : JSON.stringify(t);
17862
+ class F {
17863
+ base;
17864
+ tiers;
17865
+ constructor(e) {
17866
+ this.base = e.base, this.tiers = [...e.tiers].sort((a, i) => a.start - i.start);
17867
+ }
17868
+ }
17172
17869
  export {
17173
- P as REMOTE_DATA_JSON_URL,
17174
- N as calcPrice,
17175
- V as extractUsage,
17870
+ S as REMOTE_DATA_JSON_URL,
17871
+ F as TieredPrices,
17872
+ V as calcPrice,
17873
+ O as extractUsage,
17176
17874
  E as findProvider,
17177
- z as updatePrices,
17178
- C as waitForUpdate
17875
+ C as updatePrices,
17876
+ N as waitForUpdate
17179
17877
  };