smoltalk 0.4.1 → 0.5.0

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.
Files changed (47) hide show
  1. package/README.md +139 -0
  2. package/dist/classes/ToolCall.js +4 -3
  3. package/dist/classes/message/AssistantMessage.d.ts +1 -0
  4. package/dist/classes/message/AssistantMessage.js +5 -3
  5. package/dist/classes/message/DeveloperMessage.js +5 -3
  6. package/dist/classes/message/SystemMessage.js +5 -3
  7. package/dist/classes/message/ToolMessage.js +4 -3
  8. package/dist/classes/message/UserMessage.js +5 -3
  9. package/dist/client.js +5 -3
  10. package/dist/clients/anthropic.d.ts +3 -1
  11. package/dist/clients/anthropic.js +71 -13
  12. package/dist/clients/baseClient.js +11 -1
  13. package/dist/clients/google.d.ts +4 -0
  14. package/dist/clients/google.js +92 -24
  15. package/dist/clients/ollama.d.ts +1 -0
  16. package/dist/clients/ollama.js +18 -7
  17. package/dist/clients/openai.js +7 -4
  18. package/dist/clients/openaiResponses.d.ts +3 -0
  19. package/dist/clients/openaiResponses.js +60 -7
  20. package/dist/embed/openai.js +3 -3
  21. package/dist/embed.d.ts +5 -2
  22. package/dist/embed.js +14 -3
  23. package/dist/image/google.js +3 -3
  24. package/dist/image/openai.js +6 -6
  25. package/dist/image.d.ts +5 -2
  26. package/dist/image.js +14 -3
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/model.d.ts +4 -2
  30. package/dist/model.js +7 -5
  31. package/dist/modelData.d.ts +40 -0
  32. package/dist/modelData.js +222 -0
  33. package/dist/models.d.ts +658 -760
  34. package/dist/models.js +836 -60
  35. package/dist/smolError.d.ts +78 -5
  36. package/dist/smolError.js +134 -9
  37. package/dist/types/costEstimate.d.ts +2 -0
  38. package/dist/types/costEstimate.js +1 -0
  39. package/dist/types.d.ts +30 -1
  40. package/dist/types.js +2 -1
  41. package/dist/util/hostedTools.d.ts +19 -0
  42. package/dist/util/hostedTools.js +104 -0
  43. package/dist/util/httpError.d.ts +23 -0
  44. package/dist/util/httpError.js +237 -0
  45. package/dist/util/provider.d.ts +2 -1
  46. package/dist/util/provider.js +2 -2
  47. package/package.json +7 -2
package/dist/models.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { mergeModelData, mergeHostedTools, } from "./modelData.js";
2
3
  export const providers = [
3
4
  "ollama",
4
5
  "openai",
@@ -38,6 +39,17 @@ export const textModels = [
38
39
  cachedInputTokenCost: 0.075,
39
40
  outputTokenCost: 0.6,
40
41
  outputTokensPerSecond: 65,
42
+ modalities: {
43
+ input: ["text", "image", "pdf"],
44
+ output: ["text"],
45
+ },
46
+ knowledge: "2023-09",
47
+ releaseDate: "2024-07-18",
48
+ lastUpdated: "2024-07-18",
49
+ family: "gpt-mini",
50
+ openWeights: false,
51
+ structuredOutput: true,
52
+ temperatureSupported: true,
41
53
  provider: "openai",
42
54
  },
43
55
  {
@@ -50,6 +62,17 @@ export const textModels = [
50
62
  cachedInputTokenCost: 1.25,
51
63
  outputTokenCost: 10,
52
64
  outputTokensPerSecond: 143,
65
+ modalities: {
66
+ input: ["text", "image", "pdf"],
67
+ output: ["text"],
68
+ },
69
+ knowledge: "2023-09",
70
+ releaseDate: "2024-05-13",
71
+ lastUpdated: "2024-08-06",
72
+ family: "gpt",
73
+ openWeights: false,
74
+ structuredOutput: true,
75
+ temperatureSupported: true,
53
76
  provider: "openai",
54
77
  },
55
78
  {
@@ -69,13 +92,24 @@ export const textModels = [
69
92
  outputsThinking: false,
70
93
  outputsSignatures: false,
71
94
  },
95
+ modalities: {
96
+ input: ["text", "image", "pdf"],
97
+ output: ["text"],
98
+ },
99
+ knowledge: "2024-05",
100
+ releaseDate: "2025-04-16",
101
+ lastUpdated: "2025-04-16",
102
+ family: "o",
103
+ openWeights: false,
104
+ structuredOutput: true,
105
+ temperatureSupported: false,
72
106
  provider: "openai",
73
107
  },
74
108
  {
75
109
  type: "text",
76
110
  modelName: "o3-mini",
77
111
  description: "o3-mini is our most recent small reasoning model, providing high intelligence at the same cost and latency targets of o1-mini. o3-mini also supports key developer features, like Structured Outputs, function calling, Batch API, and more. Like other models in the o-series, it is designed to excel at science, math, and coding tasks. Knowledge cutoff: June 2024.",
78
- maxInputTokens: 500000,
112
+ maxInputTokens: 200000,
79
113
  maxOutputTokens: 100000,
80
114
  inputTokenCost: 1.1,
81
115
  cachedInputTokenCost: 0.55,
@@ -88,6 +122,17 @@ export const textModels = [
88
122
  outputsThinking: false,
89
123
  outputsSignatures: false,
90
124
  },
125
+ modalities: {
126
+ input: ["text"],
127
+ output: ["text"],
128
+ },
129
+ knowledge: "2024-05",
130
+ releaseDate: "2024-12-20",
131
+ lastUpdated: "2025-01-29",
132
+ family: "o-mini",
133
+ openWeights: false,
134
+ structuredOutput: true,
135
+ temperatureSupported: false,
91
136
  provider: "openai",
92
137
  },
93
138
  {
@@ -96,9 +141,9 @@ export const textModels = [
96
141
  description: "Latest small o-series model optimized for fast, effective reasoning with exceptional performance in coding and visual tasks. Knowledge cutoff: June 2024.",
97
142
  maxInputTokens: 200000,
98
143
  maxOutputTokens: 100000,
99
- inputTokenCost: 0.6,
100
- cachedInputTokenCost: 0.3,
101
- outputTokenCost: 2.4,
144
+ inputTokenCost: 1.1,
145
+ cachedInputTokenCost: 0.275,
146
+ outputTokenCost: 4.4,
102
147
  outputTokensPerSecond: 135,
103
148
  reasoning: {
104
149
  levels: ["low", "medium", "high"],
@@ -107,6 +152,17 @@ export const textModels = [
107
152
  outputsThinking: false,
108
153
  outputsSignatures: false,
109
154
  },
155
+ modalities: {
156
+ input: ["text", "image"],
157
+ output: ["text"],
158
+ },
159
+ knowledge: "2024-05",
160
+ releaseDate: "2025-04-16",
161
+ lastUpdated: "2025-04-16",
162
+ family: "o-mini",
163
+ openWeights: false,
164
+ structuredOutput: true,
165
+ temperatureSupported: false,
110
166
  provider: "openai",
111
167
  },
112
168
  {
@@ -122,7 +178,18 @@ export const textModels = [
122
178
  outputsThinking: false,
123
179
  outputsSignatures: false,
124
180
  },
125
- provider: "openai",
181
+ modalities: {
182
+ input: ["text", "image"],
183
+ output: ["text"],
184
+ },
185
+ knowledge: "2024-05",
186
+ releaseDate: "2025-06-10",
187
+ lastUpdated: "2025-06-10",
188
+ family: "o-pro",
189
+ openWeights: false,
190
+ structuredOutput: true,
191
+ temperatureSupported: false,
192
+ provider: "openai-responses",
126
193
  },
127
194
  {
128
195
  type: "text",
@@ -141,6 +208,17 @@ export const textModels = [
141
208
  outputsThinking: false,
142
209
  outputsSignatures: false,
143
210
  },
211
+ modalities: {
212
+ input: ["text", "image", "pdf"],
213
+ output: ["text"],
214
+ },
215
+ knowledge: "2023-09",
216
+ releaseDate: "2024-12-05",
217
+ lastUpdated: "2024-12-05",
218
+ family: "o",
219
+ openWeights: false,
220
+ structuredOutput: true,
221
+ temperatureSupported: false,
144
222
  provider: "openai",
145
223
  },
146
224
  {
@@ -151,6 +229,17 @@ export const textModels = [
151
229
  maxOutputTokens: 4096,
152
230
  inputTokenCost: 10,
153
231
  outputTokenCost: 30,
232
+ modalities: {
233
+ input: ["text", "image"],
234
+ output: ["text"],
235
+ },
236
+ knowledge: "2023-12",
237
+ releaseDate: "2023-11-06",
238
+ lastUpdated: "2024-04-09",
239
+ family: "gpt",
240
+ openWeights: false,
241
+ structuredOutput: false,
242
+ temperatureSupported: true,
154
243
  disabled: true,
155
244
  provider: "openai",
156
245
  },
@@ -162,6 +251,17 @@ export const textModels = [
162
251
  maxOutputTokens: 8192,
163
252
  inputTokenCost: 30,
164
253
  outputTokenCost: 60,
254
+ modalities: {
255
+ input: ["text"],
256
+ output: ["text"],
257
+ },
258
+ knowledge: "2023-11",
259
+ releaseDate: "2023-11-06",
260
+ lastUpdated: "2024-04-09",
261
+ family: "gpt",
262
+ openWeights: false,
263
+ structuredOutput: false,
264
+ temperatureSupported: true,
165
265
  disabled: true,
166
266
  provider: "openai",
167
267
  },
@@ -172,7 +272,19 @@ export const textModels = [
172
272
  maxInputTokens: 16385,
173
273
  maxOutputTokens: 4096,
174
274
  inputTokenCost: 0.5,
275
+ cachedInputTokenCost: 0,
175
276
  outputTokenCost: 1.5,
277
+ modalities: {
278
+ input: ["text"],
279
+ output: ["text"],
280
+ },
281
+ knowledge: "2021-09-01",
282
+ releaseDate: "2023-03-01",
283
+ lastUpdated: "2023-11-06",
284
+ family: "gpt",
285
+ openWeights: false,
286
+ structuredOutput: false,
287
+ temperatureSupported: true,
176
288
  disabled: true,
177
289
  provider: "openai",
178
290
  },
@@ -182,10 +294,21 @@ export const textModels = [
182
294
  description: "GPT-4.1 excels at instruction following and tool calling with 1M token context window. Knowledge cutoff: June 2024.",
183
295
  maxInputTokens: 1047576,
184
296
  maxOutputTokens: 32768,
185
- inputTokenCost: 2.0,
297
+ inputTokenCost: 2,
186
298
  cachedInputTokenCost: 0.5,
187
299
  outputTokenCost: 8,
188
300
  outputTokensPerSecond: 105,
301
+ modalities: {
302
+ input: ["text", "image", "pdf"],
303
+ output: ["text"],
304
+ },
305
+ knowledge: "2024-04",
306
+ releaseDate: "2025-04-14",
307
+ lastUpdated: "2025-04-14",
308
+ family: "gpt",
309
+ openWeights: false,
310
+ structuredOutput: true,
311
+ temperatureSupported: true,
189
312
  provider: "openai",
190
313
  },
191
314
  {
@@ -198,6 +321,17 @@ export const textModels = [
198
321
  cachedInputTokenCost: 0.1,
199
322
  outputTokenCost: 1.6,
200
323
  outputTokensPerSecond: 78,
324
+ modalities: {
325
+ input: ["text", "image", "pdf"],
326
+ output: ["text"],
327
+ },
328
+ knowledge: "2024-04",
329
+ releaseDate: "2025-04-14",
330
+ lastUpdated: "2025-04-14",
331
+ family: "gpt-mini",
332
+ openWeights: false,
333
+ structuredOutput: true,
334
+ temperatureSupported: true,
201
335
  provider: "openai",
202
336
  },
203
337
  {
@@ -210,6 +344,17 @@ export const textModels = [
210
344
  cachedInputTokenCost: 0.025,
211
345
  outputTokenCost: 0.4,
212
346
  outputTokensPerSecond: 142,
347
+ modalities: {
348
+ input: ["text", "image"],
349
+ output: ["text"],
350
+ },
351
+ knowledge: "2024-04",
352
+ releaseDate: "2025-04-14",
353
+ lastUpdated: "2025-04-14",
354
+ family: "gpt-nano",
355
+ openWeights: false,
356
+ structuredOutput: true,
357
+ temperatureSupported: true,
213
358
  provider: "openai",
214
359
  },
215
360
  {
@@ -229,7 +374,18 @@ export const textModels = [
229
374
  outputsThinking: false,
230
375
  outputsSignatures: false,
231
376
  },
232
- provider: "openai-responses",
377
+ modalities: {
378
+ input: ["text", "image"],
379
+ output: ["text"],
380
+ },
381
+ knowledge: "2024-09-30",
382
+ releaseDate: "2025-08-07",
383
+ lastUpdated: "2025-08-07",
384
+ family: "gpt",
385
+ openWeights: false,
386
+ structuredOutput: true,
387
+ temperatureSupported: false,
388
+ provider: "openai",
233
389
  },
234
390
  {
235
391
  type: "text",
@@ -248,7 +404,18 @@ export const textModels = [
248
404
  outputsThinking: false,
249
405
  outputsSignatures: false,
250
406
  },
251
- provider: "openai-responses",
407
+ modalities: {
408
+ input: ["text", "image"],
409
+ output: ["text"],
410
+ },
411
+ knowledge: "2024-05-30",
412
+ releaseDate: "2025-08-07",
413
+ lastUpdated: "2025-08-07",
414
+ family: "gpt-mini",
415
+ openWeights: false,
416
+ structuredOutput: true,
417
+ temperatureSupported: false,
418
+ provider: "openai",
252
419
  },
253
420
  {
254
421
  type: "text",
@@ -267,7 +434,18 @@ export const textModels = [
267
434
  outputsThinking: false,
268
435
  outputsSignatures: false,
269
436
  },
270
- provider: "openai-responses",
437
+ modalities: {
438
+ input: ["text", "image"],
439
+ output: ["text"],
440
+ },
441
+ knowledge: "2024-05-30",
442
+ releaseDate: "2025-08-07",
443
+ lastUpdated: "2025-08-07",
444
+ family: "gpt-nano",
445
+ openWeights: false,
446
+ structuredOutput: true,
447
+ temperatureSupported: false,
448
+ provider: "openai",
271
449
  },
272
450
  {
273
451
  type: "text",
@@ -285,7 +463,18 @@ export const textModels = [
285
463
  outputsThinking: false,
286
464
  outputsSignatures: false,
287
465
  },
288
- provider: "openai-responses",
466
+ modalities: {
467
+ input: ["text", "image"],
468
+ output: ["text"],
469
+ },
470
+ knowledge: "2024-09-30",
471
+ releaseDate: "2025-11-13",
472
+ lastUpdated: "2025-11-13",
473
+ family: "gpt",
474
+ openWeights: false,
475
+ structuredOutput: true,
476
+ temperatureSupported: false,
477
+ provider: "openai",
289
478
  },
290
479
  {
291
480
  type: "text",
@@ -304,7 +493,18 @@ export const textModels = [
304
493
  outputsThinking: false,
305
494
  outputsSignatures: false,
306
495
  },
307
- provider: "openai-responses",
496
+ modalities: {
497
+ input: ["text", "image"],
498
+ output: ["text"],
499
+ },
500
+ knowledge: "2025-08-31",
501
+ releaseDate: "2025-12-11",
502
+ lastUpdated: "2025-12-11",
503
+ family: "gpt",
504
+ openWeights: false,
505
+ structuredOutput: true,
506
+ temperatureSupported: false,
507
+ provider: "openai",
308
508
  },
309
509
  {
310
510
  type: "text",
@@ -319,17 +519,34 @@ export const textModels = [
319
519
  outputsThinking: false,
320
520
  outputsSignatures: false,
321
521
  },
522
+ modalities: {
523
+ input: ["text", "image"],
524
+ output: ["text"],
525
+ },
526
+ knowledge: "2025-08-31",
527
+ releaseDate: "2025-12-11",
528
+ lastUpdated: "2025-12-11",
529
+ family: "gpt-pro",
530
+ openWeights: false,
531
+ structuredOutput: false,
532
+ temperatureSupported: false,
322
533
  provider: "openai-responses",
323
534
  },
324
535
  {
325
536
  type: "text",
326
537
  modelName: "gpt-5.4",
327
538
  description: "GPT-5.4 is the most capable and efficient frontier model for complex professional work. 1M context window, state-of-the-art coding and tool use. Standard pricing for ≤272K tokens, 2x input/1.5x output for >272K. Knowledge cutoff: August 2025.",
328
- maxInputTokens: 1_050_000,
539
+ maxInputTokens: 1050000,
329
540
  maxOutputTokens: 128000,
330
541
  inputTokenCost: 2.5,
331
542
  cachedInputTokenCost: 0.25,
332
543
  outputTokenCost: 15,
544
+ longContext: {
545
+ inputTokenCost: 5,
546
+ cachedInputTokenCost: 0.5,
547
+ outputTokenCost: 22.5,
548
+ thresholdTokens: 200000,
549
+ },
333
550
  reasoning: {
334
551
  levels: ["none", "low", "medium", "high", "xhigh"],
335
552
  defaultLevel: "none",
@@ -337,7 +554,18 @@ export const textModels = [
337
554
  outputsThinking: false,
338
555
  outputsSignatures: false,
339
556
  },
340
- provider: "openai-responses",
557
+ modalities: {
558
+ input: ["text", "image", "pdf"],
559
+ output: ["text"],
560
+ },
561
+ knowledge: "2025-08-31",
562
+ releaseDate: "2026-03-05",
563
+ lastUpdated: "2026-03-05",
564
+ family: "gpt",
565
+ openWeights: false,
566
+ structuredOutput: true,
567
+ temperatureSupported: false,
568
+ provider: "openai",
341
569
  },
342
570
  {
343
571
  type: "text",
@@ -356,7 +584,18 @@ export const textModels = [
356
584
  outputsThinking: false,
357
585
  outputsSignatures: false,
358
586
  },
359
- provider: "openai-responses",
587
+ modalities: {
588
+ input: ["text", "image"],
589
+ output: ["text"],
590
+ },
591
+ knowledge: "2025-08-31",
592
+ releaseDate: "2026-03-17",
593
+ lastUpdated: "2026-03-17",
594
+ family: "gpt-mini",
595
+ openWeights: false,
596
+ structuredOutput: true,
597
+ temperatureSupported: false,
598
+ provider: "openai",
360
599
  },
361
600
  {
362
601
  type: "text",
@@ -375,16 +614,32 @@ export const textModels = [
375
614
  outputsThinking: false,
376
615
  outputsSignatures: false,
377
616
  },
378
- provider: "openai-responses",
617
+ modalities: {
618
+ input: ["text", "image"],
619
+ output: ["text"],
620
+ },
621
+ knowledge: "2025-08-31",
622
+ releaseDate: "2026-03-17",
623
+ lastUpdated: "2026-03-17",
624
+ family: "gpt-nano",
625
+ openWeights: false,
626
+ structuredOutput: true,
627
+ temperatureSupported: false,
628
+ provider: "openai",
379
629
  },
380
630
  {
381
631
  type: "text",
382
632
  modelName: "gpt-5.4-pro",
383
633
  description: "GPT-5.4 Pro uses more compute for complex reasoning tasks. 1M context window. Standard pricing for ≤272K tokens. Knowledge cutoff: August 2025.",
384
- maxInputTokens: 1_050_000,
634
+ maxInputTokens: 1050000,
385
635
  maxOutputTokens: 128000,
386
636
  inputTokenCost: 30,
387
637
  outputTokenCost: 180,
638
+ longContext: {
639
+ inputTokenCost: 60,
640
+ outputTokenCost: 270,
641
+ thresholdTokens: 200000,
642
+ },
388
643
  reasoning: {
389
644
  levels: ["medium", "high", "xhigh"],
390
645
  defaultLevel: "medium",
@@ -392,18 +647,35 @@ export const textModels = [
392
647
  outputsThinking: false,
393
648
  outputsSignatures: false,
394
649
  },
650
+ modalities: {
651
+ input: ["text", "image"],
652
+ output: ["text"],
653
+ },
654
+ knowledge: "2025-08-31",
655
+ releaseDate: "2026-03-05",
656
+ lastUpdated: "2026-03-05",
657
+ family: "gpt-pro",
658
+ openWeights: false,
659
+ structuredOutput: false,
660
+ temperatureSupported: false,
395
661
  provider: "openai-responses",
396
662
  },
397
663
  {
398
664
  type: "text",
399
665
  modelName: "gpt-5.5",
400
666
  description: "GPT-5.5 is a new class of intelligence for coding and professional work. 1M context window. Standard pricing for ≤272K tokens, 2x input/1.5x output for >272K. Knowledge cutoff: December 2025.",
401
- maxInputTokens: 1_050_000,
667
+ maxInputTokens: 1050000,
402
668
  maxOutputTokens: 128000,
403
669
  inputTokenCost: 5,
404
670
  cachedInputTokenCost: 0.5,
405
671
  outputTokenCost: 30,
406
672
  outputTokensPerSecond: 66,
673
+ longContext: {
674
+ inputTokenCost: 10,
675
+ cachedInputTokenCost: 1,
676
+ outputTokenCost: 45,
677
+ thresholdTokens: 200000,
678
+ },
407
679
  reasoning: {
408
680
  levels: ["none", "low", "medium", "high", "xhigh"],
409
681
  defaultLevel: "medium",
@@ -411,16 +683,32 @@ export const textModels = [
411
683
  outputsThinking: false,
412
684
  outputsSignatures: false,
413
685
  },
414
- provider: "openai-responses",
686
+ modalities: {
687
+ input: ["text", "image", "pdf"],
688
+ output: ["text"],
689
+ },
690
+ knowledge: "2025-12-01",
691
+ releaseDate: "2026-04-23",
692
+ lastUpdated: "2026-04-23",
693
+ family: "gpt",
694
+ openWeights: false,
695
+ structuredOutput: true,
696
+ temperatureSupported: false,
697
+ provider: "openai",
415
698
  },
416
699
  {
417
700
  type: "text",
418
701
  modelName: "gpt-5.5-pro",
419
702
  description: "GPT-5.5 Pro uses more compute for complex reasoning tasks. 1M context window. Knowledge cutoff: December 2025.",
420
- maxInputTokens: 1_050_000,
703
+ maxInputTokens: 1050000,
421
704
  maxOutputTokens: 128000,
422
705
  inputTokenCost: 30,
423
706
  outputTokenCost: 180,
707
+ longContext: {
708
+ inputTokenCost: 60,
709
+ outputTokenCost: 270,
710
+ thresholdTokens: 200000,
711
+ },
424
712
  reasoning: {
425
713
  levels: ["none", "low", "medium", "high", "xhigh"],
426
714
  defaultLevel: "medium",
@@ -428,17 +716,35 @@ export const textModels = [
428
716
  outputsThinking: false,
429
717
  outputsSignatures: false,
430
718
  },
719
+ modalities: {
720
+ input: ["text", "image", "pdf"],
721
+ output: ["text"],
722
+ },
723
+ knowledge: "2025-12-01",
724
+ releaseDate: "2026-04-23",
725
+ lastUpdated: "2026-04-23",
726
+ family: "gpt-pro",
727
+ openWeights: false,
728
+ structuredOutput: true,
729
+ temperatureSupported: false,
431
730
  provider: "openai-responses",
432
731
  },
433
732
  {
434
733
  type: "text",
435
734
  modelName: "gemini-3.1-pro-preview",
436
735
  description: "Latest Gemini 3.1 Pro with 1M context window and 64K output. Standard pricing for ≤200k tokens ($2.00 input/$12.00 output), higher rates for >200k tokens ($4.00 input/$18.00 output). Released Feb 2026.",
437
- maxInputTokens: 1_048_576,
736
+ maxInputTokens: 1048576,
438
737
  maxOutputTokens: 65536,
439
- inputTokenCost: 2.0,
440
- outputTokenCost: 12.0,
738
+ inputTokenCost: 2,
739
+ cachedInputTokenCost: 0.2,
740
+ outputTokenCost: 12,
441
741
  outputTokensPerSecond: 133,
742
+ longContext: {
743
+ inputTokenCost: 4,
744
+ cachedInputTokenCost: 0.4,
745
+ outputTokenCost: 18,
746
+ thresholdTokens: 200000,
747
+ },
442
748
  reasoning: {
443
749
  levels: ["low", "medium", "high"],
444
750
  defaultLevel: "high",
@@ -446,16 +752,45 @@ export const textModels = [
446
752
  outputsThinking: true,
447
753
  outputsSignatures: true,
448
754
  },
755
+ modalities: {
756
+ input: ["text", "image", "video", "audio", "pdf"],
757
+ output: ["text"],
758
+ },
759
+ knowledge: "2025-01",
760
+ releaseDate: "2026-02-19",
761
+ lastUpdated: "2026-02-19",
762
+ family: "gemini-pro",
763
+ openWeights: false,
764
+ structuredOutput: true,
765
+ temperatureSupported: true,
449
766
  provider: "google",
450
767
  },
451
768
  {
452
769
  type: "text",
453
770
  modelName: "gemini-3-pro-preview",
454
771
  description: "DEPRECATED: Shut down March 9, 2026. Use gemini-3.1-pro-preview instead.",
455
- maxInputTokens: 1_048_576,
772
+ maxInputTokens: 1048576,
456
773
  maxOutputTokens: 65536,
457
- inputTokenCost: 2.0,
458
- outputTokenCost: 12.0,
774
+ inputTokenCost: 2,
775
+ cachedInputTokenCost: 0.2,
776
+ outputTokenCost: 12,
777
+ longContext: {
778
+ inputTokenCost: 4,
779
+ cachedInputTokenCost: 0.4,
780
+ outputTokenCost: 18,
781
+ thresholdTokens: 200000,
782
+ },
783
+ modalities: {
784
+ input: ["text", "image", "video", "audio", "pdf"],
785
+ output: ["text"],
786
+ },
787
+ knowledge: "2025-01",
788
+ releaseDate: "2025-11-18",
789
+ lastUpdated: "2025-11-18",
790
+ family: "gemini-pro",
791
+ openWeights: false,
792
+ structuredOutput: true,
793
+ temperatureSupported: true,
459
794
  disabled: true,
460
795
  provider: "google",
461
796
  },
@@ -463,11 +798,12 @@ export const textModels = [
463
798
  type: "text",
464
799
  modelName: "gemini-3.5-flash",
465
800
  description: "Latest Gemini 3.5 Flash model (GA May 2026). Outperforms Gemini 3.1 Pro on coding and agentic suites at 4x the speed. 1M context window, 64K output. Context caching: $0.15/1M read.",
466
- maxInputTokens: 1_048_576,
801
+ maxInputTokens: 1048576,
467
802
  maxOutputTokens: 65536,
468
803
  inputTokenCost: 1.5,
469
804
  cachedInputTokenCost: 0.15,
470
- outputTokenCost: 9.0,
805
+ outputTokenCost: 9,
806
+ inputAudioTokenCost: 1.5,
471
807
  reasoning: {
472
808
  levels: ["minimal", "low", "medium", "high"],
473
809
  defaultLevel: "high",
@@ -475,17 +811,30 @@ export const textModels = [
475
811
  outputsThinking: true,
476
812
  outputsSignatures: true,
477
813
  },
814
+ modalities: {
815
+ input: ["text", "image", "video", "audio", "pdf"],
816
+ output: ["text"],
817
+ },
818
+ knowledge: "2025-01",
819
+ releaseDate: "2026-05-19",
820
+ lastUpdated: "2026-05-19",
821
+ family: "gemini-flash",
822
+ openWeights: false,
823
+ structuredOutput: true,
824
+ temperatureSupported: true,
478
825
  provider: "google",
479
826
  },
480
827
  {
481
828
  type: "text",
482
829
  modelName: "gemini-3-flash-preview",
483
830
  description: "Gemini 3 Flash preview. Superseded by gemini-3.5-flash. 1M context window and 64K output. Optimized for agentic workflows and coding.",
484
- maxInputTokens: 1_048_576,
831
+ maxInputTokens: 1048576,
485
832
  maxOutputTokens: 65536,
486
833
  inputTokenCost: 0.5,
487
- outputTokenCost: 3.0,
834
+ cachedInputTokenCost: 0.05,
835
+ outputTokenCost: 3,
488
836
  outputTokensPerSecond: 184,
837
+ inputAudioTokenCost: 1,
489
838
  reasoning: {
490
839
  levels: ["minimal", "low", "medium", "high"],
491
840
  defaultLevel: "high",
@@ -493,17 +842,30 @@ export const textModels = [
493
842
  outputsThinking: true,
494
843
  outputsSignatures: true,
495
844
  },
845
+ modalities: {
846
+ input: ["text", "image", "video", "audio", "pdf"],
847
+ output: ["text"],
848
+ },
849
+ knowledge: "2025-01",
850
+ releaseDate: "2025-12-17",
851
+ lastUpdated: "2025-12-17",
852
+ family: "gemini-flash",
853
+ openWeights: false,
854
+ structuredOutput: true,
855
+ temperatureSupported: true,
496
856
  provider: "google",
497
857
  },
498
858
  {
499
859
  type: "text",
500
860
  modelName: "gemini-3.1-flash-lite",
501
861
  description: "Most cost-effective Gemini 3.1 model (GA). Thinking support, 1M context window, 64K output. 2.5x faster TTFA and 45% faster output than 2.5 Flash.",
502
- maxInputTokens: 1_048_576,
862
+ maxInputTokens: 1048576,
503
863
  maxOutputTokens: 65536,
504
864
  inputTokenCost: 0.25,
865
+ cachedInputTokenCost: 0.025,
505
866
  outputTokenCost: 1.5,
506
867
  outputTokensPerSecond: 379,
868
+ inputAudioTokenCost: 0.5,
507
869
  reasoning: {
508
870
  levels: ["minimal", "low", "medium", "high"],
509
871
  defaultLevel: "minimal",
@@ -511,79 +873,156 @@ export const textModels = [
511
873
  outputsThinking: true,
512
874
  outputsSignatures: true,
513
875
  },
876
+ modalities: {
877
+ input: ["text", "image", "video", "audio", "pdf"],
878
+ output: ["text"],
879
+ },
880
+ knowledge: "2025-01",
881
+ releaseDate: "2026-05-07",
882
+ lastUpdated: "2026-05-07",
883
+ family: "gemini-flash-lite",
884
+ openWeights: false,
885
+ structuredOutput: true,
886
+ temperatureSupported: true,
514
887
  provider: "google",
515
888
  },
516
889
  {
517
890
  type: "text",
518
891
  modelName: "gemini-3.1-flash-lite-preview",
519
892
  description: "DEPRECATED: Preview version, discontinued July 9, 2026. Use gemini-3.1-flash-lite instead.",
520
- maxInputTokens: 1_048_576,
893
+ maxInputTokens: 1048576,
521
894
  maxOutputTokens: 65536,
522
895
  inputTokenCost: 0.25,
896
+ cachedInputTokenCost: 0.025,
523
897
  outputTokenCost: 1.5,
898
+ inputAudioTokenCost: 0.5,
899
+ modalities: {
900
+ input: ["text", "image", "video", "audio", "pdf"],
901
+ output: ["text"],
902
+ },
903
+ knowledge: "2025-01",
904
+ releaseDate: "2026-03-03",
905
+ lastUpdated: "2026-03-03",
906
+ family: "gemini-flash-lite",
907
+ openWeights: false,
908
+ structuredOutput: true,
909
+ temperatureSupported: true,
524
910
  disabled: true,
525
911
  provider: "google",
526
912
  },
527
913
  {
528
914
  type: "text",
529
915
  modelName: "gemini-2.5-pro",
530
- description: "High-performance Gemini 2.5 model with 2M context window. Adaptive thinking for complex reasoning and coding. Standard pricing for ≤200k tokens ($1.25 input/$10.00 output), higher rates for >200k tokens ($2.50 input/$15.00 output). Batch API: 50% discount.",
531
- maxInputTokens: 2_097_152,
916
+ description: "High-performance Gemini 2.5 model with 1M context window. Adaptive thinking for complex reasoning and coding. Standard pricing for ≤200k tokens ($1.25 input/$10.00 output), higher rates for >200k tokens ($2.50 input/$15.00 output). Batch API: 50% discount.",
917
+ maxInputTokens: 1048576,
532
918
  maxOutputTokens: 65536,
533
919
  inputTokenCost: 1.25,
534
- cachedInputTokenCost: 0.31,
535
- outputTokenCost: 10.0,
920
+ cachedInputTokenCost: 0.125,
921
+ outputTokenCost: 10,
536
922
  outputTokensPerSecond: 145,
923
+ longContext: {
924
+ inputTokenCost: 2.5,
925
+ cachedInputTokenCost: 0.25,
926
+ outputTokenCost: 15,
927
+ thresholdTokens: 200000,
928
+ },
537
929
  reasoning: {
538
930
  canDisable: false,
539
931
  outputsThinking: true,
540
932
  outputsSignatures: true,
541
933
  },
934
+ modalities: {
935
+ input: ["text", "image", "audio", "video", "pdf"],
936
+ output: ["text"],
937
+ },
938
+ knowledge: "2025-01",
939
+ releaseDate: "2025-06-17",
940
+ lastUpdated: "2025-06-17",
941
+ family: "gemini-pro",
942
+ openWeights: false,
943
+ structuredOutput: true,
944
+ temperatureSupported: true,
542
945
  provider: "google",
543
946
  },
544
947
  {
545
948
  type: "text",
546
949
  modelName: "gemini-2.5-flash",
547
950
  description: "Balanced Gemini 2.5 model with excellent performance-to-cost ratio. Lightning-fast with controllable thinking budgets. 1M context window. Context caching available for up to 75% cost reduction.",
548
- maxInputTokens: 1_048_576,
951
+ maxInputTokens: 1048576,
549
952
  maxOutputTokens: 65536,
550
953
  inputTokenCost: 0.3,
551
- cachedInputTokenCost: 0.075,
954
+ cachedInputTokenCost: 0.03,
552
955
  outputTokenCost: 2.5,
553
956
  outputTokensPerSecond: 245,
957
+ inputAudioTokenCost: 1,
554
958
  reasoning: {
555
959
  canDisable: true,
556
960
  outputsThinking: true,
557
961
  outputsSignatures: true,
558
962
  },
963
+ modalities: {
964
+ input: ["text", "image", "audio", "video", "pdf"],
965
+ output: ["text"],
966
+ },
967
+ knowledge: "2025-01",
968
+ releaseDate: "2025-06-17",
969
+ lastUpdated: "2025-06-17",
970
+ family: "gemini-flash",
971
+ openWeights: false,
972
+ structuredOutput: true,
973
+ temperatureSupported: true,
559
974
  provider: "google",
560
975
  },
561
976
  {
562
977
  type: "text",
563
978
  modelName: "gemini-2.5-flash-lite",
564
979
  description: "Most cost-effective Gemini 2.5 option for high-throughput applications. 1M context window.",
565
- maxInputTokens: 1_048_576,
980
+ maxInputTokens: 1048576,
566
981
  maxOutputTokens: 65536,
567
982
  inputTokenCost: 0.1,
568
- cachedInputTokenCost: 0.025,
983
+ cachedInputTokenCost: 0.01,
569
984
  outputTokenCost: 0.4,
570
985
  outputTokensPerSecond: 400,
986
+ inputAudioTokenCost: 0.3,
571
987
  reasoning: {
572
988
  canDisable: true,
573
989
  outputsThinking: true,
574
990
  outputsSignatures: false,
575
991
  },
992
+ modalities: {
993
+ input: ["text", "image", "audio", "video", "pdf"],
994
+ output: ["text"],
995
+ },
996
+ knowledge: "2025-01",
997
+ releaseDate: "2025-06-17",
998
+ lastUpdated: "2025-06-17",
999
+ family: "gemini-flash-lite",
1000
+ openWeights: false,
1001
+ structuredOutput: true,
1002
+ temperatureSupported: true,
576
1003
  provider: "google",
577
1004
  },
578
1005
  {
579
1006
  type: "text",
580
1007
  modelName: "gemini-2.0-flash",
581
1008
  description: "Workhorse model for all daily tasks. Strong overall performance and supports real-time streaming Live API. 1M context window. DEPRECATED: Will be shut down on March 31, 2026.",
582
- maxInputTokens: 1_048_576,
1009
+ maxInputTokens: 1048576,
583
1010
  maxOutputTokens: 8192,
584
1011
  inputTokenCost: 0.1,
1012
+ cachedInputTokenCost: 0.025,
585
1013
  outputTokenCost: 0.4,
586
1014
  outputTokensPerSecond: 213,
1015
+ modalities: {
1016
+ input: ["text", "image", "audio", "video", "pdf"],
1017
+ output: ["text"],
1018
+ },
1019
+ knowledge: "2024-06",
1020
+ releaseDate: "2024-12-11",
1021
+ lastUpdated: "2024-12-11",
1022
+ family: "gemini-flash",
1023
+ openWeights: false,
1024
+ structuredOutput: true,
1025
+ temperatureSupported: true,
587
1026
  disabled: true,
588
1027
  provider: "google",
589
1028
  },
@@ -591,7 +1030,7 @@ export const textModels = [
591
1030
  type: "text",
592
1031
  modelName: "gemini-2.0-pro-exp-02-05",
593
1032
  description: "Strongest model quality, especially for code & world knowledge; 2M long context. In private beta.",
594
- maxInputTokens: 2_097_152,
1033
+ maxInputTokens: 2097152,
595
1034
  maxOutputTokens: 8192,
596
1035
  inputTokenCost: 0.5,
597
1036
  outputTokenCost: 1.5,
@@ -602,10 +1041,21 @@ export const textModels = [
602
1041
  type: "text",
603
1042
  modelName: "gemini-2.0-flash-lite",
604
1043
  description: "Cost effective offering to support high throughput. DEPRECATED: Will be shut down on March 31, 2026. Use gemini-2.5-flash-lite instead.",
605
- maxInputTokens: 1_048_576,
1044
+ maxInputTokens: 1048576,
606
1045
  maxOutputTokens: 8192,
607
1046
  inputTokenCost: 0.075,
608
1047
  outputTokenCost: 0.3,
1048
+ modalities: {
1049
+ input: ["text", "image", "audio", "video", "pdf"],
1050
+ output: ["text"],
1051
+ },
1052
+ knowledge: "2024-06",
1053
+ releaseDate: "2024-12-11",
1054
+ lastUpdated: "2024-12-11",
1055
+ family: "gemini-flash-lite",
1056
+ openWeights: false,
1057
+ structuredOutput: true,
1058
+ temperatureSupported: true,
609
1059
  disabled: true,
610
1060
  provider: "google",
611
1061
  },
@@ -613,7 +1063,7 @@ export const textModels = [
613
1063
  type: "text",
614
1064
  modelName: "gemini-1.5-flash",
615
1065
  description: "RETIRED: No longer available. Use gemini-2.5-flash instead.",
616
- maxInputTokens: 1_048_576,
1066
+ maxInputTokens: 1048576,
617
1067
  maxOutputTokens: 8192,
618
1068
  inputTokenCost: 0.01875,
619
1069
  outputTokenCost: 0.075,
@@ -626,7 +1076,7 @@ export const textModels = [
626
1076
  type: "text",
627
1077
  modelName: "gemini-1.5-pro",
628
1078
  description: "RETIRED: No longer available. Use gemini-2.5-pro instead.",
629
- maxInputTokens: 2_097_152,
1079
+ maxInputTokens: 2097152,
630
1080
  maxOutputTokens: 8192,
631
1081
  inputTokenCost: 0.3125,
632
1082
  outputTokenCost: 1.25,
@@ -639,7 +1089,7 @@ export const textModels = [
639
1089
  type: "text",
640
1090
  modelName: "gemini-1.0-pro",
641
1091
  description: "RETIRED: No longer available. Use gemini-2.5-flash instead.",
642
- maxInputTokens: 32_760,
1092
+ maxInputTokens: 32760,
643
1093
  maxOutputTokens: 8192,
644
1094
  inputTokenCost: 0.125,
645
1095
  outputTokenCost: 0.375,
@@ -651,10 +1101,11 @@ export const textModels = [
651
1101
  type: "text",
652
1102
  modelName: "claude-opus-4-8",
653
1103
  description: "The most capable Claude model for complex reasoning and agentic coding. Same per-token pricing as Opus 4.7 with improved tool-use efficiency (~290 tokens for tool-use system prompt vs 675 on 4.7). 1M context window, 128K max output.",
654
- maxInputTokens: 1_000_000,
655
- maxOutputTokens: 128_000,
1104
+ maxInputTokens: 1000000,
1105
+ maxOutputTokens: 128000,
656
1106
  inputTokenCost: 5,
657
1107
  cachedInputTokenCost: 0.5,
1108
+ cacheCreationInputTokenCost: 6.25,
658
1109
  outputTokenCost: 25,
659
1110
  reasoning: {
660
1111
  thinkingStyle: "adaptive",
@@ -662,14 +1113,23 @@ export const textModels = [
662
1113
  outputsThinking: true,
663
1114
  outputsSignatures: true,
664
1115
  },
1116
+ modalities: {
1117
+ input: ["text", "image", "pdf"],
1118
+ output: ["text"],
1119
+ },
1120
+ releaseDate: "2026-05-28",
1121
+ lastUpdated: "2026-05-28",
1122
+ family: "claude-opus",
1123
+ openWeights: false,
1124
+ temperatureSupported: false,
665
1125
  provider: "anthropic",
666
1126
  },
667
1127
  {
668
1128
  type: "text",
669
1129
  modelName: "claude-opus-4-7",
670
1130
  description: "Claude Opus 4.7 for complex reasoning and agentic coding. Features Adaptive Thinking that auto-tunes reasoning compute per request. 1M context window, 128K max output. Knowledge cutoff: January 2026.",
671
- maxInputTokens: 1_000_000,
672
- maxOutputTokens: 128_000,
1131
+ maxInputTokens: 1000000,
1132
+ maxOutputTokens: 128000,
673
1133
  inputTokenCost: 5,
674
1134
  cachedInputTokenCost: 0.5,
675
1135
  cacheCreationInputTokenCost: 6.25,
@@ -681,14 +1141,24 @@ export const textModels = [
681
1141
  outputsThinking: true,
682
1142
  outputsSignatures: true,
683
1143
  },
1144
+ modalities: {
1145
+ input: ["text", "image", "pdf"],
1146
+ output: ["text"],
1147
+ },
1148
+ knowledge: "2026-01-31",
1149
+ releaseDate: "2026-04-16",
1150
+ lastUpdated: "2026-04-16",
1151
+ family: "claude-opus",
1152
+ openWeights: false,
1153
+ temperatureSupported: false,
684
1154
  provider: "anthropic",
685
1155
  },
686
1156
  {
687
1157
  type: "text",
688
1158
  modelName: "claude-opus-4-6",
689
1159
  description: "Claude Opus 4.6 — legacy model. Use claude-opus-4-7 instead. 1M context window, 128K max output.",
690
- maxInputTokens: 1_000_000,
691
- maxOutputTokens: 128_000,
1160
+ maxInputTokens: 1000000,
1161
+ maxOutputTokens: 128000,
692
1162
  inputTokenCost: 5,
693
1163
  cachedInputTokenCost: 0.5,
694
1164
  cacheCreationInputTokenCost: 6.25,
@@ -700,14 +1170,24 @@ export const textModels = [
700
1170
  outputsThinking: true,
701
1171
  outputsSignatures: true,
702
1172
  },
1173
+ modalities: {
1174
+ input: ["text", "image", "pdf"],
1175
+ output: ["text"],
1176
+ },
1177
+ knowledge: "2025-05-31",
1178
+ releaseDate: "2026-02-05",
1179
+ lastUpdated: "2026-03-13",
1180
+ family: "claude-opus",
1181
+ openWeights: false,
1182
+ temperatureSupported: true,
703
1183
  provider: "anthropic",
704
1184
  },
705
1185
  {
706
1186
  type: "text",
707
1187
  modelName: "claude-sonnet-4-6",
708
1188
  description: "The best combination of speed and intelligence. 1M context window, 64K max output.",
709
- maxInputTokens: 1_000_000,
710
- maxOutputTokens: 64_000,
1189
+ maxInputTokens: 1000000,
1190
+ maxOutputTokens: 64000,
711
1191
  inputTokenCost: 3,
712
1192
  cachedInputTokenCost: 0.3,
713
1193
  cacheCreationInputTokenCost: 3.75,
@@ -719,14 +1199,24 @@ export const textModels = [
719
1199
  outputsThinking: true,
720
1200
  outputsSignatures: true,
721
1201
  },
1202
+ modalities: {
1203
+ input: ["text", "image", "pdf"],
1204
+ output: ["text"],
1205
+ },
1206
+ knowledge: "2025-08-31",
1207
+ releaseDate: "2026-02-17",
1208
+ lastUpdated: "2026-03-13",
1209
+ family: "claude-sonnet",
1210
+ openWeights: false,
1211
+ temperatureSupported: true,
722
1212
  provider: "anthropic",
723
1213
  },
724
1214
  {
725
1215
  type: "text",
726
1216
  modelName: "claude-haiku-4-5-20251001",
727
1217
  description: "The fastest Claude model with near-frontier intelligence. 200K context window, 64K max output.",
728
- maxInputTokens: 200_000,
729
- maxOutputTokens: 64_000,
1218
+ maxInputTokens: 200000,
1219
+ maxOutputTokens: 64000,
730
1220
  inputTokenCost: 1,
731
1221
  cachedInputTokenCost: 0.1,
732
1222
  cacheCreationInputTokenCost: 1.25,
@@ -738,13 +1228,23 @@ export const textModels = [
738
1228
  outputsThinking: true,
739
1229
  outputsSignatures: true,
740
1230
  },
1231
+ modalities: {
1232
+ input: ["text", "image", "pdf"],
1233
+ output: ["text"],
1234
+ },
1235
+ knowledge: "2025-02-28",
1236
+ releaseDate: "2025-10-15",
1237
+ lastUpdated: "2025-10-15",
1238
+ family: "claude-haiku",
1239
+ openWeights: false,
1240
+ temperatureSupported: true,
741
1241
  provider: "anthropic",
742
1242
  },
743
1243
  {
744
1244
  type: "text",
745
1245
  modelName: "claude-3-7-sonnet-latest",
746
1246
  description: "Claude 3.7 Sonnet — legacy model. Use claude-sonnet-4-6 instead.",
747
- maxInputTokens: 200_000,
1247
+ maxInputTokens: 200000,
748
1248
  maxOutputTokens: 8192,
749
1249
  inputTokenCost: 3,
750
1250
  outputTokenCost: 15,
@@ -762,7 +1262,7 @@ export const textModels = [
762
1262
  type: "text",
763
1263
  modelName: "claude-3-5-haiku-latest",
764
1264
  description: "Claude 3.5 Haiku — legacy model. Use claude-haiku-4-5-20251001 instead.",
765
- maxInputTokens: 200_000,
1265
+ maxInputTokens: 200000,
766
1266
  maxOutputTokens: 8192,
767
1267
  inputTokenCost: 0.8,
768
1268
  outputTokenCost: 4,
@@ -770,6 +1270,116 @@ export const textModels = [
770
1270
  disabled: true,
771
1271
  provider: "anthropic",
772
1272
  },
1273
+ {
1274
+ type: "text",
1275
+ modelName: "claude-haiku-4-5",
1276
+ description: "Undated alias for claude-haiku-4-5-20251001. The fastest Claude model with near-frontier intelligence.",
1277
+ maxInputTokens: 200000,
1278
+ maxOutputTokens: 64000,
1279
+ inputTokenCost: 1,
1280
+ cachedInputTokenCost: 0.1,
1281
+ cacheCreationInputTokenCost: 1.25,
1282
+ outputTokenCost: 5,
1283
+ reasoning: {
1284
+ thinkingStyle: "budget",
1285
+ canDisable: true,
1286
+ outputsThinking: true,
1287
+ outputsSignatures: true,
1288
+ },
1289
+ modalities: {
1290
+ input: ["text", "image", "pdf"],
1291
+ output: ["text"],
1292
+ },
1293
+ knowledge: "2025-02-28",
1294
+ releaseDate: "2025-10-15",
1295
+ lastUpdated: "2025-10-15",
1296
+ family: "claude-haiku",
1297
+ openWeights: false,
1298
+ temperatureSupported: true,
1299
+ provider: "anthropic",
1300
+ },
1301
+ {
1302
+ type: "text",
1303
+ modelName: "claude-opus-4-5",
1304
+ description: "Claude Opus 4.5 — earlier Opus generation. Prefer claude-opus-4-8.",
1305
+ maxInputTokens: 200000,
1306
+ maxOutputTokens: 64000,
1307
+ inputTokenCost: 5,
1308
+ cachedInputTokenCost: 0.5,
1309
+ cacheCreationInputTokenCost: 6.25,
1310
+ outputTokenCost: 25,
1311
+ reasoning: {
1312
+ thinkingStyle: "budget",
1313
+ canDisable: true,
1314
+ outputsThinking: true,
1315
+ outputsSignatures: true,
1316
+ },
1317
+ modalities: {
1318
+ input: ["text", "image", "pdf"],
1319
+ output: ["text"],
1320
+ },
1321
+ knowledge: "2025-03-31",
1322
+ releaseDate: "2025-11-24",
1323
+ lastUpdated: "2025-11-24",
1324
+ family: "claude-opus",
1325
+ openWeights: false,
1326
+ temperatureSupported: true,
1327
+ provider: "anthropic",
1328
+ },
1329
+ {
1330
+ type: "text",
1331
+ modelName: "claude-sonnet-4-5",
1332
+ description: "Claude Sonnet 4.5 — earlier Sonnet generation. Prefer claude-sonnet-4-6.",
1333
+ maxInputTokens: 200000,
1334
+ maxOutputTokens: 64000,
1335
+ inputTokenCost: 3,
1336
+ cachedInputTokenCost: 0.3,
1337
+ cacheCreationInputTokenCost: 3.75,
1338
+ outputTokenCost: 15,
1339
+ reasoning: {
1340
+ thinkingStyle: "budget",
1341
+ canDisable: true,
1342
+ outputsThinking: true,
1343
+ outputsSignatures: true,
1344
+ },
1345
+ modalities: {
1346
+ input: ["text", "image", "pdf"],
1347
+ output: ["text"],
1348
+ },
1349
+ knowledge: "2025-07-31",
1350
+ releaseDate: "2025-09-29",
1351
+ lastUpdated: "2025-09-29",
1352
+ family: "claude-sonnet",
1353
+ openWeights: false,
1354
+ temperatureSupported: true,
1355
+ provider: "anthropic",
1356
+ },
1357
+ {
1358
+ type: "text",
1359
+ modelName: "gpt-5-pro",
1360
+ description: "GPT-5 Pro uses more compute for complex reasoning tasks. Available via the Responses API.",
1361
+ maxInputTokens: 400000,
1362
+ maxOutputTokens: 272000,
1363
+ inputTokenCost: 15,
1364
+ outputTokenCost: 120,
1365
+ reasoning: {
1366
+ canDisable: false,
1367
+ outputsThinking: false,
1368
+ outputsSignatures: false,
1369
+ },
1370
+ modalities: {
1371
+ input: ["text", "image"],
1372
+ output: ["text"],
1373
+ },
1374
+ knowledge: "2024-09-30",
1375
+ releaseDate: "2025-10-06",
1376
+ lastUpdated: "2025-10-06",
1377
+ family: "gpt-pro",
1378
+ openWeights: false,
1379
+ structuredOutput: true,
1380
+ temperatureSupported: false,
1381
+ provider: "openai-responses",
1382
+ },
773
1383
  ];
774
1384
  export const imageModels = [
775
1385
  {
@@ -847,19 +1457,185 @@ export const embeddingsModels = [
847
1457
  tokenCost: 0.2,
848
1458
  },
849
1459
  ];
1460
+ export const hostedTools = [
1461
+ {
1462
+ name: "web_search",
1463
+ provider: "anthropic",
1464
+ category: "web_search",
1465
+ description: "Server-side web search with citations.",
1466
+ providerToolId: "web_search",
1467
+ pricing: { unit: "per_call", amount: 0.01, note: "$10 per 1,000 searches, plus content tokens." },
1468
+ },
1469
+ {
1470
+ name: "web_fetch",
1471
+ provider: "anthropic",
1472
+ category: "url_context",
1473
+ description: "Fetch and read a specific URL.",
1474
+ providerToolId: "web_fetch",
1475
+ pricing: { unit: "free", note: "No extra charge beyond tokens." },
1476
+ },
1477
+ {
1478
+ name: "code_execution",
1479
+ provider: "anthropic",
1480
+ category: "code_execution",
1481
+ description: "Run code in a sandboxed container.",
1482
+ providerToolId: "code_execution",
1483
+ pricing: { unit: "per_hour", amount: 0.05, freeAllowance: "50 container-hours/day", note: "Free when used with web_search or web_fetch." },
1484
+ },
1485
+ {
1486
+ name: "web_search",
1487
+ provider: "openai-responses",
1488
+ category: "web_search",
1489
+ description: "Server-side web search (Responses API).",
1490
+ providerToolId: "web_search",
1491
+ pricing: { unit: "per_call", amount: 0.01, note: "$10/1k standard; $25/1k preview non-reasoning; plus ~8k input tokens per call. Varies by search_context_size." },
1492
+ },
1493
+ {
1494
+ name: "file_search",
1495
+ provider: "openai-responses",
1496
+ category: "file_search",
1497
+ description: "Semantic + keyword search over uploaded files.",
1498
+ providerToolId: "file_search",
1499
+ pricing: { unit: "per_call", amount: 0.0025, note: "$2.50 per 1,000 calls, plus $0.10/GB-day vector storage." },
1500
+ },
1501
+ {
1502
+ name: "code_interpreter",
1503
+ provider: "openai-responses",
1504
+ category: "code_execution",
1505
+ description: "Run Python in a sandboxed container.",
1506
+ providerToolId: "code_interpreter",
1507
+ pricing: { unit: "per_session", amount: 0.03, note: "Per container session." },
1508
+ },
1509
+ {
1510
+ name: "image_generation",
1511
+ provider: "openai-responses",
1512
+ category: "image_generation",
1513
+ description: "Generate images with gpt-image-1 as a tool.",
1514
+ providerToolId: "image_generation",
1515
+ pricing: { unit: "tokens", note: "gpt-image-1 token pricing: $5/$10/$40 per 1M text-in/image-in/image-out." },
1516
+ },
1517
+ {
1518
+ name: "google_search",
1519
+ provider: "google",
1520
+ category: "web_search",
1521
+ description: "Grounding with Google Search.",
1522
+ providerToolId: "google_search",
1523
+ pricing: {
1524
+ unit: "per_call",
1525
+ amount: 0.014,
1526
+ freeAllowance: "5,000 grounded prompts/month (Gemini 3)",
1527
+ note: "Billed per query; a request may issue multiple queries.",
1528
+ perModel: {
1529
+ "gemini-2.5-pro": { amount: 0.035, freeAllowance: "1,500/day shared", note: "Billed per prompt (Gemini 2.5)." },
1530
+ "gemini-2.5-flash": { amount: 0.035, freeAllowance: "1,500/day shared", note: "Billed per prompt (Gemini 2.5)." },
1531
+ "gemini-2.5-flash-lite": { amount: 0.035, freeAllowance: "1,500/day shared", note: "Billed per prompt (Gemini 2.5)." },
1532
+ },
1533
+ },
1534
+ },
1535
+ {
1536
+ name: "code_execution",
1537
+ provider: "google",
1538
+ category: "code_execution",
1539
+ description: "Run Python generated by the model.",
1540
+ providerToolId: "code_execution",
1541
+ pricing: { unit: "tokens", note: "Billed as tokens; no separate tool fee." },
1542
+ },
1543
+ {
1544
+ name: "url_context",
1545
+ provider: "google",
1546
+ category: "url_context",
1547
+ description: "Ground responses on specific URLs you provide.",
1548
+ providerToolId: "url_context",
1549
+ pricing: { unit: "tokens", note: "Tokens only." },
1550
+ },
1551
+ {
1552
+ name: "maps_grounding",
1553
+ provider: "google",
1554
+ category: "maps_grounding",
1555
+ description: "Grounding with Google Maps (Gemini 3 only).",
1556
+ providerToolId: "google_maps",
1557
+ models: ["gemini-3-pro-preview", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-3.5-flash", "gemini-3.1-flash-lite"],
1558
+ pricing: { unit: "per_call", note: "Gemini 3 family only; see Google pricing." },
1559
+ },
1560
+ ];
850
1561
  export const registeredTextModels = [];
851
1562
  export function registerTextModel(model) {
852
1563
  registeredTextModels.push({ ...model, type: "text" });
853
1564
  }
854
- export function getModel(modelName) {
855
- const allModels = [
1565
+ let registeredModelData = null;
1566
+ export function registerModelData(blob) {
1567
+ registeredModelData = blob;
1568
+ }
1569
+ export function clearModelData() {
1570
+ registeredModelData = null;
1571
+ }
1572
+ export function getRegisteredModelData() {
1573
+ return registeredModelData;
1574
+ }
1575
+ function baselineModels() {
1576
+ return [
856
1577
  ...textModels,
857
1578
  ...imageModels,
858
1579
  ...speechToTextModels,
859
1580
  ...registeredTextModels,
860
1581
  ...embeddingsModels,
861
1582
  ];
862
- return allModels.find((model) => model.modelName === modelName);
1583
+ }
1584
+ export function getModel(modelName, requestData) {
1585
+ let models = baselineModels();
1586
+ if (registeredModelData) {
1587
+ models = mergeModelData(models, registeredModelData.models);
1588
+ }
1589
+ if (requestData) {
1590
+ models = mergeModelData(models, requestData.models);
1591
+ }
1592
+ return models.find((model) => model.modelName === modelName);
1593
+ }
1594
+ export function getHostedTools(opts = {}) {
1595
+ // Start from a copy so callers can never mutate the baseline registry.
1596
+ let tools = [...hostedTools];
1597
+ if (registeredModelData) {
1598
+ tools = mergeHostedTools(tools, registeredModelData.hostedTools);
1599
+ }
1600
+ if (opts.modelData) {
1601
+ tools = mergeHostedTools(tools, opts.modelData.hostedTools);
1602
+ }
1603
+ let modelProvider;
1604
+ if (opts.model) {
1605
+ modelProvider = getModel(opts.model, opts.modelData)?.provider;
1606
+ }
1607
+ return tools.filter((tool) => {
1608
+ if (tool.disabled && !opts.includeDisabled) {
1609
+ return false;
1610
+ }
1611
+ if (opts.provider && tool.provider !== opts.provider) {
1612
+ return false;
1613
+ }
1614
+ if (opts.category && tool.category !== opts.category) {
1615
+ return false;
1616
+ }
1617
+ if (opts.model) {
1618
+ if (tool.provider !== modelProvider) {
1619
+ return false;
1620
+ }
1621
+ if (tool.models && !tool.models.includes(opts.model)) {
1622
+ return false;
1623
+ }
1624
+ }
1625
+ return true;
1626
+ });
1627
+ }
1628
+ export function hostedToolPricingFor(tool, model) {
1629
+ if (!tool.pricing) {
1630
+ return undefined;
1631
+ }
1632
+ // Drop perModel from the base; merge the override for `model` when present.
1633
+ // The return type is HostedToolPrice, so the result can never carry perModel.
1634
+ const { perModel, ...base } = tool.pricing;
1635
+ if (model && perModel && perModel[model]) {
1636
+ return { ...base, ...perModel[model] };
1637
+ }
1638
+ return base;
863
1639
  }
864
1640
  export function isImageModel(model) {
865
1641
  return model.type === "image";