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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
openapi: 3.0.0
info:
  title: OpenAI API
  description: APIs for sampling from and fine-tuning language models
  version: '1.1.0'
servers:
  - url: https://api.openai.com/v1
tags:
- name: OpenAI
  description: The OpenAI REST API
paths:
  /engines:
    get:
      operationId: listEngines
      deprecated: true
      tags:
      - OpenAI
      summary: Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListEnginesResponse'
      x-oaiMeta:
        name: List engines
        group: engines
        path: list
        examples:
          curl: |
            curl https://api.openai.com/v1/engines \
              -H 'Authorization: Bearer YOUR_API_KEY'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Engine.list()
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.listEngines();
        response: |
          {
            "data": [
              {
                "id": "engine-id-0",
                "object": "engine",
                "owner": "organization-owner",
                "ready": true
              },
              {
                "id": "engine-id-2",
                "object": "engine",
                "owner": "organization-owner",
                "ready": true
              },
              {
                "id": "engine-id-3",
                "object": "engine",
                "owner": "openai",
                "ready": false
              },
            ],
            "object": "list"
          }
  /engines/{engine_id}:
    get:
      operationId: retrieveEngine
      deprecated: true
      tags:
      - OpenAI
      summary: Retrieves a model instance, providing basic information about it such as the owner and availability.
      parameters:
        - in: path
          name: engine_id
          required: true
          schema:
            type: string
            # ideally this will be an actual ID, so this will always work from browser
            example:
              davinci
          description: &engine_id_description >
            The ID of the engine to use for this request
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Engine'
      x-oaiMeta:
        name: Retrieve engine
        group: engines
        path: retrieve
        examples:
          curl: |
            curl https://api.openai.com/v1/engines/VAR_model_id \
              -H 'Authorization: Bearer YOUR_API_KEY'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Engine.retrieve("VAR_model_id")
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.retrieveEngine("VAR_model_id");
        response: |
          {
            "id": "VAR_model_id",
            "object": "engine",
            "owner": "openai",
            "ready": true
          }
  /completions:
    post:
      operationId: createCompletion
      tags:
      - OpenAI
      summary: Creates a completion for the provided prompt and parameters
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCompletionRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCompletionResponse'
      x-oaiMeta:
        name: Create completion
        group: completions
        path: create
        examples:
          curl: |
            curl https://api.openai.com/v1/completions \
              -H 'Content-Type: application/json' \
              -H 'Authorization: Bearer YOUR_API_KEY' \
              -d '{
              "model": "VAR_model_id",
              "prompt": "Say this is a test",
              "max_tokens": 7,
              "temperature": 0
            }'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Completion.create(
              model="VAR_model_id",
              prompt="Say this is a test",
              max_tokens=7,
              temperature=0
            )
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createCompletion({
              model: "VAR_model_id",
              prompt: "Say this is a test",
              max_tokens: 7,
              temperature: 0,
            });
        parameters: |
          {
            "model": "VAR_model_id",
            "prompt": "Say this is a test",
            "max_tokens": 7,
            "temperature": 0,
            "top_p": 1,
            "n": 1,
            "stream": false,
            "logprobs": null,
            "stop": "\n"
          }
        response: |
          {
            "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
            "object": "text_completion",
            "created": 1589478378,
            "model": "VAR_model_id",
            "choices": [
              {
                "text": "\n\nThis is indeed a test",
                "index": 0,
                "logprobs": null,
                "finish_reason": "length"
              }
            ],
            "usage": {
              "prompt_tokens": 5,
              "completion_tokens": 7,
              "total_tokens": 12
            }
          }
  /edits:
    post:
      operationId: createEdit
      tags:
        - OpenAI
      summary: Creates a new edit for the provided input, instruction, and parameters
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEditRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateEditResponse'
      x-oaiMeta:
        name: Create edit
        group: edits
        path: create
        examples:
          curl: |
            curl https://api.openai.com/v1/edits \
              -H 'Content-Type: application/json' \
              -H 'Authorization: Bearer YOUR_API_KEY' \
              -d '{
              "model": "VAR_model_id",
              "input": "What day of the wek is it?",
              "instruction": "Fix the spelling mistakes"
            }'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Edit.create(
              model="VAR_model_id",
              input="What day of the wek is it?",
              instruction="Fix the spelling mistakes"
            )
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createEdit({
              model: "VAR_model_id",
              input: "What day of the wek is it?",
              instruction: "Fix the spelling mistakes",
            });
        parameters: |
          {
            "model": "VAR_model_id",
            "input": "What day of the wek is it?",
            "instruction": "Fix the spelling mistakes",
          }
        response: |
          {
            "object": "edit",
            "created": 1589478378,
            "choices": [
              {
                "text": "What day of the week is it?",
                "index": 0,
              }
            ],
            "usage": {
              "prompt_tokens": 25,
              "completion_tokens": 32,
              "total_tokens": 57
            }
          }
  /images/generations:
    post:
      operationId: createImage
      tags:
      - OpenAI
      summary: Creates an image given a prompt.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateImageRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesResponse'
      x-oaiMeta:
        name: Create image
        group: images
        path: create
        examples:
          curl: |
            curl https://api.openai.com/v1/images/generations \
              -H 'Content-Type: application/json' \
              -H 'Authorization: Bearer YOUR_API_KEY' \
              -d '{
              "prompt": "A cute baby sea otter",
              "n": 2,
              "size": "1024x1024"
            }'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Image.create(
              prompt="A cute baby sea otter",
              n=2,
              size="1024x1024"
            )
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createImage({
              prompt: "A cute baby sea otter",
              n: 2,
              size: "1024x1024",
            });
        parameters: |
          {
            "prompt": "A cute baby sea otter",
            "n": 2,
            "size": "1024x1024"
          }
        response: |
          {
            "created": 1589478378,
            "data": [
              {
                "url": "https://..."
              },
              {
                "url": "https://..."
              }
            ]
          }
  /images/edits:
    post:
      operationId: createImageEdit
      tags:
      - OpenAI
      summary: Creates an edited or extended image given an original image and a prompt.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateImageEditRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesResponse'
      x-oaiMeta:
        name: Create image edit
        group: images
        path: create-edit
        examples:
          curl: |
            curl https://api.openai.com/v1/images/edits \
              -H 'Authorization: Bearer YOUR_API_KEY' \
              -F image='@otter.png' \
              -F mask='@mask.png' \
              -F prompt="A cute baby sea otter wearing a beret" \
              -F n=2 \
              -F size="1024x1024"
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Image.create_edit(
              image=open("otter.png", "rb"),
              mask=open("mask.png", "rb"),
              prompt="A cute baby sea otter wearing a beret",
              n=2,
              size="1024x1024"
            )
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createImageEdit(
              fs.createReadStream("otter.png"),
              fs.createReadStream("mask.png"),
              "A cute baby sea otter wearing a beret",
              2,
              "1024x1024"
            );
        response: |
          {
            "created": 1589478378,
            "data": [
              {
                "url": "https://..."
              },
              {
                "url": "https://..."
              }
            ]
          }
  /images/variations:
    post:
      operationId: createImageVariation
      tags:
      - OpenAI
      summary: Creates a variation of a given image.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateImageVariationRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesResponse'
      x-oaiMeta:
        name: Create image variation
        group: images
        path: create-variation
        examples:
          curl: |
            curl https://api.openai.com/v1/images/variations \
              -H 'Authorization: Bearer YOUR_API_KEY' \
              -F image='@otter.png' \
              -F n=2 \
              -F size="1024x1024"
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Image.create_variation(
              image=open("otter.png", "rb"),
              n=2,
              size="1024x1024"
            )
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createImageVariation(
              fs.createReadStream("otter.png"),
              2,
              "1024x1024"
            );
        response: |
          {
            "created": 1589478378,
            "data": [
              {
                "url": "https://..."
              },
              {
                "url": "https://..."
              }
            ]
          }
  /embeddings:
    post:
      operationId: createEmbedding
      tags:
        - OpenAI
      summary: Creates an embedding vector representing the input text.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEmbeddingRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateEmbeddingResponse'
      x-oaiMeta:
        name: Create embeddings
        group: embeddings
        path: create
        examples:
          curl: |
            curl https://api.openai.com/v1/embeddings \
              -X POST \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{"input": "The food was delicious and the waiter...",
                   "model": "text-embedding-ada-002"}'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Embedding.create(
              model="text-embedding-ada-002",
              input="The food was delicious and the waiter..."
            )
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createEmbedding({
              model: "text-embedding-ada-002",
              input: "The food was delicious and the waiter...",
            });
        parameters: |
          {
            "model": "text-embedding-ada-002",
            "input": "The food was delicious and the waiter..."
          }
        response: |
          {
            "object": "list",
            "data": [
              {
                "object": "embedding",
                "embedding": [
                  0.0023064255,
                  -0.009327292,
                  .... (1056 floats total for ada)
                  -0.0028842222,
                ],
                "index": 0
              }
            ],
            "model": "text-embedding-ada-002",
            "usage": {
              "prompt_tokens": 8,
              "total_tokens": 8
            }
          }
  /engines/{engine_id}/search:
    post:
      operationId: createSearch
      deprecated: true
      tags:
      - OpenAI
      summary: |
        The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them.
        To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores.
        The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
      parameters:
        - in: path
          name: engine_id
          required: true
          schema:
            type: string
            example: davinci
          description: The ID of the engine to use for this request.  You can select one of `ada`, `babbage`, `curie`, or `davinci`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSearchRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSearchResponse'
      x-oaiMeta:
        name: Create search
        group: searches
        path: create
        examples:
          curl: |
            curl https://api.openai.com/v1/engines/davinci/search \
              -H "Content-Type: application/json" \
              -H 'Authorization: Bearer YOUR_API_KEY' \
              -d '{
              "documents": ["White House", "hospital", "school"],
              "query": "the president"
            }'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Engine("davinci").search(
              documents=["White House", "hospital", "school"],
              query="the president"
            )
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createSearch("davinci", {
              documents: ["White House", "hospital", "school"],
              query: "the president",
            });
        parameters: |
          {
            "documents": [
              "White House",
              "hospital",
              "school"
            ],
            "query": "the president"
          }
        response: |
          {
            "data": [
              {
                "document": 0,
                "object": "search_result",
                "score": 215.412
              },
              {
                "document": 1,
                "object": "search_result",
                "score": 40.316
              },
              {
                "document": 2,
                "object": "search_result",
                "score":  55.226
              }
            ],
            "object": "list"
          }
  /files:
    get:
      operationId: listFiles
      tags:
      - OpenAI
      summary: Returns a list of files that belong to the user's organization.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFilesResponse'
      x-oaiMeta:
        name: List files
        group: files
        path: list
        examples:
          curl: |
            curl https://api.openai.com/v1/files \
              -H 'Authorization: Bearer YOUR_API_KEY'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.File.list()
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.listFiles();
        response: |
          {
            "data": [
              {
                "id": "file-ccdDZrC3iZVNiQVeEA6Z66wf",
                "object": "file",
                "bytes": 175,
                "created_at": 1613677385,
                "filename": "train.jsonl",
                "purpose": "search"
              },
              {
                "id": "file-XjGxS3KTG0uNmNOK362iJua3",
                "object": "file",
                "bytes": 140,
                "created_at": 1613779121,
                "filename": "puppy.jsonl",
                "purpose": "search"
              }
            ],
            "object": "list"
          }
    post:
      operationId: createFile
      tags:
      - OpenAI
      summary: |
        Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateFileRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIFile'
      x-oaiMeta:
        name: Upload file
        group: files
        path: upload
        examples:
          curl: |
            curl https://api.openai.com/v1/files \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -F purpose="fine-tune" \
              -F file='@mydata.jsonl'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.File.create(
              file=open("mydata.jsonl", "rb"),
              purpose='fine-tune'
            )
          node.js: |
            const fs = require("fs");
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createFile(
              fs.createReadStream("mydata.jsonl"),
              "fine-tune"
            );
        response: |
          {
            "id": "file-XjGxS3KTG0uNmNOK362iJua3",
            "object": "file",
            "bytes": 140,
            "created_at": 1613779121,
            "filename": "mydata.jsonl",
            "purpose": "fine-tune"
          }
  /files/{file_id}:
    delete:
      operationId: deleteFile
      tags:
      - OpenAI
      summary: Delete a file.
      parameters:
        - in: path
          name: file_id
          required: true
          schema:
            type: string
          description: The ID of the file to use for this request
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteFileResponse'
      x-oaiMeta:
        name: Delete file
        group: files
        path: delete
        examples:
          curl: |
            curl https://api.openai.com/v1/files/file-XjGxS3KTG0uNmNOK362iJua3 \
              -X DELETE \
              -H 'Authorization: Bearer YOUR_API_KEY'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.File.delete("file-XjGxS3KTG0uNmNOK362iJua3")
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.deleteFile("file-XjGxS3KTG0uNmNOK362iJua3");
        response: |
          {
            "id": "file-XjGxS3KTG0uNmNOK362iJua3",
            "object": "file",
            "deleted": true
          }
    get:
      operationId: retrieveFile
      tags:
      - OpenAI
      summary: Returns information about a specific file.
      parameters:
        - in: path
          name: file_id
          required: true
          schema:
            type: string
          description: The ID of the file to use for this request
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIFile'
      x-oaiMeta:
        name: Retrieve file
        group: files
        path: retrieve
        examples:
          curl: |
            curl https://api.openai.com/v1/files/file-XjGxS3KTG0uNmNOK362iJua3 \
              -H 'Authorization: Bearer YOUR_API_KEY'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.File.retrieve("file-XjGxS3KTG0uNmNOK362iJua3")
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.retrieveFile("file-XjGxS3KTG0uNmNOK362iJua3");
        response: |
          {
            "id": "file-XjGxS3KTG0uNmNOK362iJua3",
            "object": "file",
            "bytes": 140,
            "created_at": 1613779657,
            "filename": "mydata.jsonl",
            "purpose": "fine-tune"
          }
  /files/{file_id}/content:
    get:
      operationId: downloadFile
      tags:
      - OpenAI
      summary: Returns the contents of the specified file
      parameters:
        - in: path
          name: file_id
          required: true
          schema:
            type: string
          description: The ID of the file to use for this request
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
      x-oaiMeta:
        name: Retrieve file content
        group: files
        path: retrieve-content
        examples:
          curl: |
            curl https://api.openai.com/v1/files/file-XjGxS3KTG0uNmNOK362iJua3/content \
              -H 'Authorization: Bearer YOUR_API_KEY' > file.jsonl
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            content = openai.File.download("file-XjGxS3KTG0uNmNOK362iJua3")
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.downloadFile("file-XjGxS3KTG0uNmNOK362iJua3");
  /answers:
    post:
      operationId: createAnswer
      deprecated: true
      tags:
      - OpenAI
      summary: |
        Answers the specified question using the provided documents and examples.
        The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAnswerRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAnswerResponse'
      x-oaiMeta:
        name: Create answer
        group: answers
        path: create
        examples:
          curl: |
            curl https://api.openai.com/v1/answers \
              -X POST \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -H 'Content-Type: application/json' \
              -d '{
                "documents": ["Puppy A is happy.", "Puppy B is sad."],
                "question": "which puppy is happy?",
                "search_model": "ada",
                "model": "curie",
                "examples_context": "In 2017, U.S. life expectancy was 78.6 years.",
                "examples": [["What is human life expectancy in the United States?","78 years."]],
                "max_tokens": 5,
                "stop": ["\n", "<|endoftext|>"]
              }'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Answer.create(
              search_model="ada",
              model="curie",
              question="which puppy is happy?",
              documents=["Puppy A is happy.", "Puppy B is sad."],
              examples_context="In 2017, U.S. life expectancy was 78.6 years.",
              examples=[["What is human life expectancy in the United States?","78 years."]],
              max_tokens=5,
              stop=["\n", "<|endoftext|>"],
            )
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createAnswer({
              search_model: "ada",
              model: "curie",
              question: "which puppy is happy?",
              documents: ["Puppy A is happy.", "Puppy B is sad."],
              examples_context: "In 2017, U.S. life expectancy was 78.6 years.",
              examples: [["What is human life expectancy in the United States?","78 years."]],
              max_tokens: 5,
              stop: ["\n", "<|endoftext|>"],
            });
        parameters: |
          {
            "documents": ["Puppy A is happy.", "Puppy B is sad."],
            "question": "which puppy is happy?",
            "search_model": "ada",
            "model": "curie",
            "examples_context": "In 2017, U.S. life expectancy was 78.6 years.",
            "examples": [["What is human life expectancy in the United States?","78 years."]],
            "max_tokens": 5,
            "stop": ["\n", "<|endoftext|>"]
          }
        response: |
          {
            "answers": [
              "puppy A."
            ],
            "completion": "cmpl-2euVa1kmKUuLpSX600M41125Mo9NI",
            "model": "curie:2020-05-03",
            "object": "answer",
            "search_model": "ada",
            "selected_documents": [
              {
                "document": 0,
                "text": "Puppy A is happy. "
              },
              {
                "document": 1,
                "text": "Puppy B is sad. "
              }
            ]
          }
  /classifications:
    post:
      operationId: createClassification
      deprecated: true
      tags:
      - OpenAI
      summary: |
        Classifies the specified `query` using provided examples.
        The endpoint first [searches](/docs/api-reference/searches) over the labeled examples
        to select the ones most relevant for the particular query. Then, the relevant examples
        are combined with the query to construct a prompt to produce the final label via the
        [completions](/docs/api-reference/completions) endpoint.
        Labeled examples can be provided via an uploaded `file`, or explicitly listed in the
        request using the `examples` parameter for quick tests and small scale use cases.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClassificationRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateClassificationResponse'
      x-oaiMeta:
        name: Create classification
        group: classifications
        path: create
        examples:
          curl: |
            curl https://api.openai.com/v1/classifications \
              -X POST \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -H 'Content-Type: application/json' \
              -d '{
                "examples": [
                  ["A happy moment", "Positive"],
                  ["I am sad.", "Negative"],
                  ["I am feeling awesome", "Positive"]],
                "query": "It is a raining day :(",
                "search_model": "ada",
                "model": "curie",
                "labels":["Positive", "Negative", "Neutral"]
              }'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Classification.create(
              search_model="ada",
              model="curie",
              examples=[
                ["A happy moment", "Positive"],
                ["I am sad.", "Negative"],
                ["I am feeling awesome", "Positive"]
              ],
              query="It is a raining day :(",
              labels=["Positive", "Negative", "Neutral"],
            )
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createClassification({
              search_model: "ada",
              model: "curie",
              examples: [
                ["A happy moment", "Positive"],
                ["I am sad.", "Negative"],
                ["I am feeling awesome", "Positive"]
              ],
              query:"It is a raining day :(",
              labels: ["Positive", "Negative", "Neutral"],
            });
        parameters: |
          {
            "examples": [
              ["A happy moment", "Positive"],
              ["I am sad.", "Negative"],
              ["I am feeling awesome", "Positive"]
            ],
            "labels": ["Positive", "Negative", "Neutral"],
            "query": "It is a raining day :(",
            "search_model": "ada",
            "model": "curie"
          }
        response: |
          {
            "completion": "cmpl-2euN7lUVZ0d4RKbQqRV79IiiE6M1f",
            "label": "Negative",
            "model": "curie:2020-05-03",
            "object": "classification",
            "search_model": "ada",
            "selected_examples": [
              {
                "document": 1,
                "label": "Negative",
                "text": "I am sad."
              },
              {
                "document": 0,
                "label": "Positive",
                "text": "A happy moment"
              },
              {
                "document": 2,
                "label": "Positive",
                "text": "I am feeling awesome"
              }
            ]
          }
  /fine-tunes:
    post:
      operationId: createFineTune
      tags:
      - OpenAI
      summary: |
        Creates a job that fine-tunes a specified model from a given dataset.
        Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
        [Learn more about Fine-tuning](/docs/guides/fine-tuning)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFineTuneRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTune'
      x-oaiMeta:
        name: Create fine-tune
        group: fine-tunes
        path: create
        beta: true
        examples:
          curl: |
            curl https://api.openai.com/v1/fine-tunes \
              -X POST \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -d '{
              "training_file": "file-XGinujblHPwGLSztz8cPS8XY"
            }'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.FineTune.create(training_file="file-XGinujblHPwGLSztz8cPS8XY")
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createFineTune({
              training_file: "file-XGinujblHPwGLSztz8cPS8XY",
            });
        response: |
          {
            "id": "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
            "object": "fine-tune",
            "model": "curie",
            "created_at": 1614807352,
            "events": [
              {
                "object": "fine-tune-event",
                "created_at": 1614807352,
                "level": "info",
                "message": "Job enqueued. Waiting for jobs ahead to complete. Queue number: 0."
              }
            ],
            "fine_tuned_model": null,
            "hyperparams": {
              "batch_size": 4,
              "learning_rate_multiplier": 0.1,
              "n_epochs": 4,
              "prompt_loss_weight": 0.1,
            },
            "organization_id": "org-...",
            "result_files": [],
            "status": "pending",
            "validation_files": [],
            "training_files": [
              {
                "id": "file-XGinujblHPwGLSztz8cPS8XY",
                "object": "file",
                "bytes": 1547276,
                "created_at": 1610062281,
                "filename": "my-data-train.jsonl",
                "purpose": "fine-tune-train"
              }
            ],
            "updated_at": 1614807352,
          }
    get:
      operationId: listFineTunes
      tags:
      - OpenAI
      summary: |
        List your organization's fine-tuning jobs
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFineTunesResponse'
      x-oaiMeta:
        name: List fine-tunes
        group: fine-tunes
        path: list
        beta: true
        examples:
          curl: |
            curl https://api.openai.com/v1/fine-tunes \
              -H 'Authorization: Bearer YOUR_API_KEY'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.FineTune.list()
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.listFineTunes();
        response: |
          {
            "object": "list",
            "data": [
              {
                "id": "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
                "object": "fine-tune",
                "model": "curie",
                "created_at": 1614807352,
                "fine_tuned_model": null,
                "hyperparams": { ... },
                "organization_id": "org-...",
                "result_files": [],
                "status": "pending",
                "validation_files": [],
                "training_files": [ { ... } ],
                "updated_at": 1614807352,
              },
              { ... },
              { ... }
            ]
          }
  /fine-tunes/{fine_tune_id}:
    get:
      operationId: retrieveFineTune
      tags:
      - OpenAI
      summary: |
        Gets info about the fine-tune job.
        [Learn more about Fine-tuning](/docs/guides/fine-tuning)
      parameters:
        - in: path
          name: fine_tune_id
          required: true
          schema:
            type: string
            example:
              ft-AF1WoRqd3aJAHsqc9NY7iL8F
          description: |
            The ID of the fine-tune job
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTune'
      x-oaiMeta:
        name: Retrieve fine-tune
        group: fine-tunes
        path: retrieve
        beta: true
        examples:
          curl: |
            curl https://api.openai.com/v1/fine-tunes/ft-AF1WoRqd3aJAHsqc9NY7iL8F \
              -H "Authorization: Bearer YOUR_API_KEY"
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.FineTune.retrieve(id="ft-AF1WoRqd3aJAHsqc9NY7iL8F")
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.retrieveFineTune("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
        response: |
          {
            "id": "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
            "object": "fine-tune",
            "model": "curie",
            "created_at": 1614807352,
            "events": [
              {
                "object": "fine-tune-event",
                "created_at": 1614807352,
                "level": "info",
                "message": "Job enqueued. Waiting for jobs ahead to complete. Queue number: 0."
              },
              {
                "object": "fine-tune-event",
                "created_at": 1614807356,
                "level": "info",
                "message": "Job started."
              },
              {
                "object": "fine-tune-event",
                "created_at": 1614807861,
                "level": "info",
                "message": "Uploaded snapshot: curie:ft-acmeco-2021-03-03-21-44-20."
              },
              {
                "object": "fine-tune-event",
                "created_at": 1614807864,
                "level": "info",
                "message": "Uploaded result files: file-QQm6ZpqdNwAaVC3aSz5sWwLT."
              },
              {
                "object": "fine-tune-event",
                "created_at": 1614807864,
                "level": "info",
                "message": "Job succeeded."
              }
            ],
            "fine_tuned_model": "curie:ft-acmeco-2021-03-03-21-44-20",
            "hyperparams": {
              "batch_size": 4,
              "learning_rate_multiplier": 0.1,
              "n_epochs": 4,
              "prompt_loss_weight": 0.1,
            },
            "organization_id": "org-...",
            "result_files": [
              {
                "id": "file-QQm6ZpqdNwAaVC3aSz5sWwLT",
                "object": "file",
                "bytes": 81509,
                "created_at": 1614807863,
                "filename": "compiled_results.csv",
                "purpose": "fine-tune-results"
              }
            ],
            "status": "succeeded",
            "validation_files": [],
            "training_files": [
              {
                "id": "file-XGinujblHPwGLSztz8cPS8XY",
                "object": "file",
                "bytes": 1547276,
                "created_at": 1610062281,
                "filename": "my-data-train.jsonl",
                "purpose": "fine-tune-train"
              }
            ],
            "updated_at": 1614807865,
          }
  /fine-tunes/{fine_tune_id}/cancel:
    post:
      operationId: cancelFineTune
      tags:
      - OpenAI
      summary: |
        Immediately cancel a fine-tune job.
      parameters:
        - in: path
          name: fine_tune_id
          required: true
          schema:
            type: string
            example:
              ft-AF1WoRqd3aJAHsqc9NY7iL8F
          description: |
            The ID of the fine-tune job to cancel
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTune'
      x-oaiMeta:
        name: Cancel fine-tune
        group: fine-tunes
        path: cancel
        beta: true
        examples:
          curl: |
            curl https://api.openai.com/v1/fine-tunes/ft-AF1WoRqd3aJAHsqc9NY7iL8F/cancel \
              -X POST \
              -H "Authorization: Bearer YOUR_API_KEY"
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.FineTune.cancel(id="ft-AF1WoRqd3aJAHsqc9NY7iL8F")
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.cancelFineTune("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
        response: |
          {
            "id": "ft-xhrpBbvVUzYGo8oUO1FY4nI7",
            "object": "fine-tune",
            "model": "curie",
            "created_at": 1614807770,
            "events": [ { ... } ],
            "fine_tuned_model": null,
            "hyperparams": { ... },
            "organization_id": "org-...",
            "result_files": [],
            "status": "cancelled",
            "validation_files": [],
            "training_files": [
              {
                "id": "file-XGinujblHPwGLSztz8cPS8XY",
                "object": "file",
                "bytes": 1547276,
                "created_at": 1610062281,
                "filename": "my-data-train.jsonl",
                "purpose": "fine-tune-train"
              }
            ],
            "updated_at": 1614807789,
          }
  /fine-tunes/{fine_tune_id}/events:
    get:
      operationId: listFineTuneEvents
      tags:
      - OpenAI
      summary: |
        Get fine-grained status updates for a fine-tune job.
      parameters:
        - in: path
          name: fine_tune_id
          required: true
          schema:
            type: string
            example:
              ft-AF1WoRqd3aJAHsqc9NY7iL8F
          description: |
            The ID of the fine-tune job to get events for.
        - in: query
          name: stream
          required: false
          schema:
            type: boolean
            default: false
          description: |
            Whether to stream events for the fine-tune job. If set to true,
            events will be sent as data-only
            [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
            as they become available. The stream will terminate with a
            `data: [DONE]` message when the job is finished (succeeded, cancelled,
            or failed).
            If set to false, only events generated so far will be returned.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFineTuneEventsResponse'
      x-oaiMeta:
        name: List fine-tune events
        group: fine-tunes
        path: events
        beta: true
        examples:
          curl: |
            curl https://api.openai.com/v1/fine-tunes/ft-AF1WoRqd3aJAHsqc9NY7iL8F/events \
              -H "Authorization: Bearer YOUR_API_KEY"
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.FineTune.list_events(id="ft-AF1WoRqd3aJAHsqc9NY7iL8F")
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.listFineTuneEvents("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
        response: |
          {
            "object": "list",
            "data": [
              {
                "object": "fine-tune-event",
                "created_at": 1614807352,
                "level": "info",
                "message": "Job enqueued. Waiting for jobs ahead to complete. Queue number: 0."
              },
              {
                "object": "fine-tune-event",
                "created_at": 1614807356,
                "level": "info",
                "message": "Job started."
              },
              {
                "object": "fine-tune-event",
                "created_at": 1614807861,
                "level": "info",
                "message": "Uploaded snapshot: curie:ft-acmeco-2021-03-03-21-44-20."
              },
              {
                "object": "fine-tune-event",
                "created_at": 1614807864,
                "level": "info",
                "message": "Uploaded result files: file-QQm6ZpqdNwAaVC3aSz5sWwLT."
              },
              {
                "object": "fine-tune-event",
                "created_at": 1614807864,
                "level": "info",
                "message": "Job succeeded."
              }
            ]
          }
  /models:
    get:
      operationId: listModels
      tags:
        - OpenAI
      summary: Lists the currently available models, and provides basic information about each one such as the owner and availability.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListModelsResponse'
      x-oaiMeta:
        name: List models
        group: models
        path: list
        examples:
          curl: |
            curl https://api.openai.com/v1/models \
              -H 'Authorization: Bearer YOUR_API_KEY'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Model.list()
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.listModels();
        response: |
          {
            "data": [
              {
                "id": "model-id-0",
                "object": "model",
                "owned_by": "organization-owner",
                "permission": [...]
              },
              {
                "id": "model-id-1",
                "object": "model",
                "owned_by": "organization-owner",
                "permission": [...]
              },
              {
                "id": "model-id-2",
                "object": "model",
                "owned_by": "openai",
                "permission": [...]
              },
            ],
            "object": "list"
          }
  /models/{model}:
    get:
      operationId: retrieveModel
      tags:
        - OpenAI
      summary: Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
      parameters:
        - in: path
          name: model
          required: true
          schema:
            type: string
            # ideally this will be an actual ID, so this will always work from browser
            example:
              text-davinci-001
          description:
            The ID of the model to use for this request
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Model'
      x-oaiMeta:
        name: Retrieve model
        group: models
        path: retrieve
        examples:
          curl: |
            curl https://api.openai.com/v1/models/VAR_model_id \
              -H 'Authorization: Bearer YOUR_API_KEY'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Model.retrieve("VAR_model_id")
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.retrieveModel("VAR_model_id");
        response: |
          {
            "id": "VAR_model_id",
            "object": "model",
            "owned_by": "openai",
            "permission": [...]
          }
    delete:
      operationId: deleteModel
      tags:
      - OpenAI
      summary: Delete a fine-tuned model. You must have the Owner role in your organization.
      parameters:
        - in: path
          name: model
          required: true
          schema:
            type: string
            example: curie:ft-acmeco-2021-03-03-21-44-20
          description: The model to delete
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteModelResponse'
      x-oaiMeta:
        name: Delete fine-tune model
        group: fine-tunes
        path: delete-model
        beta: true
        examples:
          curl: |
            curl https://api.openai.com/v1/models/curie:ft-acmeco-2021-03-03-21-44-20 \
              -X DELETE \
              -H "Authorization: Bearer YOUR_API_KEY"
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Model.delete("curie:ft-acmeco-2021-03-03-21-44-20")
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.deleteModel('curie:ft-acmeco-2021-03-03-21-44-20');
        response: |
          {
            "id": "curie:ft-acmeco-2021-03-03-21-44-20",
            "object": "model",
            "deleted": true
          }
  /moderations:
    post:
      operationId: createModeration
      tags:
        - OpenAI
      summary: Classifies if text violates OpenAI's Content Policy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateModerationRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateModerationResponse'
      x-oaiMeta:
        name: Create moderation
        group: moderations
        path: create
        examples:
          curl: |
            curl https://api.openai.com/v1/moderations \
              -H 'Content-Type: application/json' \
              -H 'Authorization: Bearer YOUR_API_KEY' \
              -d '{
              "input": "I want to kill them."
            }'
          python: |
            import os
            import openai
            openai.api_key = os.getenv("OPENAI_API_KEY")
            openai.Moderation.create(
              input="I want to kill them.",
            )
          node.js: |
            const { Configuration, OpenAIApi } = require("openai");
            const configuration = new Configuration({
              apiKey: process.env.OPENAI_API_KEY,
            });
            const openai = new OpenAIApi(configuration);
            const response = await openai.createModeration({
              input: "I want to kill them.",
            });
        parameters: |
          {
            "input": "I want to kill them."
          }
        response: |
          {
            "id": "modr-5MWoLO",
            "model": "text-moderation-001",
            "results": [
              {
                "categories": {
                  "hate": false,
                  "hate/threatening": true,
                  "self-harm": false,
                  "sexual": false,
                  "sexual/minors": false,
                  "violence": true,
                  "violence/graphic": false
                },
                "category_scores": {
                  "hate": 0.22714105248451233,
                  "hate/threatening": 0.4132447838783264,
                  "self-harm": 0.005232391878962517,
                  "sexual": 0.01407341007143259,
                  "sexual/minors": 0.0038522258400917053,
                  "violence": 0.9223177433013916,
                  "violence/graphic": 0.036865197122097015
                },
                "flagged": true
              }
            ]
          }
components:
  schemas:
    ListEnginesResponse:
      type: object
      properties:
        object:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Engine'
      required:
        - object
        - data

    ListModelsResponse:
      type: object
      properties:
        object:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Model'
      required:
        - object
        - data

    DeleteModelResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
        deleted:
          type: boolean
      required:
        - id
        - object
        - deleted

    CreateCompletionRequest:
      type: object
      properties:
        model: &model_configuration
          description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
          type: string
        prompt:
          description: &completions_prompt_description |
            The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.

            Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.
          default: '<|endoftext|>'
          nullable: true
          oneOf:
            - type: string
              default: ''
              example: "This is a test."
            - type: array
              items:
                type: string
                default: ''
                example: "This is a test."
            - type: array
              minItems: 1
              items:
                type: integer
              example: "[1212, 318, 257, 1332, 13]"
            - type: array
              minItems: 1
              items:
                type: array
                minItems: 1
                items:
                  type: integer
              example: "[[1212, 318, 257, 1332, 13]]"
        suffix:
          description:
            The suffix that comes after a completion of inserted text.
          default: null
          nullable: true
          type: string
          example: "test."
        max_tokens:
          type: integer
          minimum: 0
          default: 16
          example: 16
          nullable: true
          description: &completions_max_tokens_description |
            The maximum number of [tokens](/tokenizer) to generate in the completion.

            The token count of your prompt plus `max_tokens` cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).
        temperature:
          type: number
          minimum: 0
          maximum: 2
          default: 1
          example: 1
          nullable: true
          description: &completions_temperature_description |
            What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.

            We generally recommend altering this or `top_p` but not both.
        top_p:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          example: 1
          nullable: true
          description: &completions_top_p_description |
            An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

            We generally recommend altering this or `temperature` but not both.
        n:
          type: integer
          minimum: 1
          maximum: 128
          default: 1
          example: 1
          nullable: true
          description: &completions_completions_description |
            How many completions to generate for each prompt.

            **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.
        stream:
          description: >
            Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
            as they become available, with the stream terminated by a `data: [DONE]` message.
          type: boolean
          nullable: true
          default: false
        logprobs: &completions_logprobs_configuration
          type: integer
          minimum: 0
          maximum: 5
          default: null
          nullable: true
          description: &completions_logprobs_description |
            Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.

            The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case.
        echo:
          type: boolean
          default: false
          nullable: true
          description: &completions_echo_description >
            Echo back the prompt in addition to the completion
        stop:
          description: &completions_stop_description >
            Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
          default: null
          nullable: true
          oneOf:
            - type: string
              default: <|endoftext|>
              example: "\n"
              nullable: true
            - type: array
              minItems: 1
              maxItems: 4
              items:
                type: string
                example: '["\n"]'
        presence_penalty:
          type: number
          default: 0
          minimum: -2
          maximum: 2
          nullable: true
          description: &completions_presence_penalty_description |
            Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

            [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details)
        frequency_penalty:
          type: number
          default: 0
          minimum: -2
          maximum: 2
          nullable: true
          description: &completions_frequency_penalty_description |
            Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

            [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details)
        best_of:
          type: integer
          default: 1
          minimum: 0
          maximum: 20
          nullable: true
          description: &completions_best_of_description |
            Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed.

            When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return  `best_of` must be greater than `n`.

            **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.
        logit_bias: &completions_logit_bias
          type: object
          x-oaiTypeLabel: map
          default: null
          nullable: true
          description: &completions_logit_bias_description |
            Modify the likelihood of specified tokens appearing in the completion.

            Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.

            As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated.
        user: &end_user_param_configuration
          type: string
          example: user-1234
          description: |
            A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
      required:
        - model

    CreateCompletionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              text:
                type: string
              index:
                type: integer
              logprobs:
                type: object
                nullable: true
                properties:
                  tokens:
                    type: array
                    items:
                      type: string
                  token_logprobs:
                    type: array
                    items:
                      type: number
                  top_logprobs:
                    type: array
                    items:
                      type: object
                  text_offset:
                    type: array
                    items:
                      type: integer
              finish_reason:
                type: string
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
          required: 
            - prompt_tokens
            - completion_tokens
            - total_tokens
      required: 
        - id
        - object
        - created
        - model
        - choices

    CreateEditRequest:
      type: object
      properties:
        model: *model_configuration
        input:
          description:
            The input text to use as a starting point for the edit.
          type: string
          default: ''
          nullable: true
          example: "What day of the wek is it?"
        instruction:
          description:
            The instruction that tells the model how to edit the prompt.
          type: string
          example: "Fix the spelling mistakes."
        n:
          type: integer
          minimum: 1
          maximum: 20
          default: 1
          example: 1
          nullable: true
          description:
            How many edits to generate for the input and instruction.
        temperature:
          type: number
          minimum: 0
          maximum: 2
          default: 1
          example: 1
          nullable: true
          description: *completions_temperature_description
        top_p:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          example: 1
          nullable: true
          description: *completions_top_p_description
      required:
        - model
        - instruction

    CreateEditResponse:
      type: object
      properties:
        object:
          type: string
        created:
          type: integer
        choices:
          type: array
          items:
            type: object
            properties:
              text:
                type: string
              index:
                type: integer
              logprobs:
                type: object
                nullable: true
                properties:
                  tokens:
                    type: array
                    items:
                      type: string
                  token_logprobs:
                    type: array
                    items:
                      type: number
                  top_logprobs:
                    type: array
                    items:
                      type: object
                  text_offset:
                    type: array
                    items:
                      type: integer
              finish_reason:
                type: string
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
          required: 
            - prompt_tokens
            - completion_tokens
            - total_tokens
      required: 
        - object
        - created
        - choices
        - usage

    CreateImageRequest:
      type: object
      properties:
        prompt:
          description: A text description of the desired image(s). The maximum length is 1000 characters.
          type: string
          example: "A cute baby sea otter"
        n: &images_n
          type: integer
          minimum: 1
          maximum: 10
          default: 1
          example: 1
          nullable: true
          description: The number of images to generate. Must be between 1 and 10.
        size: &images_size
          type: string
          enum: ["256x256", "512x512", "1024x1024"]
          default: "1024x1024"
          example: "1024x1024"
          nullable: true
          description: The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
        response_format: &images_response_format
          type: string
          enum: ["url", "b64_json"]
          default: "url"
          example: "url"
          nullable: true
          description: The format in which the generated images are returned. Must be one of `url` or `b64_json`.
        user: *end_user_param_configuration
      required:
        - prompt

    ImagesResponse:
      properties:
        created:
          type: integer
        data:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
              b64_json:
                type: string
      required:
        - created
        - data

    CreateImageEditRequest:
      type: object
      properties:
        image:
          description: The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
          type: string
          format: binary
        mask:
          description: An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
          type: string
          format: binary
        prompt:
          description: A text description of the desired image(s). The maximum length is 1000 characters.
          type: string
          example: "A cute baby sea otter wearing a beret"
        n: *images_n
        size: *images_size
        response_format: *images_response_format
        user: *end_user_param_configuration
      required:
        - prompt
        - image

    CreateImageVariationRequest:
      type: object
      properties:
        image:
          description: The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
          type: string
          format: binary
        n: *images_n
        size: *images_size
        response_format: *images_response_format
        user: *end_user_param_configuration
      required:
        - image

    CreateModerationRequest:
      type: object
      properties:
        input:
          description: The input text to classify
          oneOf:
            - type: string
              default: ''
              example: "I want to kill them."
            - type: array
              items:
                type: string
                default: ''
                example: "I want to kill them."
        model:
          description: |
            Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`.
            The default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`.
          type: string
          nullable: false
          default: "text-moderation-latest"
          example: "text-moderation-stable"
      required:
        - input

    CreateModerationResponse:
      type: object
      properties:
        id:
          type: string
        model:
          type: string
        results:
          type: array
          items:
            type: object
            properties:
              flagged:
                type: boolean
              categories:
                type: object
                properties:
                  hate:
                    type: boolean
                  hate/threatening:
                    type: boolean
                  self-harm:
                    type: boolean
                  sexual:
                    type: boolean
                  sexual/minors:
                    type: boolean
                  violence:
                    type: boolean
                  violence/graphic:
                    type: boolean
                required: 
                  - hate
                  - hate/threatening
                  - self-harm
                  - sexual
                  - sexual/minors
                  - violence
                  - violence/graphic
              category_scores:
                type: object
                properties:
                  hate:
                    type: number
                  hate/threatening:
                    type: number
                  self-harm:
                    type: number
                  sexual:
                    type: number
                  sexual/minors:
                    type: number
                  violence:
                    type: number
                  violence/graphic:
                    type: number
                required: 
                  - hate
                  - hate/threatening
                  - self-harm
                  - sexual
                  - sexual/minors
                  - violence
                  - violence/graphic
            required: 
              - flagged
              - categories
              - category_scores
      required: 
        - id
        - model
        - results

    CreateSearchRequest:
      type: object
      properties:
        query:
          description: Query to search against the documents.
          type: string
          example: "the president"
          minLength: 1
        documents:
          description: |
            Up to 200 documents to search over, provided as a list of strings.
            The maximum document length (in tokens) is 2034 minus the number of tokens in the query.
            You should specify either `documents` or a `file`, but not both.
          type: array
          minItems: 1
          maxItems: 200
          items:
            type: string
          nullable: true
          example: "['White House', 'hospital', 'school']"
        file:
          description: |
            The ID of an uploaded file that contains documents to search over.
            You should specify either `documents` or a `file`, but not both.
          type: string
          nullable: true
        max_rerank:
          description: |
            The maximum number of documents to be re-ranked and returned by search.
            This flag only takes effect when `file` is set.
          type: integer
          minimum: 1
          default: 200
          nullable: true
        return_metadata: &return_metadata_configuration
          description: |
            A special boolean flag for showing metadata. If set to `true`, each document entry in the returned JSON will contain a "metadata" field.
            This flag only takes effect when `file` is set.
          type: boolean
          default: false
          nullable: true
        user: *end_user_param_configuration
      required:
        - query

    CreateSearchResponse:
      type: object
      properties:
        object:
          type: string
        model:
          type: string
        data:
          type: array
          items:
            type: object
            properties:
              object:
                type: string
              document:
                type: integer
              score:
                type: number

    ListFilesResponse:
      type: object
      properties:
        object:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/OpenAIFile'
      required: 
        - object
        - data

    CreateFileRequest:
      type: object
      additionalProperties: false
      properties:
        file:
          description: |
            Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded.
            If the `purpose` is set to "fine-tune", each line is a JSON record with "prompt" and "completion" fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
          type: string
          format: binary
        purpose:
          description: |
            The intended purpose of the uploaded documents.
            Use "fine-tune" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
          type: string
      required:
        - file
        - purpose

    DeleteFileResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
        deleted:
          type: boolean
      required: 
        - id
        - object
        - deleted

    CreateAnswerRequest:
      type: object
      additionalProperties: false
      properties:
        model:
          description: ID of the model to use for completion. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
          type: string
        question:
          description: Question to get answered.
          type: string
          minLength: 1
          example: "What is the capital of Japan?"
        examples:
          description: List of (question, answer) pairs that will help steer the model towards the tone and answer format you'd like. We recommend adding 2 to 3 examples.
          type: array
          minItems: 1
          maxItems: 200
          items:
            type: array
            minItems: 2
            maxItems: 2
            items:
              type: string
              minLength: 1
          example: "[['What is the capital of Canada?', 'Ottawa'], ['Which province is Ottawa in?', 'Ontario']]"
        examples_context:
          description: A text snippet containing the contextual information used to generate the answers for the `examples` you provide.
          type: string
          example: "Ottawa, Canada's capital, is located in the east of southern Ontario, near the city of Montréal and the U.S. border."
        documents:
          description: |
            List of documents from which the answer for the input `question` should be derived. If this is an empty list, the question will be answered based on the question-answer examples.
            You should specify either `documents` or a `file`, but not both.
          type: array
          maxItems: 200
          items:
            type: string
          example: "['Japan is an island country in East Asia, located in the northwest Pacific Ocean.', 'Tokyo is the capital and most populous prefecture of Japan.']"
          nullable: true
        file:
          description: |
            The ID of an uploaded file that contains documents to search over. See [upload file](/docs/api-reference/files/upload) for how to upload a file of the desired format and purpose.
            You should specify either `documents` or a `file`, but not both.
          type: string
          nullable: true
        search_model: &search_model_configuration
          description: ID of the model to use for [Search](/docs/api-reference/searches/create). You can select one of `ada`, `babbage`, `curie`, or `davinci`.
          type: string
          default: ada
          nullable: true
        max_rerank:
          description: The maximum number of documents to be ranked by [Search](/docs/api-reference/searches/create) when using `file`. Setting it to a higher value leads to improved accuracy but with increased latency and cost.
          type: integer
          default: 200
          nullable: true
        temperature:
          description: What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values mean the model will take more risks and value 0 (argmax sampling) works better for scenarios with a well-defined answer.
          type: number
          default: 0
          nullable: true
        logprobs: &context_completions_logprobs_configuration
          type: integer
          minimum: 0
          maximum: 5
          default: null
          nullable: true
          description: |
            Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.
            The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case.
            When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
        max_tokens:
          description: The maximum number of tokens allowed for the generated answer
          type: integer
          default: 16
          nullable: true
        stop:
          description: *completions_stop_description
          default: null
          oneOf:
            - type: string
              default: <|endoftext|>
              example: "\n"
            - type: array
              minItems: 1
              maxItems: 4
              items:
                type: string
                example: '["\n"]'
          nullable: true
        n:
          description: How many answers to generate for each question.
          type: integer
          minimum: 1
          maximum: 10
          default: 1
          nullable: true
        logit_bias: *completions_logit_bias
        return_metadata: *return_metadata_configuration
        return_prompt: &return_prompt_configuration
          description: If set to `true`, the returned JSON will include a "prompt" field containing the final prompt that was used to request a completion. This is mainly useful for debugging purposes.
          type: boolean
          default: false
          nullable: true
        expand: &expand_configuration
          description: If an object name is in the list, we provide the full information of the object; otherwise, we only provide the object ID. Currently we support `completion` and `file` objects for expansion.
          type: array
          items: {}
          nullable: true
          default: []
        user: *end_user_param_configuration
      required:
        - model
        - question
        - examples
        - examples_context

    CreateAnswerResponse:
      type: object
      properties:
        object:
          type: string
        model:
          type: string
        search_model:
          type: string
        completion:
          type: string
        answers:
          type: array
          items:
            type: string
        selected_documents:
          type: array
          items:
            type: object
            properties:
              document:
                type: integer
              text:
                type: string

    CreateClassificationRequest:
      type: object
      additionalProperties: false
      properties:
        model: *model_configuration
        query:
          description: Query to be classified.
          type: string
          minLength: 1
          example: "The plot is not very attractive."
        examples:
          description: |
            A list of examples with labels, in the following format:
            `[["The movie is so interesting.", "Positive"], ["It is quite boring.", "Negative"], ...]`
            All the label strings will be normalized to be capitalized.
            You should specify either `examples` or `file`, but not both.
          type: array
          minItems: 2
          maxItems: 200
          items:
            type: array
            minItems: 2
            maxItems: 2
            items:
              type: string
              minLength: 1
          example: "[['Do not see this film.', 'Negative'], ['Smart, provocative and blisteringly funny.', 'Positive']]"
          nullable: true
        file:
          description: |
            The ID of the uploaded file that contains training examples. See [upload file](/docs/api-reference/files/upload) for how to upload a file of the desired format and purpose.
            You should specify either `examples` or `file`, but not both.
          type: string
          nullable: true
        labels:
          description: The set of categories being classified. If not specified, candidate labels will be automatically collected from the examples you provide. All the label strings will be normalized to be capitalized.
          type: array
          minItems: 2
          maxItems: 200
          default: null
          items:
            type: string
          example: ["Positive", "Negative"]
          nullable: true
        search_model: *search_model_configuration
        temperature:
          description:
            What sampling `temperature` to use. Higher values mean the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.
          type: number
          minimum: 0
          maximum: 2
          default: 0
          nullable: true
          example: 0
        logprobs: *context_completions_logprobs_configuration
        max_examples:
          description: The maximum number of examples to be ranked by [Search](/docs/api-reference/searches/create) when using `file`. Setting it to a higher value leads to improved accuracy but with increased latency and cost.
          type: integer
          default: 200
          nullable: true
        logit_bias: *completions_logit_bias
        return_prompt: *return_prompt_configuration
        return_metadata: *return_metadata_configuration
        expand: *expand_configuration
        user: *end_user_param_configuration
      required:
        - model
        - query

    CreateClassificationResponse:
      type: object
      properties:
        object:
          type: string
        model:
          type: string
        search_model:
          type: string
        completion:
          type: string
        label:
          type: string
        selected_examples:
          type: array
          items:
            type: object
            properties:
              document:
                type: integer
              text:
                type: string
              label:
                type: string

    CreateFineTuneRequest:
      type: object
      properties:
        training_file:
          description: |
            The ID of an uploaded file that contains training data.
            See [upload file](/docs/api-reference/files/upload) for how to upload a file.
            Your dataset must be formatted as a JSONL file, where each training
            example is a JSON object with the keys "prompt" and "completion".
            Additionally, you must upload your file with the purpose `fine-tune`.
            See the [fine-tuning guide](/docs/guides/fine-tuning/creating-training-data) for more details.
          type: string
          example: "file-ajSREls59WBbvgSzJSVWxMCB"
        validation_file:
          description: |
            The ID of an uploaded file that contains validation data.
            If you provide this file, the data is used to generate validation
            metrics periodically during fine-tuning. These metrics can be viewed in
            the [fine-tuning results file](/docs/guides/fine-tuning/analyzing-your-fine-tuned-model).
            Your train and validation data should be mutually exclusive.
            Your dataset must be formatted as a JSONL file, where each validation
            example is a JSON object with the keys "prompt" and "completion".
            Additionally, you must upload your file with the purpose `fine-tune`.
            See the [fine-tuning guide](/docs/guides/fine-tuning/creating-training-data) for more details.
          type: string
          nullable: true
          example: "file-XjSREls59WBbvgSzJSVWxMCa"
        model:
          description: |
            The name of the base model to fine-tune. You can select one of "ada",
            "babbage", "curie", "davinci", or a fine-tuned model created after 2022-04-21.
            To learn more about these models, see the
            [Models](https://beta.openai.com/docs/models) documentation.
          default: "curie"
          type: string
          nullable: true
        n_epochs:
          description: |
            The number of epochs to train the model for. An epoch refers to one
            full cycle through the training dataset.
          default: 4
          type: integer
          nullable: true
        batch_size:
          description: |
            The batch size to use for training. The batch size is the number of
            training examples used to train a single forward and backward pass.
            By default, the batch size will be dynamically configured to be
            ~0.2% of the number of examples in the training set, capped at 256 -
            in general, we've found that larger batch sizes tend to work better
            for larger datasets.
          default: null
          type: integer
          nullable: true
        learning_rate_multiplier:
          description: |
            The learning rate multiplier to use for training.
            The fine-tuning learning rate is the original learning rate used for
            pretraining multiplied by this value.
            By default, the learning rate multiplier is the 0.05, 0.1, or 0.2
            depending on final `batch_size` (larger learning rates tend to
            perform better with larger batch sizes). We recommend experimenting
            with values in the range 0.02 to 0.2 to see what produces the best
            results.
          default: null
          type: number
          nullable: true
        prompt_loss_weight:
          description: |
            The weight to use for loss on the prompt tokens. This controls how
            much the model tries to learn to generate the prompt (as compared
            to the completion which always has a weight of 1.0), and can add
            a stabilizing effect to training when completions are short.
            If prompts are extremely long (relative to completions), it may make
            sense to reduce this weight so as to avoid over-prioritizing
            learning the prompt.
          default: 0.01
          type: number
          nullable: true
        compute_classification_metrics:
          description: |
            If set, we calculate classification-specific metrics such as accuracy
            and F-1 score using the validation set at the end of every epoch.
            These metrics can be viewed in the [results file](/docs/guides/fine-tuning/analyzing-your-fine-tuned-model).
            In order to compute classification metrics, you must provide a
            `validation_file`. Additionally, you must
            specify `classification_n_classes` for multiclass classification or
            `classification_positive_class` for binary classification.
          type: boolean
          default: false
          nullable: true
        classification_n_classes:
          description: |
            The number of classes in a classification task.
            This parameter is required for multiclass classification.
          type: integer
          default: null
          nullable: true
        classification_positive_class:
          description: |
            The positive class in binary classification.
            This parameter is needed to generate precision, recall, and F1
            metrics when doing binary classification.
          type: string
          default: null
          nullable: true
        classification_betas:
          description: |
            If this is provided, we calculate F-beta scores at the specified
            beta values. The F-beta score is a generalization of F-1 score.
            This is only used for binary classification.
            With a beta of 1 (i.e. the F-1 score), precision and recall are
            given the same weight. A larger beta score puts more weight on
            recall and less on precision. A smaller beta score puts more weight
            on precision and less on recall.
          type: array
          items:
            type: number
          example: [0.6, 1, 1.5, 2]
          default: null
          nullable: true
        suffix:
          description: |
            A string of up to 40 characters that will be added to your fine-tuned model name.
            For example, a `suffix` of "custom-model-name" would produce a model name like `ada:ft-your-org:custom-model-name-2022-02-15-04-21-04`.
          type: string
          minLength: 1
          maxLength: 40
          default: null
          nullable: true
      required:
        - training_file

    ListFineTunesResponse:
      type: object
      properties:
        object:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/FineTune'
      required: 
        - object
        - data

    ListFineTuneEventsResponse:
      type: object
      properties:
        object:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/FineTuneEvent'
      required: 
        - object
        - data

    CreateEmbeddingRequest:
      type: object
      additionalProperties: false
      properties:
        model: *model_configuration
        input:
          description: |
            Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length.
          example: "The quick brown fox jumped over the lazy dog"
          oneOf:
            - type: string
              default: ''
              example: "This is a test."
            - type: array
              items:
                type: string
                default: ''
                example: "This is a test."
            - type: array
              minItems: 1
              items:
                type: integer
              example: "[1212, 318, 257, 1332, 13]"
            - type: array
              minItems: 1
              items:
                type: array
                minItems: 1
                items:
                  type: integer
              example: "[[1212, 318, 257, 1332, 13]]"
        user: *end_user_param_configuration
      required:
        - model
        - input

    CreateEmbeddingResponse:
      type: object
      properties:
        object:
          type: string
        model:
          type: string
        data:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              object:
                type: string
              embedding:
                type: array
                items:
                  type: number
            required: 
              - index
              - object
              - embedding
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            total_tokens:
              type: integer
          required: 
            - prompt_tokens
            - total_tokens
      required: 
        - object
        - model
        - data
        - usage

    Engine:
      title: Engine
      properties:
        id:
          type: string
        object:
          type: string
        created:
          type: integer
          nullable: true
        ready:
          type: boolean
      required: 
        - id
        - object
        - created
        - ready

    Model:
      title: Model
      properties:
        id:
          type: string
        object:
          type: string
        created:
          type: integer
        owned_by:
          type: string
      required: 
        - id
        - object
        - created
        - owned_by

    OpenAIFile:
      title: OpenAIFile
      properties:
        id:
          type: string
        object:
          type: string
        bytes:
          type: integer
        created_at:
          type: integer
        filename:
          type: string
        purpose:
          type: string
        status:
          type: string
        status_details:
          type: object
          nullable: true
      required: 
        - id
        - object
        - bytes
        - created_at
        - filename
        - purpose

    FineTune:
      title: FineTune
      properties:
        id:
          type: string
        object:
          type: string
        created_at:
          type: integer
        updated_at:
          type: integer
        model:
          type: string
        fine_tuned_model:
          type: string
          nullable: true
        organization_id:
          type: string
        status:
          type: string
        hyperparams:
          type: object
        training_files:
          type: array
          items:
            $ref: '#/components/schemas/OpenAIFile'
        validation_files:
          type: array
          items:
            $ref: '#/components/schemas/OpenAIFile'
        result_files:
          type: array
          items:
            $ref: '#/components/schemas/OpenAIFile'
        events:
          type: array
          items:
            $ref: '#/components/schemas/FineTuneEvent'
      required: 
        - id
        - object
        - created_at
        - updated_at
        - model
        - fine_tuned_model
        - organization_id
        - status
        - hyperparams
        - training_files
        - validation_files
        - result_files

    FineTuneEvent:
      title: FineTuneEvent
      properties:
        object:
          type: string
        created_at:
          type: integer
        level:
          type: string
        message:
          type: string
      required: 
        - object
        - created_at
        - level
        - message

x-oaiMeta:
  groups:
    - id: models
      title: Models
      description: |
        List and describe the various models available in the API. You can refer to the [Models](/docs/models) documentation to understand what models are available and the differences between them.
    - id: completions
      title: Completions
      description: |
        Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.
    - id: edits
      title: Edits
      description: |
        Given a prompt and an instruction, the model will return an edited version of the prompt.
    - id: images
      title: Images
      description: |
        Given a prompt and/or an input image, the model will generate a new image.
        Related guide: [Image generation](/docs/guides/images)
    - id: embeddings
      title: Embeddings
      description: |
        Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
        Related guide: [Embeddings](/docs/guides/embeddings)
    - id: files
      title: Files
      description: |
        Files are used to upload documents that can be used with features like [Fine-tuning](/docs/api-reference/fine-tunes).
    - id: fine-tunes
      title: Fine-tunes
      description: |
        Manage fine-tuning jobs to tailor a model to your specific training data.
        Related guide: [Fine-tune models](/docs/guides/fine-tuning)
    - id: moderations
      title: Moderations
      description: |
        Given a input text, outputs if the model classifies it as violating OpenAI's content policy.
        Related guide: [Moderations](/docs/guides/moderation)
    - id: searches
      title: Searches
      warning:
        title: This endpoint is deprecated and will be removed on December 3rd, 2022
        message: We’ve developed new methods with better performance. [Learn more](https://help.openai.com/en/articles/6272952-search-transition-guide).
      description: |
        Given a query and a set of documents or labels, the model ranks each document based on its semantic similarity to the provided query.
        Related guide: [Search](/docs/guides/search)
    - id: classifications
      title: Classifications
      warning:
        title: This endpoint is deprecated and will be removed on December 3rd, 2022
        message: We’ve developed new methods with better performance. [Learn more](https://help.openai.com/en/articles/6272941-classifications-transition-guide).
      description: |
        Given a query and a set of labeled examples, the model will predict the most likely label for the query. Useful as a drop-in replacement for any ML classification or text-to-label task.
        Related guide: [Classification](/docs/guides/classifications)
    - id: answers
      title: Answers
      warning:
        title: This endpoint is deprecated and will be removed on December 3rd, 2022
        message: We’ve developed new methods with better performance. [Learn more](https://help.openai.com/en/articles/6233728-answers-transition-guide).
      description: |
        Given a question, a set of documents, and some examples, the API generates an answer to the question based on the information in the set of documents. This is useful for question-answering applications on sources of truth, like company documentation or a knowledge base.
        Related guide: [Question answering](/docs/guides/answers)
    - id: engines
      title: Engines
      description: These endpoints describe and provide access to the various engines available in the API.
      warning:
        title: The Engines endpoints are deprecated.
        message: Please use their replacement, [Models](/docs/api-reference/models), instead. [Learn more](https://help.openai.com/TODO).