gpt-tokenizer 3.0.0 → 3.0.1

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 (181) hide show
  1. package/cjs/GptEncoding.d.ts +2 -2
  2. package/cjs/encoding/cl100k_base.d.ts +1 -1
  3. package/cjs/encoding/o200k_base.d.ts +1 -1
  4. package/cjs/encoding/p50k_edit.d.ts +1 -1
  5. package/cjs/model/chatgpt-4o-latest.d.ts +1 -1
  6. package/cjs/model/codex-mini-latest.d.ts +1 -1
  7. package/cjs/model/computer-use-preview-2025-03-11.d.ts +1 -1
  8. package/cjs/model/computer-use-preview.d.ts +1 -1
  9. package/cjs/model/gpt-3.5-0301.d.ts +1 -1
  10. package/cjs/model/gpt-3.5-turbo-0125.d.ts +1 -1
  11. package/cjs/model/gpt-3.5-turbo-0613.d.ts +1 -1
  12. package/cjs/model/gpt-3.5-turbo-1106.d.ts +1 -1
  13. package/cjs/model/gpt-3.5-turbo-16k-0613.d.ts +1 -1
  14. package/cjs/model/gpt-3.5-turbo-instruct.d.ts +1 -1
  15. package/cjs/model/gpt-3.5-turbo.d.ts +1 -1
  16. package/cjs/model/gpt-3.5.d.ts +1 -1
  17. package/cjs/model/gpt-4-0125-preview.d.ts +1 -1
  18. package/cjs/model/gpt-4-0314.d.ts +1 -1
  19. package/cjs/model/gpt-4-0613.d.ts +1 -1
  20. package/cjs/model/gpt-4-1106-preview.d.ts +1 -1
  21. package/cjs/model/gpt-4-1106-vision-preview.d.ts +1 -1
  22. package/cjs/model/gpt-4-32k.d.ts +1 -1
  23. package/cjs/model/gpt-4-turbo-2024-04-09.d.ts +1 -1
  24. package/cjs/model/gpt-4-turbo-preview.d.ts +1 -1
  25. package/cjs/model/gpt-4-turbo.d.ts +1 -1
  26. package/cjs/model/gpt-4.1-2025-04-14.d.ts +1 -1
  27. package/cjs/model/gpt-4.1-mini-2025-04-14.d.ts +1 -1
  28. package/cjs/model/gpt-4.1-mini.d.ts +1 -1
  29. package/cjs/model/gpt-4.1-nano-2025-04-14.d.ts +1 -1
  30. package/cjs/model/gpt-4.1-nano.d.ts +1 -1
  31. package/cjs/model/gpt-4.1.d.ts +1 -1
  32. package/cjs/model/gpt-4.5-preview-2025-02-27.d.ts +1 -1
  33. package/cjs/model/gpt-4.5-preview.d.ts +1 -1
  34. package/cjs/model/gpt-4.d.ts +1 -1
  35. package/cjs/model/gpt-4o-2024-05-13.d.ts +1 -1
  36. package/cjs/model/gpt-4o-2024-08-06.d.ts +1 -1
  37. package/cjs/model/gpt-4o-2024-11-20.d.ts +1 -1
  38. package/cjs/model/gpt-4o-audio-preview-2024-10-01.d.ts +1 -1
  39. package/cjs/model/gpt-4o-audio-preview-2024-12-17.d.ts +1 -1
  40. package/cjs/model/gpt-4o-audio-preview-2025-06-03.d.ts +1 -1
  41. package/cjs/model/gpt-4o-audio-preview.d.ts +1 -1
  42. package/cjs/model/gpt-4o-mini-2024-07-18.d.ts +1 -1
  43. package/cjs/model/gpt-4o-mini-audio-preview-2024-12-17.d.ts +1 -1
  44. package/cjs/model/gpt-4o-mini-audio-preview.d.ts +1 -1
  45. package/cjs/model/gpt-4o-mini-search-preview-2025-03-11.d.ts +1 -1
  46. package/cjs/model/gpt-4o-mini-search-preview.d.ts +1 -1
  47. package/cjs/model/gpt-4o-mini.d.ts +1 -1
  48. package/cjs/model/gpt-4o-search-preview-2025-03-11.d.ts +1 -1
  49. package/cjs/model/gpt-4o-search-preview.d.ts +1 -1
  50. package/cjs/model/gpt-4o.d.ts +1 -1
  51. package/cjs/model/o1-2024-12-17.d.ts +1 -1
  52. package/cjs/model/o1-mini-2024-09-12.d.ts +1 -1
  53. package/cjs/model/o1-mini.d.ts +1 -1
  54. package/cjs/model/o1-preview-2024-09-12.d.ts +1 -1
  55. package/cjs/model/o1-preview.d.ts +1 -1
  56. package/cjs/model/o1-pro-2025-03-19.d.ts +1 -1
  57. package/cjs/model/o1-pro.d.ts +1 -1
  58. package/cjs/model/o1.d.ts +1 -1
  59. package/cjs/model/o3-2025-04-16.d.ts +1 -1
  60. package/cjs/model/o3-2025-04-16.js +1 -1
  61. package/cjs/model/o3-2025-04-16.js.map +1 -1
  62. package/cjs/model/o3-mini-2025-01-31.d.ts +1 -1
  63. package/cjs/model/o3-mini.d.ts +1 -1
  64. package/cjs/model/o3-pro-2025-06-10.d.ts +7 -0
  65. package/cjs/model/o3-pro-2025-06-10.js +44 -0
  66. package/cjs/model/o3-pro-2025-06-10.js.map +1 -0
  67. package/cjs/model/o3-pro.d.ts +7 -0
  68. package/cjs/model/o3-pro.js +44 -0
  69. package/cjs/model/o3-pro.js.map +1 -0
  70. package/cjs/model/o3.d.ts +1 -1
  71. package/cjs/model/o3.js +1 -1
  72. package/cjs/model/o3.js.map +1 -1
  73. package/cjs/model/o4-mini-2025-04-16.d.ts +1 -1
  74. package/cjs/model/o4-mini.d.ts +1 -1
  75. package/cjs/models.gen.d.ts +33 -5
  76. package/cjs/models.gen.js +94 -6
  77. package/cjs/models.gen.js.map +1 -1
  78. package/cjs/modelsChatEnabled.gen.d.ts +1 -1
  79. package/cjs/modelsChatEnabled.gen.js +1 -1
  80. package/cjs/modelsChatEnabled.gen.js.map +1 -1
  81. package/dist/cl100k_base.js +1 -1
  82. package/dist/cl100k_base.js.map +1 -1
  83. package/dist/o200k_base.js +1 -1
  84. package/dist/o200k_base.js.map +1 -1
  85. package/dist/p50k_base.js +1 -1
  86. package/dist/p50k_base.js.map +1 -1
  87. package/dist/p50k_edit.js +1 -1
  88. package/dist/p50k_edit.js.map +1 -1
  89. package/dist/r50k_base.js +1 -1
  90. package/dist/r50k_base.js.map +1 -1
  91. package/esm/GptEncoding.d.ts +2 -2
  92. package/esm/codegen/modelScape.js +1 -0
  93. package/esm/codegen/modelScape.js.map +1 -1
  94. package/esm/encoding/cl100k_base.d.ts +1 -1
  95. package/esm/encoding/o200k_base.d.ts +1 -1
  96. package/esm/encoding/p50k_edit.d.ts +1 -1
  97. package/esm/model/chatgpt-4o-latest.d.ts +1 -1
  98. package/esm/model/codex-mini-latest.d.ts +1 -1
  99. package/esm/model/computer-use-preview-2025-03-11.d.ts +1 -1
  100. package/esm/model/computer-use-preview.d.ts +1 -1
  101. package/esm/model/gpt-3.5-0301.d.ts +1 -1
  102. package/esm/model/gpt-3.5-turbo-0125.d.ts +1 -1
  103. package/esm/model/gpt-3.5-turbo-0613.d.ts +1 -1
  104. package/esm/model/gpt-3.5-turbo-1106.d.ts +1 -1
  105. package/esm/model/gpt-3.5-turbo-16k-0613.d.ts +1 -1
  106. package/esm/model/gpt-3.5-turbo-instruct.d.ts +1 -1
  107. package/esm/model/gpt-3.5-turbo.d.ts +1 -1
  108. package/esm/model/gpt-3.5.d.ts +1 -1
  109. package/esm/model/gpt-4-0125-preview.d.ts +1 -1
  110. package/esm/model/gpt-4-0314.d.ts +1 -1
  111. package/esm/model/gpt-4-0613.d.ts +1 -1
  112. package/esm/model/gpt-4-1106-preview.d.ts +1 -1
  113. package/esm/model/gpt-4-1106-vision-preview.d.ts +1 -1
  114. package/esm/model/gpt-4-32k.d.ts +1 -1
  115. package/esm/model/gpt-4-turbo-2024-04-09.d.ts +1 -1
  116. package/esm/model/gpt-4-turbo-preview.d.ts +1 -1
  117. package/esm/model/gpt-4-turbo.d.ts +1 -1
  118. package/esm/model/gpt-4.1-2025-04-14.d.ts +1 -1
  119. package/esm/model/gpt-4.1-mini-2025-04-14.d.ts +1 -1
  120. package/esm/model/gpt-4.1-mini.d.ts +1 -1
  121. package/esm/model/gpt-4.1-nano-2025-04-14.d.ts +1 -1
  122. package/esm/model/gpt-4.1-nano.d.ts +1 -1
  123. package/esm/model/gpt-4.1.d.ts +1 -1
  124. package/esm/model/gpt-4.5-preview-2025-02-27.d.ts +1 -1
  125. package/esm/model/gpt-4.5-preview.d.ts +1 -1
  126. package/esm/model/gpt-4.d.ts +1 -1
  127. package/esm/model/gpt-4o-2024-05-13.d.ts +1 -1
  128. package/esm/model/gpt-4o-2024-08-06.d.ts +1 -1
  129. package/esm/model/gpt-4o-2024-11-20.d.ts +1 -1
  130. package/esm/model/gpt-4o-audio-preview-2024-10-01.d.ts +1 -1
  131. package/esm/model/gpt-4o-audio-preview-2024-12-17.d.ts +1 -1
  132. package/esm/model/gpt-4o-audio-preview-2025-06-03.d.ts +1 -1
  133. package/esm/model/gpt-4o-audio-preview.d.ts +1 -1
  134. package/esm/model/gpt-4o-mini-2024-07-18.d.ts +1 -1
  135. package/esm/model/gpt-4o-mini-audio-preview-2024-12-17.d.ts +1 -1
  136. package/esm/model/gpt-4o-mini-audio-preview.d.ts +1 -1
  137. package/esm/model/gpt-4o-mini-search-preview-2025-03-11.d.ts +1 -1
  138. package/esm/model/gpt-4o-mini-search-preview.d.ts +1 -1
  139. package/esm/model/gpt-4o-mini.d.ts +1 -1
  140. package/esm/model/gpt-4o-search-preview-2025-03-11.d.ts +1 -1
  141. package/esm/model/gpt-4o-search-preview.d.ts +1 -1
  142. package/esm/model/gpt-4o.d.ts +1 -1
  143. package/esm/model/o1-2024-12-17.d.ts +1 -1
  144. package/esm/model/o1-mini-2024-09-12.d.ts +1 -1
  145. package/esm/model/o1-mini.d.ts +1 -1
  146. package/esm/model/o1-preview-2024-09-12.d.ts +1 -1
  147. package/esm/model/o1-preview.d.ts +1 -1
  148. package/esm/model/o1-pro-2025-03-19.d.ts +1 -1
  149. package/esm/model/o1-pro.d.ts +1 -1
  150. package/esm/model/o1.d.ts +1 -1
  151. package/esm/model/o3-2025-04-16.d.ts +1 -1
  152. package/esm/model/o3-2025-04-16.js +1 -1
  153. package/esm/model/o3-2025-04-16.js.map +1 -1
  154. package/esm/model/o3-mini-2025-01-31.d.ts +1 -1
  155. package/esm/model/o3-mini.d.ts +1 -1
  156. package/esm/model/o3-pro-2025-06-10.d.ts +7 -0
  157. package/esm/model/o3-pro-2025-06-10.js +12 -0
  158. package/esm/model/o3-pro-2025-06-10.js.map +1 -0
  159. package/esm/model/o3-pro.d.ts +7 -0
  160. package/esm/model/o3-pro.js +12 -0
  161. package/esm/model/o3-pro.js.map +1 -0
  162. package/esm/model/o3.d.ts +1 -1
  163. package/esm/model/o3.js +1 -1
  164. package/esm/model/o3.js.map +1 -1
  165. package/esm/model/o4-mini-2025-04-16.d.ts +1 -1
  166. package/esm/model/o4-mini.d.ts +1 -1
  167. package/esm/models.gen.d.ts +33 -5
  168. package/esm/models.gen.js +94 -5
  169. package/esm/models.gen.js.map +1 -1
  170. package/esm/modelsChatEnabled.gen.d.ts +1 -1
  171. package/esm/modelsChatEnabled.gen.js +1 -1
  172. package/esm/modelsChatEnabled.gen.js.map +1 -1
  173. package/package.json +1 -1
  174. package/src/__snapshots__/GptEncoding.test.ts.snap +254 -0
  175. package/src/codegen/modelScape.js +2 -0
  176. package/src/model/o3-2025-04-16.ts +1 -1
  177. package/src/model/o3-pro-2025-06-10.ts +40 -0
  178. package/src/model/o3-pro.ts +40 -0
  179. package/src/model/o3.ts +1 -1
  180. package/src/models.gen.ts +97 -5
  181. package/src/modelsChatEnabled.gen.ts +1 -1
@@ -7552,6 +7552,260 @@ exports[`o3-mini-2025-01-31 > chat functionality > encodes a chat correctly 1`]
7552
7552
 
7553
7553
  exports[`o3-mini-2025-01-31 > chat functionality > encodes a chat correctly 2`] = `"<|im_start|>system<|im_sep|>You are a helpful, pattern-following assistant that translates corporate jargon into plain English.<|im_end|><|im_start|>example_user<|im_sep|>New synergies will help drive top-line growth.<|im_end|><|im_start|>example_assistant<|im_sep|>Things working well together will increase revenue.<|im_end|><|im_start|>example_user<|im_sep|>Let's circle back when we have more bandwidth to touch base on opportunities for increased leverage.<|im_end|><|im_start|>example_assistant<|im_sep|>Let's talk later when we're less busy about how to do better.<|im_end|><|im_start|>user<|im_sep|>This late pivot means we don't have time to boil the ocean for the client deliverable.<|im_end|><|im_start|>assistant<|im_sep|>"`;
7554
7554
 
7555
+ exports[`o3-pro > chat functionality > encodes a chat correctly 1`] = `
7556
+ [
7557
+ 200003,
7558
+ 17360,
7559
+ 200005,
7560
+ 3575,
7561
+ 553,
7562
+ 261,
7563
+ 10297,
7564
+ 11,
7565
+ 8302,
7566
+ 156275,
7567
+ 289,
7568
+ 29186,
7569
+ 484,
7570
+ 84230,
7571
+ 16706,
7572
+ 160996,
7573
+ 1511,
7574
+ 21402,
7575
+ 7725,
7576
+ 13,
7577
+ 200004,
7578
+ 200003,
7579
+ 18582,
7580
+ 7146,
7581
+ 200005,
7582
+ 3443,
7583
+ 6157,
7584
+ 109242,
7585
+ 738,
7586
+ 1652,
7587
+ 7515,
7588
+ 2344,
7589
+ 11596,
7590
+ 8266,
7591
+ 13,
7592
+ 200004,
7593
+ 200003,
7594
+ 18582,
7595
+ 29140,
7596
+ 14055,
7597
+ 200005,
7598
+ 53046,
7599
+ 4113,
7600
+ 1775,
7601
+ 4717,
7602
+ 738,
7603
+ 7064,
7604
+ 17981,
7605
+ 13,
7606
+ 200004,
7607
+ 200003,
7608
+ 18582,
7609
+ 7146,
7610
+ 200005,
7611
+ 12845,
7612
+ 885,
7613
+ 22005,
7614
+ 1602,
7615
+ 1261,
7616
+ 581,
7617
+ 679,
7618
+ 945,
7619
+ 58356,
7620
+ 316,
7621
+ 7381,
7622
+ 3611,
7623
+ 402,
7624
+ 11206,
7625
+ 395,
7626
+ 11202,
7627
+ 48255,
7628
+ 13,
7629
+ 200004,
7630
+ 200003,
7631
+ 18582,
7632
+ 29140,
7633
+ 14055,
7634
+ 200005,
7635
+ 12845,
7636
+ 885,
7637
+ 4595,
7638
+ 4849,
7639
+ 1261,
7640
+ 581,
7641
+ 4118,
7642
+ 3760,
7643
+ 15827,
7644
+ 1078,
7645
+ 1495,
7646
+ 316,
7647
+ 621,
7648
+ 3432,
7649
+ 13,
7650
+ 200004,
7651
+ 200003,
7652
+ 1428,
7653
+ 200005,
7654
+ 2500,
7655
+ 7844,
7656
+ 44506,
7657
+ 4748,
7658
+ 581,
7659
+ 1700,
7660
+ 1507,
7661
+ 679,
7662
+ 1058,
7663
+ 316,
7664
+ 66049,
7665
+ 290,
7666
+ 25472,
7667
+ 395,
7668
+ 290,
7669
+ 3054,
7670
+ 7000,
7671
+ 562,
7672
+ 13,
7673
+ 200004,
7674
+ 200003,
7675
+ 173781,
7676
+ 200005,
7677
+ ]
7678
+ `;
7679
+
7680
+ exports[`o3-pro > chat functionality > encodes a chat correctly 2`] = `"<|im_start|>system<|im_sep|>You are a helpful, pattern-following assistant that translates corporate jargon into plain English.<|im_end|><|im_start|>example_user<|im_sep|>New synergies will help drive top-line growth.<|im_end|><|im_start|>example_assistant<|im_sep|>Things working well together will increase revenue.<|im_end|><|im_start|>example_user<|im_sep|>Let's circle back when we have more bandwidth to touch base on opportunities for increased leverage.<|im_end|><|im_start|>example_assistant<|im_sep|>Let's talk later when we're less busy about how to do better.<|im_end|><|im_start|>user<|im_sep|>This late pivot means we don't have time to boil the ocean for the client deliverable.<|im_end|><|im_start|>assistant<|im_sep|>"`;
7681
+
7682
+ exports[`o3-pro-2025-06-10 > chat functionality > encodes a chat correctly 1`] = `
7683
+ [
7684
+ 200003,
7685
+ 17360,
7686
+ 200005,
7687
+ 3575,
7688
+ 553,
7689
+ 261,
7690
+ 10297,
7691
+ 11,
7692
+ 8302,
7693
+ 156275,
7694
+ 289,
7695
+ 29186,
7696
+ 484,
7697
+ 84230,
7698
+ 16706,
7699
+ 160996,
7700
+ 1511,
7701
+ 21402,
7702
+ 7725,
7703
+ 13,
7704
+ 200004,
7705
+ 200003,
7706
+ 18582,
7707
+ 7146,
7708
+ 200005,
7709
+ 3443,
7710
+ 6157,
7711
+ 109242,
7712
+ 738,
7713
+ 1652,
7714
+ 7515,
7715
+ 2344,
7716
+ 11596,
7717
+ 8266,
7718
+ 13,
7719
+ 200004,
7720
+ 200003,
7721
+ 18582,
7722
+ 29140,
7723
+ 14055,
7724
+ 200005,
7725
+ 53046,
7726
+ 4113,
7727
+ 1775,
7728
+ 4717,
7729
+ 738,
7730
+ 7064,
7731
+ 17981,
7732
+ 13,
7733
+ 200004,
7734
+ 200003,
7735
+ 18582,
7736
+ 7146,
7737
+ 200005,
7738
+ 12845,
7739
+ 885,
7740
+ 22005,
7741
+ 1602,
7742
+ 1261,
7743
+ 581,
7744
+ 679,
7745
+ 945,
7746
+ 58356,
7747
+ 316,
7748
+ 7381,
7749
+ 3611,
7750
+ 402,
7751
+ 11206,
7752
+ 395,
7753
+ 11202,
7754
+ 48255,
7755
+ 13,
7756
+ 200004,
7757
+ 200003,
7758
+ 18582,
7759
+ 29140,
7760
+ 14055,
7761
+ 200005,
7762
+ 12845,
7763
+ 885,
7764
+ 4595,
7765
+ 4849,
7766
+ 1261,
7767
+ 581,
7768
+ 4118,
7769
+ 3760,
7770
+ 15827,
7771
+ 1078,
7772
+ 1495,
7773
+ 316,
7774
+ 621,
7775
+ 3432,
7776
+ 13,
7777
+ 200004,
7778
+ 200003,
7779
+ 1428,
7780
+ 200005,
7781
+ 2500,
7782
+ 7844,
7783
+ 44506,
7784
+ 4748,
7785
+ 581,
7786
+ 1700,
7787
+ 1507,
7788
+ 679,
7789
+ 1058,
7790
+ 316,
7791
+ 66049,
7792
+ 290,
7793
+ 25472,
7794
+ 395,
7795
+ 290,
7796
+ 3054,
7797
+ 7000,
7798
+ 562,
7799
+ 13,
7800
+ 200004,
7801
+ 200003,
7802
+ 173781,
7803
+ 200005,
7804
+ ]
7805
+ `;
7806
+
7807
+ exports[`o3-pro-2025-06-10 > chat functionality > encodes a chat correctly 2`] = `"<|im_start|>system<|im_sep|>You are a helpful, pattern-following assistant that translates corporate jargon into plain English.<|im_end|><|im_start|>example_user<|im_sep|>New synergies will help drive top-line growth.<|im_end|><|im_start|>example_assistant<|im_sep|>Things working well together will increase revenue.<|im_end|><|im_start|>example_user<|im_sep|>Let's circle back when we have more bandwidth to touch base on opportunities for increased leverage.<|im_end|><|im_start|>example_assistant<|im_sep|>Let's talk later when we're less busy about how to do better.<|im_end|><|im_start|>user<|im_sep|>This late pivot means we don't have time to boil the ocean for the client deliverable.<|im_end|><|im_start|>assistant<|im_sep|>"`;
7808
+
7555
7809
  exports[`o4-mini > chat functionality > encodes a chat correctly 1`] = `
7556
7810
  [
7557
7811
  200003,
@@ -1,3 +1,5 @@
1
+ // search for name: "Other models" in https://platform.openai.com/docs/models
2
+
1
3
  /**
2
4
  * Converts a string with hyphens and dots into a valid JavaScript variable name.
3
5
  * @param {string} name - The input string (e.g., 'gpt-4.1-mini').
@@ -5,7 +5,7 @@ import { GptEncoding } from '../GptEncoding.js'
5
5
  export * from '../constants.js'
6
6
  export * from '../specialTokens.js'
7
7
  // prettier-ignore
8
- const api = GptEncoding.getEncodingApiForModel('o3-2025-04-16', () => bpeRanks, {name:"o3-2025-04-16",slug:"o3-2025-04-16",performance:5,latency:1,modalities:{input:["text","image"],output:["text"]},context_window:200000,max_output_tokens:100000,knowledge_cutoff:new Date(1717200000000),supported_features:["streaming","structured_outputs","file_search","function_calling","file_uploads","image_input","prompt_caching","evals","stored_completions"],supported_endpoints:["chat_completions","responses","batch"],reasoning_tokens:true,price_data:{main:{input:15,cached_output:7.5,output:60},batch:{input:7.5,output:30}}})
8
+ const api = GptEncoding.getEncodingApiForModel('o3-2025-04-16', () => bpeRanks, {name:"o3-2025-04-16",slug:"o3-2025-04-16",performance:5,latency:1,modalities:{input:["text","image"],output:["text"]},context_window:200000,max_output_tokens:100000,knowledge_cutoff:new Date(1717200000000),supported_features:["streaming","structured_outputs","file_search","function_calling","file_uploads","image_input","prompt_caching","evals","stored_completions"],supported_endpoints:["chat_completions","responses","batch"],reasoning_tokens:true,price_data:{main:{input:2,cached_output:.5,output:8},batch:{input:1,output:4}}})
9
9
  const {
10
10
  decode,
11
11
  decodeAsyncGenerator,
@@ -0,0 +1,40 @@
1
+ /* eslint-disable import/extensions */
2
+ import bpeRanks from '../bpeRanks/o200k_base.js'
3
+ import { GptEncoding } from '../GptEncoding.js'
4
+
5
+ export * from '../constants.js'
6
+ export * from '../specialTokens.js'
7
+ // prettier-ignore
8
+ const api = GptEncoding.getEncodingApiForModel('o3-pro-2025-06-10', () => bpeRanks, {name:"o3-pro-2025-06-10",slug:"o3-pro-2025-06-10",performance:5,latency:1,modalities:{input:["text","image"],output:["text"]},context_window:200000,max_output_tokens:100000,knowledge_cutoff:new Date(1717200000000),supported_features:["structured_outputs","function_calling","image_input"],supported_endpoints:["responses","batch"],reasoning_tokens:true,price_data:{main:{input:20,output:80},batch:{input:10,output:40}}})
9
+ const {
10
+ decode,
11
+ decodeAsyncGenerator,
12
+ decodeGenerator,
13
+ encode,
14
+ encodeGenerator,
15
+ isWithinTokenLimit,
16
+ countTokens,
17
+ encodeChat,
18
+ encodeChatGenerator,
19
+ vocabularySize,
20
+ setMergeCacheSize,
21
+ clearMergeCache,
22
+ estimateCost,
23
+ } = api
24
+ export {
25
+ clearMergeCache,
26
+ countTokens,
27
+ decode,
28
+ decodeAsyncGenerator,
29
+ decodeGenerator,
30
+ encode,
31
+ encodeChat,
32
+ encodeChatGenerator,
33
+ encodeGenerator,
34
+ estimateCost,
35
+ isWithinTokenLimit,
36
+ setMergeCacheSize,
37
+ vocabularySize,
38
+ }
39
+ // eslint-disable-next-line import/no-default-export
40
+ export default api
@@ -0,0 +1,40 @@
1
+ /* eslint-disable import/extensions */
2
+ import bpeRanks from '../bpeRanks/o200k_base.js'
3
+ import { GptEncoding } from '../GptEncoding.js'
4
+
5
+ export * from '../constants.js'
6
+ export * from '../specialTokens.js'
7
+ // prettier-ignore
8
+ const api = GptEncoding.getEncodingApiForModel('o3-pro', () => bpeRanks, {name:"o3-pro-2025-06-10",slug:"o3-pro-2025-06-10",performance:5,latency:1,modalities:{input:["text","image"],output:["text"]},context_window:200000,max_output_tokens:100000,knowledge_cutoff:new Date(1717200000000),supported_features:["structured_outputs","function_calling","image_input"],supported_endpoints:["responses","batch"],reasoning_tokens:true,price_data:{main:{input:20,output:80},batch:{input:10,output:40}}})
9
+ const {
10
+ decode,
11
+ decodeAsyncGenerator,
12
+ decodeGenerator,
13
+ encode,
14
+ encodeGenerator,
15
+ isWithinTokenLimit,
16
+ countTokens,
17
+ encodeChat,
18
+ encodeChatGenerator,
19
+ vocabularySize,
20
+ setMergeCacheSize,
21
+ clearMergeCache,
22
+ estimateCost,
23
+ } = api
24
+ export {
25
+ clearMergeCache,
26
+ countTokens,
27
+ decode,
28
+ decodeAsyncGenerator,
29
+ decodeGenerator,
30
+ encode,
31
+ encodeChat,
32
+ encodeChatGenerator,
33
+ encodeGenerator,
34
+ estimateCost,
35
+ isWithinTokenLimit,
36
+ setMergeCacheSize,
37
+ vocabularySize,
38
+ }
39
+ // eslint-disable-next-line import/no-default-export
40
+ export default api
package/src/model/o3.ts CHANGED
@@ -5,7 +5,7 @@ import { GptEncoding } from '../GptEncoding.js'
5
5
  export * from '../constants.js'
6
6
  export * from '../specialTokens.js'
7
7
  // prettier-ignore
8
- const api = GptEncoding.getEncodingApiForModel('o3', () => bpeRanks, {name:"o3-2025-04-16",slug:"o3-2025-04-16",performance:5,latency:1,modalities:{input:["text","image"],output:["text"]},context_window:200000,max_output_tokens:100000,knowledge_cutoff:new Date(1717200000000),supported_features:["streaming","structured_outputs","file_search","function_calling","file_uploads","image_input","prompt_caching","evals","stored_completions"],supported_endpoints:["chat_completions","responses","batch"],reasoning_tokens:true,price_data:{main:{input:15,cached_output:7.5,output:60},batch:{input:7.5,output:30}}})
8
+ const api = GptEncoding.getEncodingApiForModel('o3', () => bpeRanks, {name:"o3-2025-04-16",slug:"o3-2025-04-16",performance:5,latency:1,modalities:{input:["text","image"],output:["text"]},context_window:200000,max_output_tokens:100000,knowledge_cutoff:new Date(1717200000000),supported_features:["streaming","structured_outputs","file_search","function_calling","file_uploads","image_input","prompt_caching","evals","stored_completions"],supported_endpoints:["chat_completions","responses","batch"],reasoning_tokens:true,price_data:{main:{input:2,cached_output:.5,output:8},batch:{input:1,output:4}}})
9
9
  const {
10
10
  decode,
11
11
  decodeAsyncGenerator,
package/src/models.gen.ts CHANGED
@@ -3343,6 +3343,98 @@ export {o3_mini_2025_01_31_spec as 'o3-mini-2025-01-31'}
3343
3343
  // alias:
3344
3344
  export { o3_mini_2025_01_31_spec as 'o3-mini' };
3345
3345
 
3346
+ const o3_pro_config = {
3347
+ name: 'o3-pro',
3348
+ slug: 'o3-pro',
3349
+ current_snapshot: 'o3-pro-2025-06-10',
3350
+ tagline: 'Version of o3 with more compute for better responses',
3351
+ description: 'The o-series of models are trained with reinforcement learning to think \nbefore they answer and perform complex reasoning. The o3-pro model uses more \ncompute to think harder and provide consistently better answers.\n\no3-pro is available in the [Responses API only](/docs/api-reference/responses)\nto enable support for multi-turn model interactions before responding to API \nrequests, and other advanced API features in the future. Since o3-pro is designed \nto tackle tough problems, some requests may take several minutes to finish. \nTo avoid timeouts, try using [background mode](/docs/guides/background).\n',
3352
+ type: 'reasoning',
3353
+ snapshots: [
3354
+ 'o3-pro-2025-06-10',
3355
+ ],
3356
+ compare_prices: [
3357
+ 'o3',
3358
+ 'o3-mini',
3359
+ ],
3360
+ supported_tools: [
3361
+ 'function_calling',
3362
+ 'file_search',
3363
+ 'image_generation',
3364
+ 'mcp',
3365
+ ],
3366
+ rate_limits: {
3367
+ tier_1: {
3368
+ rpm: 500,
3369
+ tpm: 3e4,
3370
+ batch_queue_limit: 9e4,
3371
+ },
3372
+ tier_2: {
3373
+ rpm: 5e3,
3374
+ tpm: 45e4,
3375
+ batch_queue_limit: 135e4,
3376
+ },
3377
+ tier_3: {
3378
+ rpm: 5e3,
3379
+ tpm: 8e5,
3380
+ batch_queue_limit: 5e7,
3381
+ },
3382
+ tier_4: {
3383
+ rpm: 1e4,
3384
+ tpm: 2e6,
3385
+ batch_queue_limit: 2e8,
3386
+ },
3387
+ tier_5: {
3388
+ rpm: 1e4,
3389
+ tpm: 3e7,
3390
+ batch_queue_limit: 5e9,
3391
+ },
3392
+ },
3393
+ } as const satisfies ModelConfig
3394
+
3395
+ const o3_pro_2025_06_10_spec = {
3396
+ name: 'o3-pro-2025-06-10',
3397
+ slug: 'o3-pro-2025-06-10',
3398
+ performance: 5,
3399
+ latency: 1,
3400
+ modalities: {
3401
+ input: [
3402
+ 'text',
3403
+ 'image',
3404
+ ],
3405
+ output: [
3406
+ 'text',
3407
+ ],
3408
+ },
3409
+ context_window: 2e5,
3410
+ max_output_tokens: 1e5,
3411
+ knowledge_cutoff: new Date(17172e8),
3412
+ supported_features: [
3413
+ 'structured_outputs',
3414
+ 'function_calling',
3415
+ 'image_input',
3416
+ ],
3417
+ supported_endpoints: [
3418
+ 'responses',
3419
+ 'batch',
3420
+ ],
3421
+ reasoning_tokens: true,
3422
+ price_data: {
3423
+ main: {
3424
+ input: 20,
3425
+ output: 80,
3426
+ },
3427
+ batch: {
3428
+ input: 10,
3429
+ output: 40,
3430
+ },
3431
+ },
3432
+ } as const satisfies ModelSpec
3433
+ export {o3_pro_2025_06_10_spec as 'o3-pro-2025-06-10'}
3434
+
3435
+ // alias:
3436
+ export { o3_pro_2025_06_10_spec as 'o3-pro' };
3437
+
3346
3438
  const o3_config = {
3347
3439
  name: 'o3',
3348
3440
  slug: 'o3',
@@ -3429,13 +3521,13 @@ const o3_2025_04_16_spec = {
3429
3521
  reasoning_tokens: true,
3430
3522
  price_data: {
3431
3523
  main: {
3432
- input: 15,
3433
- cached_output: 7.5,
3434
- output: 60,
3524
+ input: 2,
3525
+ cached_output: .5,
3526
+ output: 8,
3435
3527
  },
3436
3528
  batch: {
3437
- input: 7.5,
3438
- output: 30,
3529
+ input: 1,
3530
+ output: 4,
3439
3531
  },
3440
3532
  },
3441
3533
  } as const satisfies ModelSpec
@@ -1 +1 @@
1
- export const chatEnabledModels = ["chatgpt-4o-latest","codex-mini-latest","computer-use-preview","computer-use-preview-2025-03-11","gpt-3.5","gpt-3.5-0301","gpt-3.5-turbo","gpt-3.5-turbo-0125","gpt-3.5-turbo-0613","gpt-3.5-turbo-1106","gpt-3.5-turbo-16k-0613","gpt-3.5-turbo-instruct","gpt-4","gpt-4-0125-preview","gpt-4-0314","gpt-4-0613","gpt-4-1106-preview","gpt-4-1106-vision-preview","gpt-4-32k","gpt-4-turbo","gpt-4-turbo-2024-04-09","gpt-4-turbo-preview","gpt-4.1","gpt-4.1-2025-04-14","gpt-4.1-mini","gpt-4.1-mini-2025-04-14","gpt-4.1-nano","gpt-4.1-nano-2025-04-14","gpt-4.5-preview","gpt-4.5-preview-2025-02-27","gpt-4o","gpt-4o-2024-05-13","gpt-4o-2024-08-06","gpt-4o-2024-11-20","gpt-4o-audio-preview","gpt-4o-audio-preview-2024-10-01","gpt-4o-audio-preview-2024-12-17","gpt-4o-audio-preview-2025-06-03","gpt-4o-mini","gpt-4o-mini-2024-07-18","gpt-4o-mini-audio-preview","gpt-4o-mini-audio-preview-2024-12-17","gpt-4o-mini-search-preview","gpt-4o-mini-search-preview-2025-03-11","gpt-4o-search-preview","gpt-4o-search-preview-2025-03-11","o1","o1-2024-12-17","o1-mini","o1-mini-2024-09-12","o1-preview","o1-preview-2024-09-12","o1-pro","o1-pro-2025-03-19","o3","o3-2025-04-16","o3-mini","o3-mini-2025-01-31","o4-mini","o4-mini-2025-04-16"] as const;
1
+ export const chatEnabledModels = ["chatgpt-4o-latest","codex-mini-latest","computer-use-preview","computer-use-preview-2025-03-11","gpt-3.5","gpt-3.5-0301","gpt-3.5-turbo","gpt-3.5-turbo-0125","gpt-3.5-turbo-0613","gpt-3.5-turbo-1106","gpt-3.5-turbo-16k-0613","gpt-3.5-turbo-instruct","gpt-4","gpt-4-0125-preview","gpt-4-0314","gpt-4-0613","gpt-4-1106-preview","gpt-4-1106-vision-preview","gpt-4-32k","gpt-4-turbo","gpt-4-turbo-2024-04-09","gpt-4-turbo-preview","gpt-4.1","gpt-4.1-2025-04-14","gpt-4.1-mini","gpt-4.1-mini-2025-04-14","gpt-4.1-nano","gpt-4.1-nano-2025-04-14","gpt-4.5-preview","gpt-4.5-preview-2025-02-27","gpt-4o","gpt-4o-2024-05-13","gpt-4o-2024-08-06","gpt-4o-2024-11-20","gpt-4o-audio-preview","gpt-4o-audio-preview-2024-10-01","gpt-4o-audio-preview-2024-12-17","gpt-4o-audio-preview-2025-06-03","gpt-4o-mini","gpt-4o-mini-2024-07-18","gpt-4o-mini-audio-preview","gpt-4o-mini-audio-preview-2024-12-17","gpt-4o-mini-search-preview","gpt-4o-mini-search-preview-2025-03-11","gpt-4o-search-preview","gpt-4o-search-preview-2025-03-11","o1","o1-2024-12-17","o1-mini","o1-mini-2024-09-12","o1-preview","o1-preview-2024-09-12","o1-pro","o1-pro-2025-03-19","o3","o3-2025-04-16","o3-mini","o3-mini-2025-01-31","o3-pro","o3-pro-2025-06-10","o4-mini","o4-mini-2025-04-16"] as const;