llm.rb 4.8.0 → 4.10.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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +356 -583
  3. data/data/anthropic.json +770 -0
  4. data/data/deepseek.json +75 -0
  5. data/data/google.json +1050 -0
  6. data/data/openai.json +1421 -0
  7. data/data/xai.json +792 -0
  8. data/data/zai.json +330 -0
  9. data/lib/llm/agent.rb +42 -41
  10. data/lib/llm/bot.rb +1 -263
  11. data/lib/llm/buffer.rb +7 -0
  12. data/lib/llm/{session → context}/deserializer.rb +4 -3
  13. data/lib/llm/context.rb +292 -0
  14. data/lib/llm/cost.rb +26 -0
  15. data/lib/llm/error.rb +8 -0
  16. data/lib/llm/function/array.rb +61 -0
  17. data/lib/llm/function/fiber_group.rb +91 -0
  18. data/lib/llm/function/task_group.rb +89 -0
  19. data/lib/llm/function/thread_group.rb +94 -0
  20. data/lib/llm/function.rb +75 -10
  21. data/lib/llm/mcp/command.rb +108 -0
  22. data/lib/llm/mcp/error.rb +31 -0
  23. data/lib/llm/mcp/pipe.rb +82 -0
  24. data/lib/llm/mcp/rpc.rb +118 -0
  25. data/lib/llm/mcp/transport/http/event_handler.rb +66 -0
  26. data/lib/llm/mcp/transport/http.rb +122 -0
  27. data/lib/llm/mcp/transport/stdio.rb +85 -0
  28. data/lib/llm/mcp.rb +116 -0
  29. data/lib/llm/message.rb +13 -11
  30. data/lib/llm/model.rb +2 -2
  31. data/lib/llm/prompt.rb +17 -7
  32. data/lib/llm/provider.rb +32 -17
  33. data/lib/llm/providers/anthropic/files.rb +3 -3
  34. data/lib/llm/providers/anthropic.rb +19 -4
  35. data/lib/llm/providers/deepseek.rb +10 -3
  36. data/lib/llm/providers/{gemini → google}/audio.rb +6 -6
  37. data/lib/llm/providers/{gemini → google}/error_handler.rb +2 -2
  38. data/lib/llm/providers/{gemini → google}/files.rb +11 -11
  39. data/lib/llm/providers/{gemini → google}/images.rb +7 -7
  40. data/lib/llm/providers/{gemini → google}/models.rb +5 -5
  41. data/lib/llm/providers/{gemini → google}/request_adapter/completion.rb +7 -3
  42. data/lib/llm/providers/{gemini → google}/request_adapter.rb +1 -1
  43. data/lib/llm/providers/{gemini → google}/response_adapter/completion.rb +7 -7
  44. data/lib/llm/providers/{gemini → google}/response_adapter/embedding.rb +1 -1
  45. data/lib/llm/providers/{gemini → google}/response_adapter/file.rb +1 -1
  46. data/lib/llm/providers/{gemini → google}/response_adapter/files.rb +1 -1
  47. data/lib/llm/providers/{gemini → google}/response_adapter/image.rb +1 -1
  48. data/lib/llm/providers/{gemini → google}/response_adapter/models.rb +1 -1
  49. data/lib/llm/providers/{gemini → google}/response_adapter/web_search.rb +2 -2
  50. data/lib/llm/providers/{gemini → google}/response_adapter.rb +8 -8
  51. data/lib/llm/providers/{gemini → google}/stream_parser.rb +3 -3
  52. data/lib/llm/providers/{gemini.rb → google.rb} +41 -26
  53. data/lib/llm/providers/llamacpp.rb +10 -3
  54. data/lib/llm/providers/ollama.rb +19 -4
  55. data/lib/llm/providers/openai/files.rb +3 -3
  56. data/lib/llm/providers/openai/response_adapter/completion.rb +9 -1
  57. data/lib/llm/providers/openai/response_adapter/responds.rb +9 -1
  58. data/lib/llm/providers/openai/responses.rb +9 -1
  59. data/lib/llm/providers/openai/stream_parser.rb +2 -0
  60. data/lib/llm/providers/openai.rb +19 -4
  61. data/lib/llm/providers/xai.rb +10 -3
  62. data/lib/llm/providers/zai.rb +9 -2
  63. data/lib/llm/registry.rb +81 -0
  64. data/lib/llm/schema/all_of.rb +31 -0
  65. data/lib/llm/schema/any_of.rb +31 -0
  66. data/lib/llm/schema/one_of.rb +31 -0
  67. data/lib/llm/schema/parser.rb +145 -0
  68. data/lib/llm/schema.rb +49 -8
  69. data/lib/llm/server_tool.rb +5 -5
  70. data/lib/llm/session.rb +10 -1
  71. data/lib/llm/tool.rb +88 -6
  72. data/lib/llm/tracer/logger.rb +1 -1
  73. data/lib/llm/tracer/telemetry.rb +7 -7
  74. data/lib/llm/tracer.rb +3 -3
  75. data/lib/llm/usage.rb +5 -0
  76. data/lib/llm/version.rb +1 -1
  77. data/lib/llm.rb +39 -6
  78. data/llm.gemspec +45 -8
  79. metadata +86 -28
data/data/openai.json ADDED
@@ -0,0 +1,1421 @@
1
+ {
2
+ "id": "openai",
3
+ "env": [
4
+ "OPENAI_API_KEY"
5
+ ],
6
+ "npm": "@ai-sdk/openai",
7
+ "name": "OpenAI",
8
+ "doc": "https://platform.openai.com/docs/models",
9
+ "models": {
10
+ "gpt-4o-2024-11-20": {
11
+ "id": "gpt-4o-2024-11-20",
12
+ "name": "GPT-4o (2024-11-20)",
13
+ "family": "gpt",
14
+ "attachment": true,
15
+ "reasoning": false,
16
+ "tool_call": true,
17
+ "structured_output": true,
18
+ "temperature": true,
19
+ "knowledge": "2023-09",
20
+ "release_date": "2024-11-20",
21
+ "last_updated": "2024-11-20",
22
+ "modalities": {
23
+ "input": [
24
+ "text",
25
+ "image"
26
+ ],
27
+ "output": [
28
+ "text"
29
+ ]
30
+ },
31
+ "open_weights": false,
32
+ "cost": {
33
+ "input": 2.5,
34
+ "output": 10,
35
+ "cache_read": 1.25
36
+ },
37
+ "limit": {
38
+ "context": 128000,
39
+ "output": 16384
40
+ }
41
+ },
42
+ "gpt-5.3-codex": {
43
+ "id": "gpt-5.3-codex",
44
+ "name": "GPT-5.3 Codex",
45
+ "family": "gpt-codex",
46
+ "attachment": true,
47
+ "reasoning": true,
48
+ "tool_call": true,
49
+ "structured_output": true,
50
+ "temperature": false,
51
+ "knowledge": "2025-08-31",
52
+ "release_date": "2026-02-05",
53
+ "last_updated": "2026-02-05",
54
+ "modalities": {
55
+ "input": [
56
+ "text",
57
+ "image",
58
+ "pdf"
59
+ ],
60
+ "output": [
61
+ "text"
62
+ ]
63
+ },
64
+ "open_weights": false,
65
+ "cost": {
66
+ "input": 1.75,
67
+ "output": 14,
68
+ "cache_read": 0.175
69
+ },
70
+ "limit": {
71
+ "context": 400000,
72
+ "input": 272000,
73
+ "output": 128000
74
+ }
75
+ },
76
+ "gpt-5-codex": {
77
+ "id": "gpt-5-codex",
78
+ "name": "GPT-5-Codex",
79
+ "family": "gpt-codex",
80
+ "attachment": false,
81
+ "reasoning": true,
82
+ "tool_call": true,
83
+ "structured_output": true,
84
+ "temperature": false,
85
+ "knowledge": "2024-09-30",
86
+ "release_date": "2025-09-15",
87
+ "last_updated": "2025-09-15",
88
+ "modalities": {
89
+ "input": [
90
+ "text",
91
+ "image"
92
+ ],
93
+ "output": [
94
+ "text"
95
+ ]
96
+ },
97
+ "open_weights": false,
98
+ "cost": {
99
+ "input": 1.25,
100
+ "output": 10,
101
+ "cache_read": 0.125
102
+ },
103
+ "limit": {
104
+ "context": 400000,
105
+ "input": 272000,
106
+ "output": 128000
107
+ }
108
+ },
109
+ "gpt-5-pro": {
110
+ "id": "gpt-5-pro",
111
+ "name": "GPT-5 Pro",
112
+ "family": "gpt-pro",
113
+ "attachment": true,
114
+ "reasoning": true,
115
+ "tool_call": true,
116
+ "structured_output": true,
117
+ "temperature": false,
118
+ "knowledge": "2024-09-30",
119
+ "release_date": "2025-10-06",
120
+ "last_updated": "2025-10-06",
121
+ "modalities": {
122
+ "input": [
123
+ "text",
124
+ "image"
125
+ ],
126
+ "output": [
127
+ "text"
128
+ ]
129
+ },
130
+ "open_weights": false,
131
+ "cost": {
132
+ "input": 15,
133
+ "output": 120
134
+ },
135
+ "limit": {
136
+ "context": 400000,
137
+ "input": 272000,
138
+ "output": 272000
139
+ }
140
+ },
141
+ "gpt-4o-mini": {
142
+ "id": "gpt-4o-mini",
143
+ "name": "GPT-4o mini",
144
+ "family": "gpt-mini",
145
+ "attachment": true,
146
+ "reasoning": false,
147
+ "tool_call": true,
148
+ "structured_output": true,
149
+ "temperature": true,
150
+ "knowledge": "2023-09",
151
+ "release_date": "2024-07-18",
152
+ "last_updated": "2024-07-18",
153
+ "modalities": {
154
+ "input": [
155
+ "text",
156
+ "image"
157
+ ],
158
+ "output": [
159
+ "text"
160
+ ]
161
+ },
162
+ "open_weights": false,
163
+ "cost": {
164
+ "input": 0.15,
165
+ "output": 0.6,
166
+ "cache_read": 0.08
167
+ },
168
+ "limit": {
169
+ "context": 128000,
170
+ "output": 16384
171
+ }
172
+ },
173
+ "text-embedding-ada-002": {
174
+ "id": "text-embedding-ada-002",
175
+ "name": "text-embedding-ada-002",
176
+ "family": "text-embedding",
177
+ "attachment": false,
178
+ "reasoning": false,
179
+ "tool_call": false,
180
+ "temperature": false,
181
+ "knowledge": "2022-12",
182
+ "release_date": "2022-12-15",
183
+ "last_updated": "2022-12-15",
184
+ "modalities": {
185
+ "input": [
186
+ "text"
187
+ ],
188
+ "output": [
189
+ "text"
190
+ ]
191
+ },
192
+ "open_weights": false,
193
+ "cost": {
194
+ "input": 0.1,
195
+ "output": 0
196
+ },
197
+ "limit": {
198
+ "context": 8192,
199
+ "output": 1536
200
+ }
201
+ },
202
+ "gpt-5-chat-latest": {
203
+ "id": "gpt-5-chat-latest",
204
+ "name": "GPT-5 Chat (latest)",
205
+ "family": "gpt-codex",
206
+ "attachment": true,
207
+ "reasoning": true,
208
+ "tool_call": false,
209
+ "structured_output": true,
210
+ "temperature": true,
211
+ "knowledge": "2024-09-30",
212
+ "release_date": "2025-08-07",
213
+ "last_updated": "2025-08-07",
214
+ "modalities": {
215
+ "input": [
216
+ "text",
217
+ "image"
218
+ ],
219
+ "output": [
220
+ "text"
221
+ ]
222
+ },
223
+ "open_weights": false,
224
+ "cost": {
225
+ "input": 1.25,
226
+ "output": 10
227
+ },
228
+ "limit": {
229
+ "context": 400000,
230
+ "input": 272000,
231
+ "output": 128000
232
+ }
233
+ },
234
+ "codex-mini-latest": {
235
+ "id": "codex-mini-latest",
236
+ "name": "Codex Mini",
237
+ "family": "gpt-codex-mini",
238
+ "attachment": true,
239
+ "reasoning": true,
240
+ "tool_call": true,
241
+ "temperature": false,
242
+ "knowledge": "2024-04",
243
+ "release_date": "2025-05-16",
244
+ "last_updated": "2025-05-16",
245
+ "modalities": {
246
+ "input": [
247
+ "text"
248
+ ],
249
+ "output": [
250
+ "text"
251
+ ]
252
+ },
253
+ "open_weights": false,
254
+ "cost": {
255
+ "input": 1.5,
256
+ "output": 6,
257
+ "cache_read": 0.375
258
+ },
259
+ "limit": {
260
+ "context": 200000,
261
+ "output": 100000
262
+ }
263
+ },
264
+ "gpt-5.1-codex-max": {
265
+ "id": "gpt-5.1-codex-max",
266
+ "name": "GPT-5.1 Codex Max",
267
+ "family": "gpt-codex",
268
+ "attachment": true,
269
+ "reasoning": true,
270
+ "tool_call": true,
271
+ "structured_output": true,
272
+ "temperature": false,
273
+ "knowledge": "2024-09-30",
274
+ "release_date": "2025-11-13",
275
+ "last_updated": "2025-11-13",
276
+ "modalities": {
277
+ "input": [
278
+ "text",
279
+ "image"
280
+ ],
281
+ "output": [
282
+ "text"
283
+ ]
284
+ },
285
+ "open_weights": false,
286
+ "cost": {
287
+ "input": 1.25,
288
+ "output": 10,
289
+ "cache_read": 0.125
290
+ },
291
+ "limit": {
292
+ "context": 400000,
293
+ "input": 272000,
294
+ "output": 128000
295
+ }
296
+ },
297
+ "gpt-4o-2024-05-13": {
298
+ "id": "gpt-4o-2024-05-13",
299
+ "name": "GPT-4o (2024-05-13)",
300
+ "family": "gpt",
301
+ "attachment": true,
302
+ "reasoning": false,
303
+ "tool_call": true,
304
+ "structured_output": true,
305
+ "temperature": true,
306
+ "knowledge": "2023-09",
307
+ "release_date": "2024-05-13",
308
+ "last_updated": "2024-05-13",
309
+ "modalities": {
310
+ "input": [
311
+ "text",
312
+ "image"
313
+ ],
314
+ "output": [
315
+ "text"
316
+ ]
317
+ },
318
+ "open_weights": false,
319
+ "cost": {
320
+ "input": 5,
321
+ "output": 15
322
+ },
323
+ "limit": {
324
+ "context": 128000,
325
+ "output": 4096
326
+ }
327
+ },
328
+ "gpt-5.2-chat-latest": {
329
+ "id": "gpt-5.2-chat-latest",
330
+ "name": "GPT-5.2 Chat",
331
+ "family": "gpt-codex",
332
+ "attachment": true,
333
+ "reasoning": true,
334
+ "tool_call": true,
335
+ "structured_output": true,
336
+ "temperature": false,
337
+ "knowledge": "2025-08-31",
338
+ "release_date": "2025-12-11",
339
+ "last_updated": "2025-12-11",
340
+ "modalities": {
341
+ "input": [
342
+ "text",
343
+ "image"
344
+ ],
345
+ "output": [
346
+ "text"
347
+ ]
348
+ },
349
+ "open_weights": false,
350
+ "cost": {
351
+ "input": 1.75,
352
+ "output": 14,
353
+ "cache_read": 0.175
354
+ },
355
+ "limit": {
356
+ "context": 128000,
357
+ "output": 16384
358
+ }
359
+ },
360
+ "gpt-5.2-codex": {
361
+ "id": "gpt-5.2-codex",
362
+ "name": "GPT-5.2 Codex",
363
+ "family": "gpt-codex",
364
+ "attachment": true,
365
+ "reasoning": true,
366
+ "tool_call": true,
367
+ "structured_output": true,
368
+ "temperature": false,
369
+ "knowledge": "2025-08-31",
370
+ "release_date": "2025-12-11",
371
+ "last_updated": "2025-12-11",
372
+ "modalities": {
373
+ "input": [
374
+ "text",
375
+ "image",
376
+ "pdf"
377
+ ],
378
+ "output": [
379
+ "text"
380
+ ]
381
+ },
382
+ "open_weights": false,
383
+ "cost": {
384
+ "input": 1.75,
385
+ "output": 14,
386
+ "cache_read": 0.175
387
+ },
388
+ "limit": {
389
+ "context": 400000,
390
+ "input": 272000,
391
+ "output": 128000
392
+ }
393
+ },
394
+ "o3-deep-research": {
395
+ "id": "o3-deep-research",
396
+ "name": "o3-deep-research",
397
+ "family": "o",
398
+ "attachment": true,
399
+ "reasoning": true,
400
+ "tool_call": true,
401
+ "temperature": false,
402
+ "knowledge": "2024-05",
403
+ "release_date": "2024-06-26",
404
+ "last_updated": "2024-06-26",
405
+ "modalities": {
406
+ "input": [
407
+ "text",
408
+ "image"
409
+ ],
410
+ "output": [
411
+ "text"
412
+ ]
413
+ },
414
+ "open_weights": false,
415
+ "cost": {
416
+ "input": 10,
417
+ "output": 40,
418
+ "cache_read": 2.5
419
+ },
420
+ "limit": {
421
+ "context": 200000,
422
+ "output": 100000
423
+ }
424
+ },
425
+ "o1": {
426
+ "id": "o1",
427
+ "name": "o1",
428
+ "family": "o",
429
+ "attachment": true,
430
+ "reasoning": true,
431
+ "tool_call": true,
432
+ "structured_output": true,
433
+ "temperature": false,
434
+ "knowledge": "2023-09",
435
+ "release_date": "2024-12-05",
436
+ "last_updated": "2024-12-05",
437
+ "modalities": {
438
+ "input": [
439
+ "text",
440
+ "image"
441
+ ],
442
+ "output": [
443
+ "text"
444
+ ]
445
+ },
446
+ "open_weights": false,
447
+ "cost": {
448
+ "input": 15,
449
+ "output": 60,
450
+ "cache_read": 7.5
451
+ },
452
+ "limit": {
453
+ "context": 200000,
454
+ "output": 100000
455
+ }
456
+ },
457
+ "gpt-5.1": {
458
+ "id": "gpt-5.1",
459
+ "name": "GPT-5.1",
460
+ "family": "gpt",
461
+ "attachment": true,
462
+ "reasoning": true,
463
+ "tool_call": true,
464
+ "structured_output": true,
465
+ "temperature": false,
466
+ "knowledge": "2024-09-30",
467
+ "release_date": "2025-11-13",
468
+ "last_updated": "2025-11-13",
469
+ "modalities": {
470
+ "input": [
471
+ "text",
472
+ "image"
473
+ ],
474
+ "output": [
475
+ "text"
476
+ ]
477
+ },
478
+ "open_weights": false,
479
+ "cost": {
480
+ "input": 1.25,
481
+ "output": 10,
482
+ "cache_read": 0.13
483
+ },
484
+ "limit": {
485
+ "context": 400000,
486
+ "input": 272000,
487
+ "output": 128000
488
+ }
489
+ },
490
+ "o4-mini-deep-research": {
491
+ "id": "o4-mini-deep-research",
492
+ "name": "o4-mini-deep-research",
493
+ "family": "o-mini",
494
+ "attachment": true,
495
+ "reasoning": true,
496
+ "tool_call": true,
497
+ "temperature": false,
498
+ "knowledge": "2024-05",
499
+ "release_date": "2024-06-26",
500
+ "last_updated": "2024-06-26",
501
+ "modalities": {
502
+ "input": [
503
+ "text",
504
+ "image"
505
+ ],
506
+ "output": [
507
+ "text"
508
+ ]
509
+ },
510
+ "open_weights": false,
511
+ "cost": {
512
+ "input": 2,
513
+ "output": 8,
514
+ "cache_read": 0.5
515
+ },
516
+ "limit": {
517
+ "context": 200000,
518
+ "output": 100000
519
+ }
520
+ },
521
+ "gpt-5.3-codex-spark": {
522
+ "id": "gpt-5.3-codex-spark",
523
+ "name": "GPT-5.3 Codex Spark",
524
+ "family": "gpt-codex-spark",
525
+ "attachment": true,
526
+ "reasoning": true,
527
+ "tool_call": true,
528
+ "structured_output": true,
529
+ "temperature": false,
530
+ "knowledge": "2025-08-31",
531
+ "release_date": "2026-02-05",
532
+ "last_updated": "2026-02-05",
533
+ "modalities": {
534
+ "input": [
535
+ "text",
536
+ "image",
537
+ "pdf"
538
+ ],
539
+ "output": [
540
+ "text"
541
+ ]
542
+ },
543
+ "open_weights": false,
544
+ "cost": {
545
+ "input": 1.75,
546
+ "output": 14,
547
+ "cache_read": 0.175
548
+ },
549
+ "limit": {
550
+ "context": 128000,
551
+ "input": 100000,
552
+ "output": 32000
553
+ }
554
+ },
555
+ "o3": {
556
+ "id": "o3",
557
+ "name": "o3",
558
+ "family": "o",
559
+ "attachment": true,
560
+ "reasoning": true,
561
+ "tool_call": true,
562
+ "structured_output": true,
563
+ "temperature": false,
564
+ "knowledge": "2024-05",
565
+ "release_date": "2025-04-16",
566
+ "last_updated": "2025-04-16",
567
+ "modalities": {
568
+ "input": [
569
+ "text",
570
+ "image"
571
+ ],
572
+ "output": [
573
+ "text"
574
+ ]
575
+ },
576
+ "open_weights": false,
577
+ "cost": {
578
+ "input": 2,
579
+ "output": 8,
580
+ "cache_read": 0.5
581
+ },
582
+ "limit": {
583
+ "context": 200000,
584
+ "output": 100000
585
+ }
586
+ },
587
+ "text-embedding-3-small": {
588
+ "id": "text-embedding-3-small",
589
+ "name": "text-embedding-3-small",
590
+ "family": "text-embedding",
591
+ "attachment": false,
592
+ "reasoning": false,
593
+ "tool_call": false,
594
+ "temperature": false,
595
+ "knowledge": "2024-01",
596
+ "release_date": "2024-01-25",
597
+ "last_updated": "2024-01-25",
598
+ "modalities": {
599
+ "input": [
600
+ "text"
601
+ ],
602
+ "output": [
603
+ "text"
604
+ ]
605
+ },
606
+ "open_weights": false,
607
+ "cost": {
608
+ "input": 0.02,
609
+ "output": 0
610
+ },
611
+ "limit": {
612
+ "context": 8191,
613
+ "output": 1536
614
+ }
615
+ },
616
+ "gpt-4.1-nano": {
617
+ "id": "gpt-4.1-nano",
618
+ "name": "GPT-4.1 nano",
619
+ "family": "gpt-nano",
620
+ "attachment": true,
621
+ "reasoning": false,
622
+ "tool_call": true,
623
+ "structured_output": true,
624
+ "temperature": true,
625
+ "knowledge": "2024-04",
626
+ "release_date": "2025-04-14",
627
+ "last_updated": "2025-04-14",
628
+ "modalities": {
629
+ "input": [
630
+ "text",
631
+ "image"
632
+ ],
633
+ "output": [
634
+ "text"
635
+ ]
636
+ },
637
+ "open_weights": false,
638
+ "cost": {
639
+ "input": 0.1,
640
+ "output": 0.4,
641
+ "cache_read": 0.03
642
+ },
643
+ "limit": {
644
+ "context": 1047576,
645
+ "output": 32768
646
+ }
647
+ },
648
+ "text-embedding-3-large": {
649
+ "id": "text-embedding-3-large",
650
+ "name": "text-embedding-3-large",
651
+ "family": "text-embedding",
652
+ "attachment": false,
653
+ "reasoning": false,
654
+ "tool_call": false,
655
+ "temperature": false,
656
+ "knowledge": "2024-01",
657
+ "release_date": "2024-01-25",
658
+ "last_updated": "2024-01-25",
659
+ "modalities": {
660
+ "input": [
661
+ "text"
662
+ ],
663
+ "output": [
664
+ "text"
665
+ ]
666
+ },
667
+ "open_weights": false,
668
+ "cost": {
669
+ "input": 0.13,
670
+ "output": 0
671
+ },
672
+ "limit": {
673
+ "context": 8191,
674
+ "output": 3072
675
+ }
676
+ },
677
+ "gpt-3.5-turbo": {
678
+ "id": "gpt-3.5-turbo",
679
+ "name": "GPT-3.5-turbo",
680
+ "family": "gpt",
681
+ "attachment": false,
682
+ "reasoning": false,
683
+ "tool_call": false,
684
+ "structured_output": false,
685
+ "temperature": true,
686
+ "knowledge": "2021-09-01",
687
+ "release_date": "2023-03-01",
688
+ "last_updated": "2023-11-06",
689
+ "modalities": {
690
+ "input": [
691
+ "text"
692
+ ],
693
+ "output": [
694
+ "text"
695
+ ]
696
+ },
697
+ "open_weights": false,
698
+ "cost": {
699
+ "input": 0.5,
700
+ "output": 1.5,
701
+ "cache_read": 1.25
702
+ },
703
+ "limit": {
704
+ "context": 16385,
705
+ "output": 4096
706
+ }
707
+ },
708
+ "gpt-5.1-codex-mini": {
709
+ "id": "gpt-5.1-codex-mini",
710
+ "name": "GPT-5.1 Codex mini",
711
+ "family": "gpt-codex",
712
+ "attachment": true,
713
+ "reasoning": true,
714
+ "tool_call": true,
715
+ "structured_output": true,
716
+ "temperature": false,
717
+ "knowledge": "2024-09-30",
718
+ "release_date": "2025-11-13",
719
+ "last_updated": "2025-11-13",
720
+ "modalities": {
721
+ "input": [
722
+ "text",
723
+ "image"
724
+ ],
725
+ "output": [
726
+ "text"
727
+ ]
728
+ },
729
+ "open_weights": false,
730
+ "cost": {
731
+ "input": 0.25,
732
+ "output": 2,
733
+ "cache_read": 0.025
734
+ },
735
+ "limit": {
736
+ "context": 400000,
737
+ "input": 272000,
738
+ "output": 128000
739
+ }
740
+ },
741
+ "gpt-5.2": {
742
+ "id": "gpt-5.2",
743
+ "name": "GPT-5.2",
744
+ "family": "gpt",
745
+ "attachment": true,
746
+ "reasoning": true,
747
+ "tool_call": true,
748
+ "structured_output": true,
749
+ "temperature": false,
750
+ "knowledge": "2025-08-31",
751
+ "release_date": "2025-12-11",
752
+ "last_updated": "2025-12-11",
753
+ "modalities": {
754
+ "input": [
755
+ "text",
756
+ "image"
757
+ ],
758
+ "output": [
759
+ "text"
760
+ ]
761
+ },
762
+ "open_weights": false,
763
+ "cost": {
764
+ "input": 1.75,
765
+ "output": 14,
766
+ "cache_read": 0.175
767
+ },
768
+ "limit": {
769
+ "context": 400000,
770
+ "input": 272000,
771
+ "output": 128000
772
+ }
773
+ },
774
+ "gpt-4.1": {
775
+ "id": "gpt-4.1",
776
+ "name": "GPT-4.1",
777
+ "family": "gpt",
778
+ "attachment": true,
779
+ "reasoning": false,
780
+ "tool_call": true,
781
+ "structured_output": true,
782
+ "temperature": true,
783
+ "knowledge": "2024-04",
784
+ "release_date": "2025-04-14",
785
+ "last_updated": "2025-04-14",
786
+ "modalities": {
787
+ "input": [
788
+ "text",
789
+ "image"
790
+ ],
791
+ "output": [
792
+ "text"
793
+ ]
794
+ },
795
+ "open_weights": false,
796
+ "cost": {
797
+ "input": 2,
798
+ "output": 8,
799
+ "cache_read": 0.5
800
+ },
801
+ "limit": {
802
+ "context": 1047576,
803
+ "output": 32768
804
+ }
805
+ },
806
+ "o3-pro": {
807
+ "id": "o3-pro",
808
+ "name": "o3-pro",
809
+ "family": "o-pro",
810
+ "attachment": true,
811
+ "reasoning": true,
812
+ "tool_call": true,
813
+ "structured_output": true,
814
+ "temperature": false,
815
+ "knowledge": "2024-05",
816
+ "release_date": "2025-06-10",
817
+ "last_updated": "2025-06-10",
818
+ "modalities": {
819
+ "input": [
820
+ "text",
821
+ "image"
822
+ ],
823
+ "output": [
824
+ "text"
825
+ ]
826
+ },
827
+ "open_weights": false,
828
+ "cost": {
829
+ "input": 20,
830
+ "output": 80
831
+ },
832
+ "limit": {
833
+ "context": 200000,
834
+ "output": 100000
835
+ }
836
+ },
837
+ "gpt-4-turbo": {
838
+ "id": "gpt-4-turbo",
839
+ "name": "GPT-4 Turbo",
840
+ "family": "gpt",
841
+ "attachment": true,
842
+ "reasoning": false,
843
+ "tool_call": true,
844
+ "structured_output": false,
845
+ "temperature": true,
846
+ "knowledge": "2023-12",
847
+ "release_date": "2023-11-06",
848
+ "last_updated": "2024-04-09",
849
+ "modalities": {
850
+ "input": [
851
+ "text",
852
+ "image"
853
+ ],
854
+ "output": [
855
+ "text"
856
+ ]
857
+ },
858
+ "open_weights": false,
859
+ "cost": {
860
+ "input": 10,
861
+ "output": 30
862
+ },
863
+ "limit": {
864
+ "context": 128000,
865
+ "output": 4096
866
+ }
867
+ },
868
+ "gpt-5": {
869
+ "id": "gpt-5",
870
+ "name": "GPT-5",
871
+ "family": "gpt",
872
+ "attachment": true,
873
+ "reasoning": true,
874
+ "tool_call": true,
875
+ "structured_output": true,
876
+ "temperature": false,
877
+ "knowledge": "2024-09-30",
878
+ "release_date": "2025-08-07",
879
+ "last_updated": "2025-08-07",
880
+ "modalities": {
881
+ "input": [
882
+ "text",
883
+ "image"
884
+ ],
885
+ "output": [
886
+ "text"
887
+ ]
888
+ },
889
+ "open_weights": false,
890
+ "cost": {
891
+ "input": 1.25,
892
+ "output": 10,
893
+ "cache_read": 0.125
894
+ },
895
+ "limit": {
896
+ "context": 400000,
897
+ "input": 272000,
898
+ "output": 128000
899
+ }
900
+ },
901
+ "o4-mini": {
902
+ "id": "o4-mini",
903
+ "name": "o4-mini",
904
+ "family": "o-mini",
905
+ "attachment": true,
906
+ "reasoning": true,
907
+ "tool_call": true,
908
+ "structured_output": true,
909
+ "temperature": false,
910
+ "knowledge": "2024-05",
911
+ "release_date": "2025-04-16",
912
+ "last_updated": "2025-04-16",
913
+ "modalities": {
914
+ "input": [
915
+ "text",
916
+ "image"
917
+ ],
918
+ "output": [
919
+ "text"
920
+ ]
921
+ },
922
+ "open_weights": false,
923
+ "cost": {
924
+ "input": 1.1,
925
+ "output": 4.4,
926
+ "cache_read": 0.28
927
+ },
928
+ "limit": {
929
+ "context": 200000,
930
+ "output": 100000
931
+ }
932
+ },
933
+ "gpt-4.1-mini": {
934
+ "id": "gpt-4.1-mini",
935
+ "name": "GPT-4.1 mini",
936
+ "family": "gpt-mini",
937
+ "attachment": true,
938
+ "reasoning": false,
939
+ "tool_call": true,
940
+ "structured_output": true,
941
+ "temperature": true,
942
+ "knowledge": "2024-04",
943
+ "release_date": "2025-04-14",
944
+ "last_updated": "2025-04-14",
945
+ "modalities": {
946
+ "input": [
947
+ "text",
948
+ "image"
949
+ ],
950
+ "output": [
951
+ "text"
952
+ ]
953
+ },
954
+ "open_weights": false,
955
+ "cost": {
956
+ "input": 0.4,
957
+ "output": 1.6,
958
+ "cache_read": 0.1
959
+ },
960
+ "limit": {
961
+ "context": 1047576,
962
+ "output": 32768
963
+ }
964
+ },
965
+ "gpt-5.4": {
966
+ "id": "gpt-5.4",
967
+ "name": "GPT-5.4",
968
+ "family": "gpt",
969
+ "attachment": true,
970
+ "reasoning": true,
971
+ "tool_call": true,
972
+ "structured_output": true,
973
+ "temperature": false,
974
+ "knowledge": "2025-08-31",
975
+ "release_date": "2026-03-05",
976
+ "last_updated": "2026-03-05",
977
+ "modalities": {
978
+ "input": [
979
+ "text",
980
+ "image",
981
+ "pdf"
982
+ ],
983
+ "output": [
984
+ "text"
985
+ ]
986
+ },
987
+ "open_weights": false,
988
+ "cost": {
989
+ "input": 2.5,
990
+ "output": 15,
991
+ "cache_read": 0.25,
992
+ "context_over_200k": {
993
+ "input": 5,
994
+ "output": 22.5,
995
+ "cache_read": 0.5
996
+ }
997
+ },
998
+ "limit": {
999
+ "context": 1050000,
1000
+ "input": 922000,
1001
+ "output": 128000
1002
+ }
1003
+ },
1004
+ "o1-preview": {
1005
+ "id": "o1-preview",
1006
+ "name": "o1-preview",
1007
+ "family": "o",
1008
+ "attachment": false,
1009
+ "reasoning": true,
1010
+ "tool_call": false,
1011
+ "temperature": true,
1012
+ "knowledge": "2023-09",
1013
+ "release_date": "2024-09-12",
1014
+ "last_updated": "2024-09-12",
1015
+ "modalities": {
1016
+ "input": [
1017
+ "text"
1018
+ ],
1019
+ "output": [
1020
+ "text"
1021
+ ]
1022
+ },
1023
+ "open_weights": false,
1024
+ "cost": {
1025
+ "input": 15,
1026
+ "output": 60,
1027
+ "cache_read": 7.5
1028
+ },
1029
+ "limit": {
1030
+ "context": 128000,
1031
+ "output": 32768
1032
+ }
1033
+ },
1034
+ "gpt-5.4-pro": {
1035
+ "id": "gpt-5.4-pro",
1036
+ "name": "GPT-5.4 Pro",
1037
+ "family": "gpt-pro",
1038
+ "attachment": true,
1039
+ "reasoning": true,
1040
+ "tool_call": true,
1041
+ "structured_output": false,
1042
+ "temperature": false,
1043
+ "knowledge": "2025-08-31",
1044
+ "release_date": "2026-03-05",
1045
+ "last_updated": "2026-03-05",
1046
+ "modalities": {
1047
+ "input": [
1048
+ "text",
1049
+ "image"
1050
+ ],
1051
+ "output": [
1052
+ "text"
1053
+ ]
1054
+ },
1055
+ "open_weights": false,
1056
+ "cost": {
1057
+ "input": 30,
1058
+ "output": 180,
1059
+ "context_over_200k": {
1060
+ "input": 60,
1061
+ "output": 270
1062
+ }
1063
+ },
1064
+ "limit": {
1065
+ "context": 1050000,
1066
+ "input": 922000,
1067
+ "output": 128000
1068
+ }
1069
+ },
1070
+ "o1-pro": {
1071
+ "id": "o1-pro",
1072
+ "name": "o1-pro",
1073
+ "family": "o-pro",
1074
+ "attachment": true,
1075
+ "reasoning": true,
1076
+ "tool_call": true,
1077
+ "structured_output": true,
1078
+ "temperature": false,
1079
+ "knowledge": "2023-09",
1080
+ "release_date": "2025-03-19",
1081
+ "last_updated": "2025-03-19",
1082
+ "modalities": {
1083
+ "input": [
1084
+ "text",
1085
+ "image"
1086
+ ],
1087
+ "output": [
1088
+ "text"
1089
+ ]
1090
+ },
1091
+ "open_weights": false,
1092
+ "cost": {
1093
+ "input": 150,
1094
+ "output": 600
1095
+ },
1096
+ "limit": {
1097
+ "context": 200000,
1098
+ "output": 100000
1099
+ }
1100
+ },
1101
+ "gpt-5.1-codex": {
1102
+ "id": "gpt-5.1-codex",
1103
+ "name": "GPT-5.1 Codex",
1104
+ "family": "gpt-codex",
1105
+ "attachment": true,
1106
+ "reasoning": true,
1107
+ "tool_call": true,
1108
+ "structured_output": true,
1109
+ "temperature": false,
1110
+ "knowledge": "2024-09-30",
1111
+ "release_date": "2025-11-13",
1112
+ "last_updated": "2025-11-13",
1113
+ "modalities": {
1114
+ "input": [
1115
+ "text",
1116
+ "image"
1117
+ ],
1118
+ "output": [
1119
+ "text"
1120
+ ]
1121
+ },
1122
+ "open_weights": false,
1123
+ "cost": {
1124
+ "input": 1.25,
1125
+ "output": 10,
1126
+ "cache_read": 0.125
1127
+ },
1128
+ "limit": {
1129
+ "context": 400000,
1130
+ "input": 272000,
1131
+ "output": 128000
1132
+ }
1133
+ },
1134
+ "gpt-5.2-pro": {
1135
+ "id": "gpt-5.2-pro",
1136
+ "name": "GPT-5.2 Pro",
1137
+ "family": "gpt-pro",
1138
+ "attachment": true,
1139
+ "reasoning": true,
1140
+ "tool_call": true,
1141
+ "structured_output": false,
1142
+ "temperature": false,
1143
+ "knowledge": "2025-08-31",
1144
+ "release_date": "2025-12-11",
1145
+ "last_updated": "2025-12-11",
1146
+ "modalities": {
1147
+ "input": [
1148
+ "text",
1149
+ "image"
1150
+ ],
1151
+ "output": [
1152
+ "text"
1153
+ ]
1154
+ },
1155
+ "open_weights": false,
1156
+ "cost": {
1157
+ "input": 21,
1158
+ "output": 168
1159
+ },
1160
+ "limit": {
1161
+ "context": 400000,
1162
+ "input": 272000,
1163
+ "output": 128000
1164
+ }
1165
+ },
1166
+ "o3-mini": {
1167
+ "id": "o3-mini",
1168
+ "name": "o3-mini",
1169
+ "family": "o-mini",
1170
+ "attachment": false,
1171
+ "reasoning": true,
1172
+ "tool_call": true,
1173
+ "structured_output": true,
1174
+ "temperature": false,
1175
+ "knowledge": "2024-05",
1176
+ "release_date": "2024-12-20",
1177
+ "last_updated": "2025-01-29",
1178
+ "modalities": {
1179
+ "input": [
1180
+ "text"
1181
+ ],
1182
+ "output": [
1183
+ "text"
1184
+ ]
1185
+ },
1186
+ "open_weights": false,
1187
+ "cost": {
1188
+ "input": 1.1,
1189
+ "output": 4.4,
1190
+ "cache_read": 0.55
1191
+ },
1192
+ "limit": {
1193
+ "context": 200000,
1194
+ "output": 100000
1195
+ }
1196
+ },
1197
+ "gpt-4o-2024-08-06": {
1198
+ "id": "gpt-4o-2024-08-06",
1199
+ "name": "GPT-4o (2024-08-06)",
1200
+ "family": "gpt",
1201
+ "attachment": true,
1202
+ "reasoning": false,
1203
+ "tool_call": true,
1204
+ "structured_output": true,
1205
+ "temperature": true,
1206
+ "knowledge": "2023-09",
1207
+ "release_date": "2024-08-06",
1208
+ "last_updated": "2024-08-06",
1209
+ "modalities": {
1210
+ "input": [
1211
+ "text",
1212
+ "image"
1213
+ ],
1214
+ "output": [
1215
+ "text"
1216
+ ]
1217
+ },
1218
+ "open_weights": false,
1219
+ "cost": {
1220
+ "input": 2.5,
1221
+ "output": 10,
1222
+ "cache_read": 1.25
1223
+ },
1224
+ "limit": {
1225
+ "context": 128000,
1226
+ "output": 16384
1227
+ }
1228
+ },
1229
+ "gpt-5-mini": {
1230
+ "id": "gpt-5-mini",
1231
+ "name": "GPT-5 Mini",
1232
+ "family": "gpt-mini",
1233
+ "attachment": true,
1234
+ "reasoning": true,
1235
+ "tool_call": true,
1236
+ "structured_output": true,
1237
+ "temperature": false,
1238
+ "knowledge": "2024-05-30",
1239
+ "release_date": "2025-08-07",
1240
+ "last_updated": "2025-08-07",
1241
+ "modalities": {
1242
+ "input": [
1243
+ "text",
1244
+ "image"
1245
+ ],
1246
+ "output": [
1247
+ "text"
1248
+ ]
1249
+ },
1250
+ "open_weights": false,
1251
+ "cost": {
1252
+ "input": 0.25,
1253
+ "output": 2,
1254
+ "cache_read": 0.025
1255
+ },
1256
+ "limit": {
1257
+ "context": 400000,
1258
+ "input": 272000,
1259
+ "output": 128000
1260
+ }
1261
+ },
1262
+ "gpt-5.1-chat-latest": {
1263
+ "id": "gpt-5.1-chat-latest",
1264
+ "name": "GPT-5.1 Chat",
1265
+ "family": "gpt-codex",
1266
+ "attachment": true,
1267
+ "reasoning": true,
1268
+ "tool_call": true,
1269
+ "structured_output": true,
1270
+ "temperature": false,
1271
+ "knowledge": "2024-09-30",
1272
+ "release_date": "2025-11-13",
1273
+ "last_updated": "2025-11-13",
1274
+ "modalities": {
1275
+ "input": [
1276
+ "text",
1277
+ "image"
1278
+ ],
1279
+ "output": [
1280
+ "text"
1281
+ ]
1282
+ },
1283
+ "open_weights": false,
1284
+ "cost": {
1285
+ "input": 1.25,
1286
+ "output": 10,
1287
+ "cache_read": 0.125
1288
+ },
1289
+ "limit": {
1290
+ "context": 128000,
1291
+ "output": 16384
1292
+ }
1293
+ },
1294
+ "gpt-4": {
1295
+ "id": "gpt-4",
1296
+ "name": "GPT-4",
1297
+ "family": "gpt",
1298
+ "attachment": true,
1299
+ "reasoning": false,
1300
+ "tool_call": true,
1301
+ "structured_output": false,
1302
+ "temperature": true,
1303
+ "knowledge": "2023-11",
1304
+ "release_date": "2023-11-06",
1305
+ "last_updated": "2024-04-09",
1306
+ "modalities": {
1307
+ "input": [
1308
+ "text"
1309
+ ],
1310
+ "output": [
1311
+ "text"
1312
+ ]
1313
+ },
1314
+ "open_weights": false,
1315
+ "cost": {
1316
+ "input": 30,
1317
+ "output": 60
1318
+ },
1319
+ "limit": {
1320
+ "context": 8192,
1321
+ "output": 8192
1322
+ }
1323
+ },
1324
+ "gpt-5-nano": {
1325
+ "id": "gpt-5-nano",
1326
+ "name": "GPT-5 Nano",
1327
+ "family": "gpt-nano",
1328
+ "attachment": true,
1329
+ "reasoning": true,
1330
+ "tool_call": true,
1331
+ "structured_output": true,
1332
+ "temperature": false,
1333
+ "knowledge": "2024-05-30",
1334
+ "release_date": "2025-08-07",
1335
+ "last_updated": "2025-08-07",
1336
+ "modalities": {
1337
+ "input": [
1338
+ "text",
1339
+ "image"
1340
+ ],
1341
+ "output": [
1342
+ "text"
1343
+ ]
1344
+ },
1345
+ "open_weights": false,
1346
+ "cost": {
1347
+ "input": 0.05,
1348
+ "output": 0.4,
1349
+ "cache_read": 0.005
1350
+ },
1351
+ "limit": {
1352
+ "context": 400000,
1353
+ "input": 272000,
1354
+ "output": 128000
1355
+ }
1356
+ },
1357
+ "o1-mini": {
1358
+ "id": "o1-mini",
1359
+ "name": "o1-mini",
1360
+ "family": "o-mini",
1361
+ "attachment": false,
1362
+ "reasoning": true,
1363
+ "tool_call": false,
1364
+ "structured_output": true,
1365
+ "temperature": false,
1366
+ "knowledge": "2023-09",
1367
+ "release_date": "2024-09-12",
1368
+ "last_updated": "2024-09-12",
1369
+ "modalities": {
1370
+ "input": [
1371
+ "text"
1372
+ ],
1373
+ "output": [
1374
+ "text"
1375
+ ]
1376
+ },
1377
+ "open_weights": false,
1378
+ "cost": {
1379
+ "input": 1.1,
1380
+ "output": 4.4,
1381
+ "cache_read": 0.55
1382
+ },
1383
+ "limit": {
1384
+ "context": 128000,
1385
+ "output": 65536
1386
+ }
1387
+ },
1388
+ "gpt-4o": {
1389
+ "id": "gpt-4o",
1390
+ "name": "GPT-4o",
1391
+ "family": "gpt",
1392
+ "attachment": true,
1393
+ "reasoning": false,
1394
+ "tool_call": true,
1395
+ "structured_output": true,
1396
+ "temperature": true,
1397
+ "knowledge": "2023-09",
1398
+ "release_date": "2024-05-13",
1399
+ "last_updated": "2024-08-06",
1400
+ "modalities": {
1401
+ "input": [
1402
+ "text",
1403
+ "image"
1404
+ ],
1405
+ "output": [
1406
+ "text"
1407
+ ]
1408
+ },
1409
+ "open_weights": false,
1410
+ "cost": {
1411
+ "input": 2.5,
1412
+ "output": 10,
1413
+ "cache_read": 1.25
1414
+ },
1415
+ "limit": {
1416
+ "context": 128000,
1417
+ "output": 16384
1418
+ }
1419
+ }
1420
+ }
1421
+ }