java/resources/conversations/methods/create/index.md +0 −3412 deleted
File Deleted View Diff
1## Create a conversation
2
3`Conversation conversations().create(ConversationCreateParamsparams = ConversationCreateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`
4
5**post** `/conversations`
6
7Create a conversation.
8
9### Parameters
10
11- `ConversationCreateParams params`
12
13 - `Optional<List<ResponseInputItem>> items`
14
15 Initial items to include in the conversation context. You may add up to 20 items at a time.
16
17 - `class EasyInputMessage:`
18
19 A message input to the model with a role indicating instruction following
20 hierarchy. Instructions given with the `developer` or `system` role take
21 precedence over instructions given with the `user` role. Messages with the
22 `assistant` role are presumed to have been generated by the model in previous
23 interactions.
24
25 - `Content content`
26
27 Text, image, or audio input to the model, used to generate a response.
28 Can also contain previous assistant responses.
29
30 - `String`
31
32 - `List<ResponseInputContent>`
33
34 - `class ResponseInputText:`
35
36 A text input to the model.
37
38 - `String text`
39
40 The text input to the model.
41
42 - `JsonValue; type "input_text"constant`
43
44 The type of the input item. Always `input_text`.
45
46 - `INPUT_TEXT("input_text")`
47
48 - `Optional<PromptCacheBreakpoint> promptCacheBreakpoint`
49
50 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
51
52 - `JsonValue; mode "explicit"constant`
53
54 The breakpoint mode. Always `explicit`.
55
56 - `EXPLICIT("explicit")`
57
58 - `class ResponseInputImage:`
59
60 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
61
62 - `Detail detail`
63
64 The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
65
66 - `LOW("low")`
67
68 - `HIGH("high")`
69
70 - `AUTO("auto")`
71
72 - `ORIGINAL("original")`
73
74 - `JsonValue; type "input_image"constant`
75
76 The type of the input item. Always `input_image`.
77
78 - `INPUT_IMAGE("input_image")`
79
80 - `Optional<String> fileId`
81
82 The ID of the file to be sent to the model.
83
84 - `Optional<String> imageUrl`
85
86 The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
87
88 - `Optional<PromptCacheBreakpoint> promptCacheBreakpoint`
89
90 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
91
92 - `JsonValue; mode "explicit"constant`
93
94 The breakpoint mode. Always `explicit`.
95
96 - `EXPLICIT("explicit")`
97
98 - `class ResponseInputFile:`
99
100 A file input to the model.
101
102 - `JsonValue; type "input_file"constant`
103
104 The type of the input item. Always `input_file`.
105
106 - `INPUT_FILE("input_file")`
107
108 - `Optional<Detail> detail`
109
110 The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.
111
112 - `AUTO("auto")`
113
114 - `LOW("low")`
115
116 - `HIGH("high")`
117
118 - `Optional<String> fileData`
119
120 The content of the file to be sent to the model.
121
122 - `Optional<String> fileId`
123
124 The ID of the file to be sent to the model.
125
126 - `Optional<String> fileUrl`
127
128 The URL of the file to be sent to the model.
129
130 - `Optional<String> filename`
131
132 The name of the file to be sent to the model.
133
134 - `Optional<PromptCacheBreakpoint> promptCacheBreakpoint`
135
136 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
137
138 - `JsonValue; mode "explicit"constant`
139
140 The breakpoint mode. Always `explicit`.
141
142 - `EXPLICIT("explicit")`
143
144 - `Role role`
145
146 The role of the message input. One of `user`, `assistant`, `system`, or
147 `developer`.
148
149 - `USER("user")`
150
151 - `ASSISTANT("assistant")`
152
153 - `SYSTEM("system")`
154
155 - `DEVELOPER("developer")`
156
157 - `Optional<Phase> phase`
158
159 Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
160 For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
161 phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
162
163 - `COMMENTARY("commentary")`
164
165 - `FINAL_ANSWER("final_answer")`
166
167 - `Optional<Type> type`
168
169 The type of the message input. Always `message`.
170
171 - `MESSAGE("message")`
172
173 - `Message`
174
175 - `List<ResponseInputContent> content`
176
177 A list of one or many input items to the model, containing different content
178 types.
179
180 - `class ResponseInputText:`
181
182 A text input to the model.
183
184 - `class ResponseInputImage:`
185
186 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
187
188 - `class ResponseInputFile:`
189
190 A file input to the model.
191
192 - `Role role`
193
194 The role of the message input. One of `user`, `system`, or `developer`.
195
196 - `USER("user")`
197
198 - `SYSTEM("system")`
199
200 - `DEVELOPER("developer")`
201
202 - `Optional<Status> status`
203
204 The status of item. One of `in_progress`, `completed`, or
205 `incomplete`. Populated when items are returned via API.
206
207 - `IN_PROGRESS("in_progress")`
208
209 - `COMPLETED("completed")`
210
211 - `INCOMPLETE("incomplete")`
212
213 - `Optional<Type> type`
214
215 The type of the message input. Always set to `message`.
216
217 - `MESSAGE("message")`
218
219 - `class ResponseOutputMessage:`
220
221 An output message from the model.
222
223 - `String id`
224
225 The unique ID of the output message.
226
227 - `List<Content> content`
228
229 The content of the output message.
230
231 - `class ResponseOutputText:`
232
233 A text output from the model.
234
235 - `List<Annotation> annotations`
236
237 The annotations of the text output.
238
239 - `class FileCitation:`
240
241 A citation to a file.
242
243 - `String fileId`
244
245 The ID of the file.
246
247 - `String filename`
248
249 The filename of the file cited.
250
251 - `long index`
252
253 The index of the file in the list of files.
254
255 - `JsonValue; type "file_citation"constant`
256
257 The type of the file citation. Always `file_citation`.
258
259 - `FILE_CITATION("file_citation")`
260
261 - `class UrlCitation:`
262
263 A citation for a web resource used to generate a model response.
264
265 - `long endIndex`
266
267 The index of the last character of the URL citation in the message.
268
269 - `long startIndex`
270
271 The index of the first character of the URL citation in the message.
272
273 - `String title`
274
275 The title of the web resource.
276
277 - `JsonValue; type "url_citation"constant`
278
279 The type of the URL citation. Always `url_citation`.
280
281 - `URL_CITATION("url_citation")`
282
283 - `String url`
284
285 The URL of the web resource.
286
287 - `class ContainerFileCitation:`
288
289 A citation for a container file used to generate a model response.
290
291 - `String containerId`
292
293 The ID of the container file.
294
295 - `long endIndex`
296
297 The index of the last character of the container file citation in the message.
298
299 - `String fileId`
300
301 The ID of the file.
302
303 - `String filename`
304
305 The filename of the container file cited.
306
307 - `long startIndex`
308
309 The index of the first character of the container file citation in the message.
310
311 - `JsonValue; type "container_file_citation"constant`
312
313 The type of the container file citation. Always `container_file_citation`.
314
315 - `CONTAINER_FILE_CITATION("container_file_citation")`
316
317 - `class FilePath:`
318
319 A path to a file.
320
321 - `String fileId`
322
323 The ID of the file.
324
325 - `long index`
326
327 The index of the file in the list of files.
328
329 - `JsonValue; type "file_path"constant`
330
331 The type of the file path. Always `file_path`.
332
333 - `FILE_PATH("file_path")`
334
335 - `String text`
336
337 The text output from the model.
338
339 - `JsonValue; type "output_text"constant`
340
341 The type of the output text. Always `output_text`.
342
343 - `OUTPUT_TEXT("output_text")`
344
345 - `Optional<List<Logprob>> logprobs`
346
347 - `String token`
348
349 - `List<long> bytes`
350
351 - `double logprob`
352
353 - `List<TopLogprob> topLogprobs`
354
355 - `String token`
356
357 - `List<long> bytes`
358
359 - `double logprob`
360
361 - `class ResponseOutputRefusal:`
362
363 A refusal from the model.
364
365 - `String refusal`
366
367 The refusal explanation from the model.
368
369 - `JsonValue; type "refusal"constant`
370
371 The type of the refusal. Always `refusal`.
372
373 - `REFUSAL("refusal")`
374
375 - `JsonValue; role "assistant"constant`
376
377 The role of the output message. Always `assistant`.
378
379 - `ASSISTANT("assistant")`
380
381 - `Status status`
382
383 The status of the message input. One of `in_progress`, `completed`, or
384 `incomplete`. Populated when input items are returned via API.
385
386 - `IN_PROGRESS("in_progress")`
387
388 - `COMPLETED("completed")`
389
390 - `INCOMPLETE("incomplete")`
391
392 - `JsonValue; type "message"constant`
393
394 The type of the output message. Always `message`.
395
396 - `MESSAGE("message")`
397
398 - `Optional<Phase> phase`
399
400 Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
401 For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
402 phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
403
404 - `COMMENTARY("commentary")`
405
406 - `FINAL_ANSWER("final_answer")`
407
408 - `class ResponseFileSearchToolCall:`
409
410 The results of a file search tool call. See the
411 [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.
412
413 - `String id`
414
415 The unique ID of the file search tool call.
416
417 - `List<String> queries`
418
419 The queries used to search for files.
420
421 - `Status status`
422
423 The status of the file search tool call. One of `in_progress`,
424 `searching`, `incomplete` or `failed`,
425
426 - `IN_PROGRESS("in_progress")`
427
428 - `SEARCHING("searching")`
429
430 - `COMPLETED("completed")`
431
432 - `INCOMPLETE("incomplete")`
433
434 - `FAILED("failed")`
435
436 - `JsonValue; type "file_search_call"constant`
437
438 The type of the file search tool call. Always `file_search_call`.
439
440 - `FILE_SEARCH_CALL("file_search_call")`
441
442 - `Optional<List<Result>> results`
443
444 The results of the file search tool call.
445
446 - `Optional<Attributes> attributes`
447
448 Set of 16 key-value pairs that can be attached to an object. This can be
449 useful for storing additional information about the object in a structured
450 format, and querying for objects via API or the dashboard. Keys are strings
451 with a maximum length of 64 characters. Values are strings with a maximum
452 length of 512 characters, booleans, or numbers.
453
454 - `String`
455
456 - `double`
457
458 - `boolean`
459
460 - `Optional<String> fileId`
461
462 The unique ID of the file.
463
464 - `Optional<String> filename`
465
466 The name of the file.
467
468 - `Optional<Double> score`
469
470 The relevance score of the file - a value between 0 and 1.
471
472 - `Optional<String> text`
473
474 The text that was retrieved from the file.
475
476 - `class ResponseComputerToolCall:`
477
478 A tool call to a computer use tool. See the
479 [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.
480
481 - `String id`
482
483 The unique ID of the computer call.
484
485 - `String callId`
486
487 An identifier used when responding to the tool call with output.
488
489 - `List<PendingSafetyCheck> pendingSafetyChecks`
490
491 The pending safety checks for the computer call.
492
493 - `String id`
494
495 The ID of the pending safety check.
496
497 - `Optional<String> code`
498
499 The type of the pending safety check.
500
501 - `Optional<String> message`
502
503 Details about the pending safety check.
504
505 - `Status status`
506
507 The status of the item. One of `in_progress`, `completed`, or
508 `incomplete`. Populated when items are returned via API.
509
510 - `IN_PROGRESS("in_progress")`
511
512 - `COMPLETED("completed")`
513
514 - `INCOMPLETE("incomplete")`
515
516 - `Type type`
517
518 The type of the computer call. Always `computer_call`.
519
520 - `COMPUTER_CALL("computer_call")`
521
522 - `Optional<Action> action`
523
524 A click action.
525
526 - `class Click:`
527
528 A click action.
529
530 - `Button button`
531
532 Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
533
534 - `LEFT("left")`
535
536 - `RIGHT("right")`
537
538 - `WHEEL("wheel")`
539
540 - `BACK("back")`
541
542 - `FORWARD("forward")`
543
544 - `JsonValue; type "click"constant`
545
546 Specifies the event type. For a click action, this property is always `click`.
547
548 - `CLICK("click")`
549
550 - `long x`
551
552 The x-coordinate where the click occurred.
553
554 - `long y`
555
556 The y-coordinate where the click occurred.
557
558 - `Optional<List<String>> keys`
559
560 The keys being held while clicking.
561
562 - `class DoubleClick:`
563
564 A double click action.
565
566 - `Optional<List<String>> keys`
567
568 The keys being held while double-clicking.
569
570 - `JsonValue; type "double_click"constant`
571
572 Specifies the event type. For a double click action, this property is always set to `double_click`.
573
574 - `DOUBLE_CLICK("double_click")`
575
576 - `long x`
577
578 The x-coordinate where the double click occurred.
579
580 - `long y`
581
582 The y-coordinate where the double click occurred.
583
584 - `class Drag:`
585
586 A drag action.
587
588 - `List<Path> path`
589
590 An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
591
592 ```
593 [
594 { x: 100, y: 200 },
595 { x: 200, y: 300 }
596 ]
597 ```
598
599 - `long x`
600
601 The x-coordinate.
602
603 - `long y`
604
605 The y-coordinate.
606
607 - `JsonValue; type "drag"constant`
608
609 Specifies the event type. For a drag action, this property is always set to `drag`.
610
611 - `DRAG("drag")`
612
613 - `Optional<List<String>> keys`
614
615 The keys being held while dragging the mouse.
616
617 - `class Keypress:`
618
619 A collection of keypresses the model would like to perform.
620
621 - `List<String> keys`
622
623 The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
624
625 - `JsonValue; type "keypress"constant`
626
627 Specifies the event type. For a keypress action, this property is always set to `keypress`.
628
629 - `KEYPRESS("keypress")`
630
631 - `class Move:`
632
633 A mouse move action.
634
635 - `JsonValue; type "move"constant`
636
637 Specifies the event type. For a move action, this property is always set to `move`.
638
639 - `MOVE("move")`
640
641 - `long x`
642
643 The x-coordinate to move to.
644
645 - `long y`
646
647 The y-coordinate to move to.
648
649 - `Optional<List<String>> keys`
650
651 The keys being held while moving the mouse.
652
653 - `JsonValue;`
654
655 - `JsonValue; type "screenshot"constant`
656
657 Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
658
659 - `SCREENSHOT("screenshot")`
660
661 - `class Scroll:`
662
663 A scroll action.
664
665 - `long scrollX`
666
667 The horizontal scroll distance.
668
669 - `long scrollY`
670
671 The vertical scroll distance.
672
673 - `JsonValue; type "scroll"constant`
674
675 Specifies the event type. For a scroll action, this property is always set to `scroll`.
676
677 - `SCROLL("scroll")`
678
679 - `long x`
680
681 The x-coordinate where the scroll occurred.
682
683 - `long y`
684
685 The y-coordinate where the scroll occurred.
686
687 - `Optional<List<String>> keys`
688
689 The keys being held while scrolling.
690
691 - `class Type:`
692
693 An action to type in text.
694
695 - `String text`
696
697 The text to type.
698
699 - `JsonValue; type "type"constant`
700
701 Specifies the event type. For a type action, this property is always set to `type`.
702
703 - `TYPE("type")`
704
705 - `JsonValue;`
706
707 - `JsonValue; type "wait"constant`
708
709 Specifies the event type. For a wait action, this property is always set to `wait`.
710
711 - `WAIT("wait")`
712
713 - `Optional<List<ComputerAction>> actions`
714
715 Flattened batched actions for `computer_use`. Each action includes an
716 `type` discriminator and action-specific fields.
717
718 - `Click`
719
720 - `Button button`
721
722 Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
723
724 - `LEFT("left")`
725
726 - `RIGHT("right")`
727
728 - `WHEEL("wheel")`
729
730 - `BACK("back")`
731
732 - `FORWARD("forward")`
733
734 - `JsonValue; type "click"constant`
735
736 Specifies the event type. For a click action, this property is always `click`.
737
738 - `CLICK("click")`
739
740 - `long x`
741
742 The x-coordinate where the click occurred.
743
744 - `long y`
745
746 The y-coordinate where the click occurred.
747
748 - `Optional<List<String>> keys`
749
750 The keys being held while clicking.
751
752 - `DoubleClick`
753
754 - `Optional<List<String>> keys`
755
756 The keys being held while double-clicking.
757
758 - `JsonValue; type "double_click"constant`
759
760 Specifies the event type. For a double click action, this property is always set to `double_click`.
761
762 - `DOUBLE_CLICK("double_click")`
763
764 - `long x`
765
766 The x-coordinate where the double click occurred.
767
768 - `long y`
769
770 The y-coordinate where the double click occurred.
771
772 - `Drag`
773
774 - `List<Path> path`
775
776 An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
777
778 ```
779 [
780 { x: 100, y: 200 },
781 { x: 200, y: 300 }
782 ]
783 ```
784
785 - `long x`
786
787 The x-coordinate.
788
789 - `long y`
790
791 The y-coordinate.
792
793 - `JsonValue; type "drag"constant`
794
795 Specifies the event type. For a drag action, this property is always set to `drag`.
796
797 - `DRAG("drag")`
798
799 - `Optional<List<String>> keys`
800
801 The keys being held while dragging the mouse.
802
803 - `Keypress`
804
805 - `List<String> keys`
806
807 The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
808
809 - `JsonValue; type "keypress"constant`
810
811 Specifies the event type. For a keypress action, this property is always set to `keypress`.
812
813 - `KEYPRESS("keypress")`
814
815 - `Move`
816
817 - `JsonValue; type "move"constant`
818
819 Specifies the event type. For a move action, this property is always set to `move`.
820
821 - `MOVE("move")`
822
823 - `long x`
824
825 The x-coordinate to move to.
826
827 - `long y`
828
829 The y-coordinate to move to.
830
831 - `Optional<List<String>> keys`
832
833 The keys being held while moving the mouse.
834
835 - `JsonValue;`
836
837 - `JsonValue; type "screenshot"constant`
838
839 Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
840
841 - `SCREENSHOT("screenshot")`
842
843 - `Scroll`
844
845 - `long scrollX`
846
847 The horizontal scroll distance.
848
849 - `long scrollY`
850
851 The vertical scroll distance.
852
853 - `JsonValue; type "scroll"constant`
854
855 Specifies the event type. For a scroll action, this property is always set to `scroll`.
856
857 - `SCROLL("scroll")`
858
859 - `long x`
860
861 The x-coordinate where the scroll occurred.
862
863 - `long y`
864
865 The y-coordinate where the scroll occurred.
866
867 - `Optional<List<String>> keys`
868
869 The keys being held while scrolling.
870
871 - `Type`
872
873 - `String text`
874
875 The text to type.
876
877 - `JsonValue; type "type"constant`
878
879 Specifies the event type. For a type action, this property is always set to `type`.
880
881 - `TYPE("type")`
882
883 - `JsonValue;`
884
885 - `JsonValue; type "wait"constant`
886
887 Specifies the event type. For a wait action, this property is always set to `wait`.
888
889 - `WAIT("wait")`
890
891 - `ComputerCallOutput`
892
893 - `String callId`
894
895 The ID of the computer tool call that produced the output.
896
897 - `ResponseComputerToolCallOutputScreenshot output`
898
899 A computer screenshot image used with the computer use tool.
900
901 - `JsonValue; type "computer_screenshot"constant`
902
903 Specifies the event type. For a computer screenshot, this property is
904 always set to `computer_screenshot`.
905
906 - `COMPUTER_SCREENSHOT("computer_screenshot")`
907
908 - `Optional<String> fileId`
909
910 The identifier of an uploaded file that contains the screenshot.
911
912 - `Optional<String> imageUrl`
913
914 The URL of the screenshot image.
915
916 - `JsonValue; type "computer_call_output"constant`
917
918 The type of the computer tool call output. Always `computer_call_output`.
919
920 - `COMPUTER_CALL_OUTPUT("computer_call_output")`
921
922 - `Optional<String> id`
923
924 The ID of the computer tool call output.
925
926 - `Optional<List<AcknowledgedSafetyCheck>> acknowledgedSafetyChecks`
927
928 The safety checks reported by the API that have been acknowledged by the developer.
929
930 - `String id`
931
932 The ID of the pending safety check.
933
934 - `Optional<String> code`
935
936 The type of the pending safety check.
937
938 - `Optional<String> message`
939
940 Details about the pending safety check.
941
942 - `Optional<Status> status`
943
944 The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.
945
946 - `IN_PROGRESS("in_progress")`
947
948 - `COMPLETED("completed")`
949
950 - `INCOMPLETE("incomplete")`
951
952 - `class ResponseFunctionWebSearch:`
953
954 The results of a web search tool call. See the
955 [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.
956
957 - `String id`
958
959 The unique ID of the web search tool call.
960
961 - `Action action`
962
963 An object describing the specific action taken in this web search call.
964 Includes details on how the model used the web (search, open_page, find_in_page).
965
966 - `class Search:`
967
968 Action type "search" - Performs a web search query.
969
970 - `JsonValue; type "search"constant`
971
972 The action type.
973
974 - `SEARCH("search")`
975
976 - `Optional<List<String>> queries`
977
978 The search queries.
979
980 - `Optional<String> query`
981
982 The search query.
983
984 - `Optional<List<Source>> sources`
985
986 The sources used in the search.
987
988 - `JsonValue; type "url"constant`
989
990 The type of source. Always `url`.
991
992 - `URL("url")`
993
994 - `String url`
995
996 The URL of the source.
997
998 - `class OpenPage:`
999
1000 Action type "open_page" - Opens a specific URL from search results.
1001
1002 - `JsonValue; type "open_page"constant`
1003
1004 The action type.
1005
1006 - `OPEN_PAGE("open_page")`
1007
1008 - `Optional<String> url`
1009
1010 The URL opened by the model.
1011
1012 - `class FindInPage:`
1013
1014 Action type "find_in_page": Searches for a pattern within a loaded page.
1015
1016 - `String pattern`
1017
1018 The pattern or text to search for within the page.
1019
1020 - `JsonValue; type "find_in_page"constant`
1021
1022 The action type.
1023
1024 - `FIND_IN_PAGE("find_in_page")`
1025
1026 - `String url`
1027
1028 The URL of the page searched for the pattern.
1029
1030 - `Status status`
1031
1032 The status of the web search tool call.
1033
1034 - `IN_PROGRESS("in_progress")`
1035
1036 - `SEARCHING("searching")`
1037
1038 - `COMPLETED("completed")`
1039
1040 - `FAILED("failed")`
1041
1042 - `JsonValue; type "web_search_call"constant`
1043
1044 The type of the web search tool call. Always `web_search_call`.
1045
1046 - `WEB_SEARCH_CALL("web_search_call")`
1047
1048 - `class ResponseFunctionToolCall:`
1049
1050 A tool call to run a function. See the
1051 [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.
1052
1053 - `String arguments`
1054
1055 A JSON string of the arguments to pass to the function.
1056
1057 - `String callId`
1058
1059 The unique ID of the function tool call generated by the model.
1060
1061 - `String name`
1062
1063 The name of the function to run.
1064
1065 - `JsonValue; type "function_call"constant`
1066
1067 The type of the function tool call. Always `function_call`.
1068
1069 - `FUNCTION_CALL("function_call")`
1070
1071 - `Optional<String> id`
1072
1073 The unique ID of the function tool call.
1074
1075 - `Optional<Caller> caller`
1076
1077 The execution context that produced this tool call.
1078
1079 - `JsonValue;`
1080
1081 - `JsonValue; type "direct"constant`
1082
1083 - `DIRECT("direct")`
1084
1085 - `class Program:`
1086
1087 - `String callerId`
1088
1089 The call ID of the program item that produced this tool call.
1090
1091 - `JsonValue; type "program"constant`
1092
1093 - `PROGRAM("program")`
1094
1095 - `Optional<String> namespace`
1096
1097 The namespace of the function to run.
1098
1099 - `Optional<Status> status`
1100
1101 The status of the item. One of `in_progress`, `completed`, or
1102 `incomplete`. Populated when items are returned via API.
1103
1104 - `IN_PROGRESS("in_progress")`
1105
1106 - `COMPLETED("completed")`
1107
1108 - `INCOMPLETE("incomplete")`
1109
1110 - `FunctionCallOutput`
1111
1112 - `String callId`
1113
1114 The unique ID of the function tool call generated by the model.
1115
1116 - `Output output`
1117
1118 Text, image, or file output of the function tool call.
1119
1120 - `String`
1121
1122 - `List<ResponseFunctionCallOutputItem>`
1123
1124 - `class ResponseInputTextContent:`
1125
1126 A text input to the model.
1127
1128 - `String text`
1129
1130 The text input to the model.
1131
1132 - `JsonValue; type "input_text"constant`
1133
1134 The type of the input item. Always `input_text`.
1135
1136 - `INPUT_TEXT("input_text")`
1137
1138 - `Optional<PromptCacheBreakpoint> promptCacheBreakpoint`
1139
1140 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
1141
1142 - `JsonValue; mode "explicit"constant`
1143
1144 The breakpoint mode. Always `explicit`.
1145
1146 - `EXPLICIT("explicit")`
1147
1148 - `class ResponseInputImageContent:`
1149
1150 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)
1151
1152 - `JsonValue; type "input_image"constant`
1153
1154 The type of the input item. Always `input_image`.
1155
1156 - `INPUT_IMAGE("input_image")`
1157
1158 - `Optional<Detail> detail`
1159
1160 The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
1161
1162 - `LOW("low")`
1163
1164 - `HIGH("high")`
1165
1166 - `AUTO("auto")`
1167
1168 - `ORIGINAL("original")`
1169
1170 - `Optional<String> fileId`
1171
1172 The ID of the file to be sent to the model.
1173
1174 - `Optional<String> imageUrl`
1175
1176 The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
1177
1178 - `Optional<PromptCacheBreakpoint> promptCacheBreakpoint`
1179
1180 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
1181
1182 - `JsonValue; mode "explicit"constant`
1183
1184 The breakpoint mode. Always `explicit`.
1185
1186 - `EXPLICIT("explicit")`
1187
1188 - `class ResponseInputFileContent:`
1189
1190 A file input to the model.
1191
1192 - `JsonValue; type "input_file"constant`
1193
1194 The type of the input item. Always `input_file`.
1195
1196 - `INPUT_FILE("input_file")`
1197
1198 - `Optional<Detail> detail`
1199
1200 The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.
1201
1202 - `AUTO("auto")`
1203
1204 - `LOW("low")`
1205
1206 - `HIGH("high")`
1207
1208 - `Optional<String> fileData`
1209
1210 The base64-encoded data of the file to be sent to the model.
1211
1212 - `Optional<String> fileId`
1213
1214 The ID of the file to be sent to the model.
1215
1216 - `Optional<String> fileUrl`
1217
1218 The URL of the file to be sent to the model.
1219
1220 - `Optional<String> filename`
1221
1222 The name of the file to be sent to the model.
1223
1224 - `Optional<PromptCacheBreakpoint> promptCacheBreakpoint`
1225
1226 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
1227
1228 - `JsonValue; mode "explicit"constant`
1229
1230 The breakpoint mode. Always `explicit`.
1231
1232 - `EXPLICIT("explicit")`
1233
1234 - `JsonValue; type "function_call_output"constant`
1235
1236 The type of the function tool call output. Always `function_call_output`.
1237
1238 - `FUNCTION_CALL_OUTPUT("function_call_output")`
1239
1240 - `Optional<String> id`
1241
1242 The unique ID of the function tool call output. Populated when this item is returned via API.
1243
1244 - `Optional<Caller> caller`
1245
1246 The execution context that produced this tool call.
1247
1248 - `JsonValue;`
1249
1250 - `JsonValue; type "direct"constant`
1251
1252 The caller type. Always `direct`.
1253
1254 - `DIRECT("direct")`
1255
1256 - `class Program:`
1257
1258 - `String callerId`
1259
1260 The call ID of the program item that produced this tool call.
1261
1262 - `JsonValue; type "program"constant`
1263
1264 The caller type. Always `program`.
1265
1266 - `PROGRAM("program")`
1267
1268 - `Optional<Status> status`
1269
1270 The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
1271
1272 - `IN_PROGRESS("in_progress")`
1273
1274 - `COMPLETED("completed")`
1275
1276 - `INCOMPLETE("incomplete")`
1277
1278 - `ToolSearchCall`
1279
1280 - `JsonValue arguments`
1281
1282 The arguments supplied to the tool search call.
1283
1284 - `JsonValue; type "tool_search_call"constant`
1285
1286 The item type. Always `tool_search_call`.
1287
1288 - `TOOL_SEARCH_CALL("tool_search_call")`
1289
1290 - `Optional<String> id`
1291
1292 The unique ID of this tool search call.
1293
1294 - `Optional<String> callId`
1295
1296 The unique ID of the tool search call generated by the model.
1297
1298 - `Optional<Execution> execution`
1299
1300 Whether tool search was executed by the server or by the client.
1301
1302 - `SERVER("server")`
1303
1304 - `CLIENT("client")`
1305
1306 - `Optional<Status> status`
1307
1308 The status of the tool search call.
1309
1310 - `IN_PROGRESS("in_progress")`
1311
1312 - `COMPLETED("completed")`
1313
1314 - `INCOMPLETE("incomplete")`
1315
1316 - `class ResponseToolSearchOutputItemParam:`
1317
1318 - `List<Tool> tools`
1319
1320 The loaded tool definitions returned by the tool search output.
1321
1322 - `class FunctionTool:`
1323
1324 Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).
1325
1326 - `String name`
1327
1328 The name of the function to call.
1329
1330 - `Optional<Parameters> parameters`
1331
1332 A JSON schema object describing the parameters of the function.
1333
1334 - `Optional<Boolean> strict`
1335
1336 Whether strict parameter validation is enforced for this function tool.
1337
1338 - `JsonValue; type "function"constant`
1339
1340 The type of the function tool. Always `function`.
1341
1342 - `FUNCTION("function")`
1343
1344 - `Optional<List<AllowedCaller>> allowedCallers`
1345
1346 The tool invocation context(s).
1347
1348 - `DIRECT("direct")`
1349
1350 - `PROGRAMMATIC("programmatic")`
1351
1352 - `Optional<Boolean> deferLoading`
1353
1354 Whether this function is deferred and loaded via tool search.
1355
1356 - `Optional<String> description`
1357
1358 A description of the function. Used by the model to determine whether or not to call the function.
1359
1360 - `Optional<OutputSchema> outputSchema`
1361
1362 A JSON schema object describing the JSON value encoded in string outputs for this function.
1363
1364 - `class FileSearchTool:`
1365
1366 A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).
1367
1368 - `JsonValue; type "file_search"constant`
1369
1370 The type of the file search tool. Always `file_search`.
1371
1372 - `FILE_SEARCH("file_search")`
1373
1374 - `List<String> vectorStoreIds`
1375
1376 The IDs of the vector stores to search.
1377
1378 - `Optional<Filters> filters`
1379
1380 A filter to apply.
1381
1382 - `class ComparisonFilter:`
1383
1384 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
1385
1386 - `String key`
1387
1388 The key to compare against the value.
1389
1390 - `Type type`
1391
1392 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.
1393
1394 - `eq`: equals
1395 - `ne`: not equal
1396 - `gt`: greater than
1397 - `gte`: greater than or equal
1398 - `lt`: less than
1399 - `lte`: less than or equal
1400 - `in`: in
1401 - `nin`: not in
1402
1403 - `EQ("eq")`
1404
1405 - `NE("ne")`
1406
1407 - `GT("gt")`
1408
1409 - `GTE("gte")`
1410
1411 - `LT("lt")`
1412
1413 - `LTE("lte")`
1414
1415 - `IN("in")`
1416
1417 - `NIN("nin")`
1418
1419 - `Value value`
1420
1421 The value to compare against the attribute key; supports string, number, or boolean types.
1422
1423 - `String`
1424
1425 - `double`
1426
1427 - `boolean`
1428
1429 - `List<ComparisonFilterValueItem>`
1430
1431 - `String`
1432
1433 - `double`
1434
1435 - `class CompoundFilter:`
1436
1437 Combine multiple filters using `and` or `or`.
1438
1439 - `List<Filter> filters`
1440
1441 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
1442
1443 - `class ComparisonFilter:`
1444
1445 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
1446
1447 - `JsonValue`
1448
1449 - `Type type`
1450
1451 Type of operation: `and` or `or`.
1452
1453 - `AND("and")`
1454
1455 - `OR("or")`
1456
1457 - `Optional<Long> maxNumResults`
1458
1459 The maximum number of results to return. This number should be between 1 and 50 inclusive.
1460
1461 - `Optional<RankingOptions> rankingOptions`
1462
1463 Ranking options for search.
1464
1465 - `Optional<HybridSearch> hybridSearch`
1466
1467 Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
1468
1469 - `double embeddingWeight`
1470
1471 The weight of the embedding in the reciprocal ranking fusion.
1472
1473 - `double textWeight`
1474
1475 The weight of the text in the reciprocal ranking fusion.
1476
1477 - `Optional<Ranker> ranker`
1478
1479 The ranker to use for the file search.
1480
1481 - `AUTO("auto")`
1482
1483 - `DEFAULT_2024_11_15("default-2024-11-15")`
1484
1485 - `Optional<Double> scoreThreshold`
1486
1487 The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
1488
1489 - `class ComputerTool:`
1490
1491 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
1492
1493 - `JsonValue; type "computer"constant`
1494
1495 The type of the computer tool. Always `computer`.
1496
1497 - `COMPUTER("computer")`
1498
1499 - `class ComputerUsePreviewTool:`
1500
1501 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
1502
1503 - `long displayHeight`
1504
1505 The height of the computer display.
1506
1507 - `long displayWidth`
1508
1509 The width of the computer display.
1510
1511 - `Environment environment`
1512
1513 The type of computer environment to control.
1514
1515 - `WINDOWS("windows")`
1516
1517 - `MAC("mac")`
1518
1519 - `LINUX("linux")`
1520
1521 - `UBUNTU("ubuntu")`
1522
1523 - `BROWSER("browser")`
1524
1525 - `JsonValue; type "computer_use_preview"constant`
1526
1527 The type of the computer use tool. Always `computer_use_preview`.
1528
1529 - `COMPUTER_USE_PREVIEW("computer_use_preview")`
1530
1531 - `class WebSearchTool:`
1532
1533 Search the Internet for sources related to the prompt. Learn more about the
1534 [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
1535
1536 - `Type type`
1537
1538 The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
1539
1540 - `WEB_SEARCH("web_search")`
1541
1542 - `WEB_SEARCH_2025_08_26("web_search_2025_08_26")`
1543
1544 - `Optional<Filters> filters`
1545
1546 Filters for the search.
1547
1548 - `Optional<List<String>> allowedDomains`
1549
1550 Allowed domains for the search. If not provided, all domains are allowed.
1551 Subdomains of the provided domains are allowed as well.
1552
1553 Example: `["pubmed.ncbi.nlm.nih.gov"]`
1554
1555 - `Optional<SearchContextSize> searchContextSize`
1556
1557 High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
1558
1559 - `LOW("low")`
1560
1561 - `MEDIUM("medium")`
1562
1563 - `HIGH("high")`
1564
1565 - `Optional<UserLocation> userLocation`
1566
1567 The approximate location of the user.
1568
1569 - `Optional<String> city`
1570
1571 Free text input for the city of the user, e.g. `San Francisco`.
1572
1573 - `Optional<String> country`
1574
1575 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
1576
1577 - `Optional<String> region`
1578
1579 Free text input for the region of the user, e.g. `California`.
1580
1581 - `Optional<String> timezone`
1582
1583 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
1584
1585 - `Optional<Type> type`
1586
1587 The type of location approximation. Always `approximate`.
1588
1589 - `APPROXIMATE("approximate")`
1590
1591 - `Mcp`
1592
1593 - `String serverLabel`
1594
1595 A label for this MCP server, used to identify it in tool calls.
1596
1597 - `JsonValue; type "mcp"constant`
1598
1599 The type of the MCP tool. Always `mcp`.
1600
1601 - `MCP("mcp")`
1602
1603 - `Optional<List<AllowedCaller>> allowedCallers`
1604
1605 The tool invocation context(s).
1606
1607 - `DIRECT("direct")`
1608
1609 - `PROGRAMMATIC("programmatic")`
1610
1611 - `Optional<AllowedTools> allowedTools`
1612
1613 List of allowed tool names or a filter object.
1614
1615 - `List<String>`
1616
1617 - `class McpToolFilter:`
1618
1619 A filter object to specify which tools are allowed.
1620
1621 - `Optional<Boolean> readOnly`
1622
1623 Indicates whether or not a tool modifies data or is read-only. If an
1624 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1625 it will match this filter.
1626
1627 - `Optional<List<String>> toolNames`
1628
1629 List of allowed tool names.
1630
1631 - `Optional<String> authorization`
1632
1633 An OAuth access token that can be used with a remote MCP server, either
1634 with a custom MCP server URL or a service connector. Your application
1635 must handle the OAuth authorization flow and provide the token here.
1636
1637 - `Optional<ConnectorId> connectorId`
1638
1639 Identifier for service connectors, like those available in ChatGPT. One of
1640 `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
1641 about service connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
1642
1643 Currently supported `connector_id` values are:
1644
1645 - Dropbox: `connector_dropbox`
1646 - Gmail: `connector_gmail`
1647 - Google Calendar: `connector_googlecalendar`
1648 - Google Drive: `connector_googledrive`
1649 - Microsoft Teams: `connector_microsoftteams`
1650 - Outlook Calendar: `connector_outlookcalendar`
1651 - Outlook Email: `connector_outlookemail`
1652 - SharePoint: `connector_sharepoint`
1653
1654 - `CONNECTOR_DROPBOX("connector_dropbox")`
1655
1656 - `CONNECTOR_GMAIL("connector_gmail")`
1657
1658 - `CONNECTOR_GOOGLECALENDAR("connector_googlecalendar")`
1659
1660 - `CONNECTOR_GOOGLEDRIVE("connector_googledrive")`
1661
1662 - `CONNECTOR_MICROSOFTTEAMS("connector_microsoftteams")`
1663
1664 - `CONNECTOR_OUTLOOKCALENDAR("connector_outlookcalendar")`
1665
1666 - `CONNECTOR_OUTLOOKEMAIL("connector_outlookemail")`
1667
1668 - `CONNECTOR_SHAREPOINT("connector_sharepoint")`
1669
1670 - `Optional<Boolean> deferLoading`
1671
1672 Whether this MCP tool is deferred and discovered via tool search.
1673
1674 - `Optional<Headers> headers`
1675
1676 Optional HTTP headers to send to the MCP server. Use for authentication
1677 or other purposes.
1678
1679 - `Optional<RequireApproval> requireApproval`
1680
1681 Specify which of the MCP server's tools require approval.
1682
1683 - `class McpToolApprovalFilter:`
1684
1685 Specify which of the MCP server's tools require approval. Can be
1686 `always`, `never`, or a filter object associated with tools
1687 that require approval.
1688
1689 - `Optional<Always> always`
1690
1691 A filter object to specify which tools are allowed.
1692
1693 - `Optional<Boolean> readOnly`
1694
1695 Indicates whether or not a tool modifies data or is read-only. If an
1696 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1697 it will match this filter.
1698
1699 - `Optional<List<String>> toolNames`
1700
1701 List of allowed tool names.
1702
1703 - `Optional<Never> never`
1704
1705 A filter object to specify which tools are allowed.
1706
1707 - `Optional<Boolean> readOnly`
1708
1709 Indicates whether or not a tool modifies data or is read-only. If an
1710 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1711 it will match this filter.
1712
1713 - `Optional<List<String>> toolNames`
1714
1715 List of allowed tool names.
1716
1717 - `enum McpToolApprovalSetting:`
1718
1719 Specify a single approval policy for all tools. One of `always` or
1720 `never`. When set to `always`, all tools will require approval. When
1721 set to `never`, all tools will not require approval.
1722
1723 - `ALWAYS("always")`
1724
1725 - `NEVER("never")`
1726
1727 - `Optional<String> serverDescription`
1728
1729 Optional description of the MCP server, used to provide more context.
1730
1731 - `Optional<String> serverUrl`
1732
1733 The URL for the MCP server. One of `server_url`, `connector_id`, or
1734 `tunnel_id` must be provided.
1735
1736 - `Optional<String> tunnelId`
1737
1738 The Secure MCP Tunnel ID to use instead of a direct server URL. One of
1739 `server_url`, `connector_id`, or `tunnel_id` must be provided.
1740
1741 - `CodeInterpreter`
1742
1743 - `Container container`
1744
1745 The code interpreter container. Can be a container ID or an object that
1746 specifies uploaded file IDs to make available to your code, along with an
1747 optional `memory_limit` setting.
1748
1749 - `String`
1750
1751 - `class CodeInterpreterToolAuto:`
1752
1753 Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
1754
1755 - `JsonValue; type "auto"constant`
1756
1757 Always `auto`.
1758
1759 - `AUTO("auto")`
1760
1761 - `Optional<List<String>> fileIds`
1762
1763 An optional list of uploaded files to make available to your code.
1764
1765 - `Optional<MemoryLimit> memoryLimit`
1766
1767 The memory limit for the code interpreter container.
1768
1769 - `_1G("1g")`
1770
1771 - `_4G("4g")`
1772
1773 - `_16G("16g")`
1774
1775 - `_64G("64g")`
1776
1777 - `Optional<NetworkPolicy> networkPolicy`
1778
1779 Network access policy for the container.
1780
1781 - `class ContainerNetworkPolicyDisabled:`
1782
1783 - `JsonValue; type "disabled"constant`
1784
1785 Disable outbound network access. Always `disabled`.
1786
1787 - `DISABLED("disabled")`
1788
1789 - `class ContainerNetworkPolicyAllowlist:`
1790
1791 - `List<String> allowedDomains`
1792
1793 A list of allowed domains when type is `allowlist`.
1794
1795 - `JsonValue; type "allowlist"constant`
1796
1797 Allow outbound network access only to specified domains. Always `allowlist`.
1798
1799 - `ALLOWLIST("allowlist")`
1800
1801 - `Optional<List<ContainerNetworkPolicyDomainSecret>> domainSecrets`
1802
1803 Optional domain-scoped secrets for allowlisted domains.
1804
1805 - `String domain`
1806
1807 The domain associated with the secret.
1808
1809 - `String name`
1810
1811 The name of the secret to inject for the domain.
1812
1813 - `String value`
1814
1815 The secret value to inject for the domain.
1816
1817 - `JsonValue; type "code_interpreter"constant`
1818
1819 The type of the code interpreter tool. Always `code_interpreter`.
1820
1821 - `CODE_INTERPRETER("code_interpreter")`
1822
1823 - `Optional<List<AllowedCaller>> allowedCallers`
1824
1825 The tool invocation context(s).
1826
1827 - `DIRECT("direct")`
1828
1829 - `PROGRAMMATIC("programmatic")`
1830
1831 - `JsonValue;`
1832
1833 - `JsonValue; type "programmatic_tool_calling"constant`
1834
1835 The type of the tool. Always `programmatic_tool_calling`.
1836
1837 - `PROGRAMMATIC_TOOL_CALLING("programmatic_tool_calling")`
1838
1839 - `ImageGeneration`
1840
1841 - `JsonValue; type "image_generation"constant`
1842
1843 The type of the image generation tool. Always `image_generation`.
1844
1845 - `IMAGE_GENERATION("image_generation")`
1846
1847 - `Optional<Action> action`
1848
1849 Whether to generate a new image or edit an existing image. Default: `auto`.
1850
1851 - `GENERATE("generate")`
1852
1853 - `EDIT("edit")`
1854
1855 - `AUTO("auto")`
1856
1857 - `Optional<Background> background`
1858
1859 Allows to set transparency for the background of the generated image(s).
1860 This parameter is only supported for GPT image models that support
1861 transparent backgrounds. Must be one of `transparent`, `opaque`, or
1862 `auto` (default value). When `auto` is used, the model will
1863 automatically determine the best background for the image.
1864
1865 `gpt-image-2` and `gpt-image-2-2026-04-21` do not support
1866 transparent backgrounds. Requests with `background` set to
1867 `transparent` will return an error for these models; use `opaque` or
1868 `auto` instead.
1869
1870 If `transparent`, the output format needs to support transparency,
1871 so it should be set to either `png` (default value) or `webp`.
1872
1873 - `TRANSPARENT("transparent")`
1874
1875 - `OPAQUE("opaque")`
1876
1877 - `AUTO("auto")`
1878
1879 - `Optional<InputFidelity> inputFidelity`
1880
1881 Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.
1882
1883 - `HIGH("high")`
1884
1885 - `LOW("low")`
1886
1887 - `Optional<InputImageMask> inputImageMask`
1888
1889 Optional mask for inpainting. Contains `image_url`
1890 (string, optional) and `file_id` (string, optional).
1891
1892 - `Optional<String> fileId`
1893
1894 File ID for the mask image.
1895
1896 - `Optional<String> imageUrl`
1897
1898 Base64-encoded mask image.
1899
1900 - `Optional<Model> model`
1901
1902 The image generation model to use. Default: `gpt-image-1`.
1903
1904 - `GPT_IMAGE_1("gpt-image-1")`
1905
1906 - `GPT_IMAGE_1_MINI("gpt-image-1-mini")`
1907
1908 - `GPT_IMAGE_2("gpt-image-2")`
1909
1910 - `GPT_IMAGE_2_2026_04_21("gpt-image-2-2026-04-21")`
1911
1912 - `GPT_IMAGE_1_5("gpt-image-1.5")`
1913
1914 - `CHATGPT_IMAGE_LATEST("chatgpt-image-latest")`
1915
1916 - `Optional<Moderation> moderation`
1917
1918 Moderation level for the generated image. Default: `auto`.
1919
1920 - `AUTO("auto")`
1921
1922 - `LOW("low")`
1923
1924 - `Optional<Long> outputCompression`
1925
1926 Compression level for the output image. Default: 100.
1927
1928 - `Optional<OutputFormat> outputFormat`
1929
1930 The output format of the generated image. One of `png`, `webp`, or
1931 `jpeg`. Default: `png`.
1932
1933 - `PNG("png")`
1934
1935 - `WEBP("webp")`
1936
1937 - `JPEG("jpeg")`
1938
1939 - `Optional<Long> partialImages`
1940
1941 Number of partial images to generate in streaming mode, from 0 (default value) to 3.
1942
1943 - `Optional<Quality> quality`
1944
1945 The quality of the generated image. One of `low`, `medium`, `high`,
1946 or `auto`. Default: `auto`.
1947
1948 - `LOW("low")`
1949
1950 - `MEDIUM("medium")`
1951
1952 - `HIGH("high")`
1953
1954 - `AUTO("auto")`
1955
1956 - `Optional<Size> size`
1957
1958 The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
1959
1960 - `_1024X1024("1024x1024")`
1961
1962 - `_1024X1536("1024x1536")`
1963
1964 - `_1536X1024("1536x1024")`
1965
1966 - `AUTO("auto")`
1967
1968 - `JsonValue;`
1969
1970 - `JsonValue; type "local_shell"constant`
1971
1972 The type of the local shell tool. Always `local_shell`.
1973
1974 - `LOCAL_SHELL("local_shell")`
1975
1976 - `class FunctionShellTool:`
1977
1978 A tool that allows the model to execute shell commands.
1979
1980 - `JsonValue; type "shell"constant`
1981
1982 The type of the shell tool. Always `shell`.
1983
1984 - `SHELL("shell")`
1985
1986 - `Optional<List<AllowedCaller>> allowedCallers`
1987
1988 The tool invocation context(s).
1989
1990 - `DIRECT("direct")`
1991
1992 - `PROGRAMMATIC("programmatic")`
1993
1994 - `Optional<Environment> environment`
1995
1996 - `class ContainerAuto:`
1997
1998 - `JsonValue; type "container_auto"constant`
1999
2000 Automatically creates a container for this request
2001
2002 - `CONTAINER_AUTO("container_auto")`
2003
2004 - `Optional<List<String>> fileIds`
2005
2006 An optional list of uploaded files to make available to your code.
2007
2008 - `Optional<MemoryLimit> memoryLimit`
2009
2010 The memory limit for the container.
2011
2012 - `_1G("1g")`
2013
2014 - `_4G("4g")`
2015
2016 - `_16G("16g")`
2017
2018 - `_64G("64g")`
2019
2020 - `Optional<NetworkPolicy> networkPolicy`
2021
2022 Network access policy for the container.
2023
2024 - `class ContainerNetworkPolicyDisabled:`
2025
2026 - `class ContainerNetworkPolicyAllowlist:`
2027
2028 - `Optional<List<Skill>> skills`
2029
2030 An optional list of skills referenced by id or inline data.
2031
2032 - `class SkillReference:`
2033
2034 - `String skillId`
2035
2036 The ID of the referenced skill.
2037
2038 - `JsonValue; type "skill_reference"constant`
2039
2040 References a skill created with the /v1/skills endpoint.
2041
2042 - `SKILL_REFERENCE("skill_reference")`
2043
2044 - `Optional<String> version`
2045
2046 Optional skill version. Use a positive integer or 'latest'. Omit for default.
2047
2048 - `class InlineSkill:`
2049
2050 - `String description`
2051
2052 The description of the skill.
2053
2054 - `String name`
2055
2056 The name of the skill.
2057
2058 - `InlineSkillSource source`
2059
2060 Inline skill payload
2061
2062 - `String data`
2063
2064 Base64-encoded skill zip bundle.
2065
2066 - `JsonValue; mediaType "application/zip"constant`
2067
2068 The media type of the inline skill payload. Must be `application/zip`.
2069
2070 - `APPLICATION_ZIP("application/zip")`
2071
2072 - `JsonValue; type "base64"constant`
2073
2074 The type of the inline skill source. Must be `base64`.
2075
2076 - `BASE64("base64")`
2077
2078 - `JsonValue; type "inline"constant`
2079
2080 Defines an inline skill for this request.
2081
2082 - `INLINE("inline")`
2083
2084 - `class LocalEnvironment:`
2085
2086 - `JsonValue; type "local"constant`
2087
2088 Use a local computer environment.
2089
2090 - `LOCAL("local")`
2091
2092 - `Optional<List<LocalSkill>> skills`
2093
2094 An optional list of skills.
2095
2096 - `String description`
2097
2098 The description of the skill.
2099
2100 - `String name`
2101
2102 The name of the skill.
2103
2104 - `String path`
2105
2106 The path to the directory containing the skill.
2107
2108 - `class ContainerReference:`
2109
2110 - `String containerId`
2111
2112 The ID of the referenced container.
2113
2114 - `JsonValue; type "container_reference"constant`
2115
2116 References a container created with the /v1/containers endpoint
2117
2118 - `CONTAINER_REFERENCE("container_reference")`
2119
2120 - `class CustomTool:`
2121
2122 A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
2123
2124 - `String name`
2125
2126 The name of the custom tool, used to identify it in tool calls.
2127
2128 - `JsonValue; type "custom"constant`
2129
2130 The type of the custom tool. Always `custom`.
2131
2132 - `CUSTOM("custom")`
2133
2134 - `Optional<List<AllowedCaller>> allowedCallers`
2135
2136 The tool invocation context(s).
2137
2138 - `DIRECT("direct")`
2139
2140 - `PROGRAMMATIC("programmatic")`
2141
2142 - `Optional<Boolean> deferLoading`
2143
2144 Whether this tool should be deferred and discovered via tool search.
2145
2146 - `Optional<String> description`
2147
2148 Optional description of the custom tool, used to provide more context.
2149
2150 - `Optional<CustomToolInputFormat> format`
2151
2152 The input format for the custom tool. Default is unconstrained text.
2153
2154 - `JsonValue;`
2155
2156 - `JsonValue; type "text"constant`
2157
2158 Unconstrained text format. Always `text`.
2159
2160 - `TEXT("text")`
2161
2162 - `Grammar`
2163
2164 - `String definition`
2165
2166 The grammar definition.
2167
2168 - `Syntax syntax`
2169
2170 The syntax of the grammar definition. One of `lark` or `regex`.
2171
2172 - `LARK("lark")`
2173
2174 - `REGEX("regex")`
2175
2176 - `JsonValue; type "grammar"constant`
2177
2178 Grammar format. Always `grammar`.
2179
2180 - `GRAMMAR("grammar")`
2181
2182 - `class NamespaceTool:`
2183
2184 Groups function/custom tools under a shared namespace.
2185
2186 - `String description`
2187
2188 A description of the namespace shown to the model.
2189
2190 - `String name`
2191
2192 The namespace name used in tool calls (for example, `crm`).
2193
2194 - `List<Tool> tools`
2195
2196 The function/custom tools available inside this namespace.
2197
2198 - `class Function:`
2199
2200 - `String name`
2201
2202 - `JsonValue; type "function"constant`
2203
2204 - `FUNCTION("function")`
2205
2206 - `Optional<List<AllowedCaller>> allowedCallers`
2207
2208 The tool invocation context(s).
2209
2210 - `DIRECT("direct")`
2211
2212 - `PROGRAMMATIC("programmatic")`
2213
2214 - `Optional<Boolean> deferLoading`
2215
2216 Whether this function should be deferred and discovered via tool search.
2217
2218 - `Optional<String> description`
2219
2220 - `Optional<OutputSchema> outputSchema`
2221
2222 A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.
2223
2224 - `Optional<JsonValue> parameters`
2225
2226 - `Optional<Boolean> strict`
2227
2228 Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.
2229
2230 - `class CustomTool:`
2231
2232 A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
2233
2234 - `JsonValue; type "namespace"constant`
2235
2236 The type of the tool. Always `namespace`.
2237
2238 - `NAMESPACE("namespace")`
2239
2240 - `class ToolSearchTool:`
2241
2242 Hosted or BYOT tool search configuration for deferred tools.
2243
2244 - `JsonValue; type "tool_search"constant`
2245
2246 The type of the tool. Always `tool_search`.
2247
2248 - `TOOL_SEARCH("tool_search")`
2249
2250 - `Optional<String> description`
2251
2252 Description shown to the model for a client-executed tool search tool.
2253
2254 - `Optional<Execution> execution`
2255
2256 Whether tool search is executed by the server or by the client.
2257
2258 - `SERVER("server")`
2259
2260 - `CLIENT("client")`
2261
2262 - `Optional<JsonValue> parameters`
2263
2264 Parameter schema for a client-executed tool search tool.
2265
2266 - `class WebSearchPreviewTool:`
2267
2268 This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
2269
2270 - `Type type`
2271
2272 The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.
2273
2274 - `WEB_SEARCH_PREVIEW("web_search_preview")`
2275
2276 - `WEB_SEARCH_PREVIEW_2025_03_11("web_search_preview_2025_03_11")`
2277
2278 - `Optional<List<SearchContentType>> searchContentTypes`
2279
2280 - `TEXT("text")`
2281
2282 - `IMAGE("image")`
2283
2284 - `Optional<SearchContextSize> searchContextSize`
2285
2286 High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
2287
2288 - `LOW("low")`
2289
2290 - `MEDIUM("medium")`
2291
2292 - `HIGH("high")`
2293
2294 - `Optional<UserLocation> userLocation`
2295
2296 The user's location.
2297
2298 - `JsonValue; type "approximate"constant`
2299
2300 The type of location approximation. Always `approximate`.
2301
2302 - `APPROXIMATE("approximate")`
2303
2304 - `Optional<String> city`
2305
2306 Free text input for the city of the user, e.g. `San Francisco`.
2307
2308 - `Optional<String> country`
2309
2310 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
2311
2312 - `Optional<String> region`
2313
2314 Free text input for the region of the user, e.g. `California`.
2315
2316 - `Optional<String> timezone`
2317
2318 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
2319
2320 - `class ApplyPatchTool:`
2321
2322 Allows the assistant to create, delete, or update files using unified diffs.
2323
2324 - `JsonValue; type "apply_patch"constant`
2325
2326 The type of the tool. Always `apply_patch`.
2327
2328 - `APPLY_PATCH("apply_patch")`
2329
2330 - `Optional<List<AllowedCaller>> allowedCallers`
2331
2332 The tool invocation context(s).
2333
2334 - `DIRECT("direct")`
2335
2336 - `PROGRAMMATIC("programmatic")`
2337
2338 - `JsonValue; type "tool_search_output"constant`
2339
2340 The item type. Always `tool_search_output`.
2341
2342 - `TOOL_SEARCH_OUTPUT("tool_search_output")`
2343
2344 - `Optional<String> id`
2345
2346 The unique ID of this tool search output.
2347
2348 - `Optional<String> callId`
2349
2350 The unique ID of the tool search call generated by the model.
2351
2352 - `Optional<Execution> execution`
2353
2354 Whether tool search was executed by the server or by the client.
2355
2356 - `SERVER("server")`
2357
2358 - `CLIENT("client")`
2359
2360 - `Optional<Status> status`
2361
2362 The status of the tool search output.
2363
2364 - `IN_PROGRESS("in_progress")`
2365
2366 - `COMPLETED("completed")`
2367
2368 - `INCOMPLETE("incomplete")`
2369
2370 - `AdditionalTools`
2371
2372 - `JsonValue; role "developer"constant`
2373
2374 The role that provided the additional tools. Only `developer` is supported.
2375
2376 - `DEVELOPER("developer")`
2377
2378 - `List<Tool> tools`
2379
2380 A list of additional tools made available at this item.
2381
2382 - `class FunctionTool:`
2383
2384 Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).
2385
2386 - `class FileSearchTool:`
2387
2388 A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).
2389
2390 - `class ComputerTool:`
2391
2392 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
2393
2394 - `class ComputerUsePreviewTool:`
2395
2396 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
2397
2398 - `class WebSearchTool:`
2399
2400 Search the Internet for sources related to the prompt. Learn more about the
2401 [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
2402
2403 - `Mcp`
2404
2405 - `CodeInterpreter`
2406
2407 - `JsonValue;`
2408
2409 - `ImageGeneration`
2410
2411 - `JsonValue;`
2412
2413 - `class FunctionShellTool:`
2414
2415 A tool that allows the model to execute shell commands.
2416
2417 - `class CustomTool:`
2418
2419 A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
2420
2421 - `class NamespaceTool:`
2422
2423 Groups function/custom tools under a shared namespace.
2424
2425 - `class ToolSearchTool:`
2426
2427 Hosted or BYOT tool search configuration for deferred tools.
2428
2429 - `class WebSearchPreviewTool:`
2430
2431 This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
2432
2433 - `class ApplyPatchTool:`
2434
2435 Allows the assistant to create, delete, or update files using unified diffs.
2436
2437 - `JsonValue; type "additional_tools"constant`
2438
2439 The item type. Always `additional_tools`.
2440
2441 - `ADDITIONAL_TOOLS("additional_tools")`
2442
2443 - `Optional<String> id`
2444
2445 The unique ID of this additional tools item.
2446
2447 - `class ResponseReasoningItem:`
2448
2449 A description of the chain of thought used by a reasoning model while generating
2450 a response. Be sure to include these items in your `input` to the Responses API
2451 for subsequent turns of a conversation if you are manually
2452 [managing context](https://platform.openai.com/docs/guides/conversation-state).
2453
2454 - `String id`
2455
2456 The unique identifier of the reasoning content.
2457
2458 - `List<Summary> summary`
2459
2460 Reasoning summary content.
2461
2462 - `String text`
2463
2464 A summary of the reasoning output from the model so far.
2465
2466 - `JsonValue; type "summary_text"constant`
2467
2468 The type of the object. Always `summary_text`.
2469
2470 - `SUMMARY_TEXT("summary_text")`
2471
2472 - `JsonValue; type "reasoning"constant`
2473
2474 The type of the object. Always `reasoning`.
2475
2476 - `REASONING("reasoning")`
2477
2478 - `Optional<List<Content>> content`
2479
2480 Reasoning text content.
2481
2482 - `String text`
2483
2484 The reasoning text from the model.
2485
2486 - `JsonValue; type "reasoning_text"constant`
2487
2488 The type of the reasoning text. Always `reasoning_text`.
2489
2490 - `REASONING_TEXT("reasoning_text")`
2491
2492 - `Optional<String> encryptedContent`
2493
2494 The encrypted content of the reasoning item. This is populated by default
2495 for reasoning items returned by `POST /v1/responses` and WebSocket
2496 `response.create` requests.
2497
2498 - `Optional<Status> status`
2499
2500 The status of the item. One of `in_progress`, `completed`, or
2501 `incomplete`. Populated when items are returned via API.
2502
2503 - `IN_PROGRESS("in_progress")`
2504
2505 - `COMPLETED("completed")`
2506
2507 - `INCOMPLETE("incomplete")`
2508
2509 - `class ResponseCompactionItemParam:`
2510
2511 A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
2512
2513 - `String encryptedContent`
2514
2515 The encrypted content of the compaction summary.
2516
2517 - `JsonValue; type "compaction"constant`
2518
2519 The type of the item. Always `compaction`.
2520
2521 - `COMPACTION("compaction")`
2522
2523 - `Optional<String> id`
2524
2525 The ID of the compaction item.
2526
2527 - `ImageGenerationCall`
2528
2529 - `String id`
2530
2531 The unique ID of the image generation call.
2532
2533 - `Optional<String> result`
2534
2535 The generated image encoded in base64.
2536
2537 - `Status status`
2538
2539 The status of the image generation call.
2540
2541 - `IN_PROGRESS("in_progress")`
2542
2543 - `COMPLETED("completed")`
2544
2545 - `GENERATING("generating")`
2546
2547 - `FAILED("failed")`
2548
2549 - `JsonValue; type "image_generation_call"constant`
2550
2551 The type of the image generation call. Always `image_generation_call`.
2552
2553 - `IMAGE_GENERATION_CALL("image_generation_call")`
2554
2555 - `class ResponseCodeInterpreterToolCall:`
2556
2557 A tool call to run code.
2558
2559 - `String id`
2560
2561 The unique ID of the code interpreter tool call.
2562
2563 - `Optional<String> code`
2564
2565 The code to run, or null if not available.
2566
2567 - `String containerId`
2568
2569 The ID of the container used to run the code.
2570
2571 - `Optional<List<Output>> outputs`
2572
2573 The outputs generated by the code interpreter, such as logs or images.
2574 Can be null if no outputs are available.
2575
2576 - `class Logs:`
2577
2578 The logs output from the code interpreter.
2579
2580 - `String logs`
2581
2582 The logs output from the code interpreter.
2583
2584 - `JsonValue; type "logs"constant`
2585
2586 The type of the output. Always `logs`.
2587
2588 - `LOGS("logs")`
2589
2590 - `class Image:`
2591
2592 The image output from the code interpreter.
2593
2594 - `JsonValue; type "image"constant`
2595
2596 The type of the output. Always `image`.
2597
2598 - `IMAGE("image")`
2599
2600 - `String url`
2601
2602 The URL of the image output from the code interpreter.
2603
2604 - `Status status`
2605
2606 The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
2607
2608 - `IN_PROGRESS("in_progress")`
2609
2610 - `COMPLETED("completed")`
2611
2612 - `INCOMPLETE("incomplete")`
2613
2614 - `INTERPRETING("interpreting")`
2615
2616 - `FAILED("failed")`
2617
2618 - `JsonValue; type "code_interpreter_call"constant`
2619
2620 The type of the code interpreter tool call. Always `code_interpreter_call`.
2621
2622 - `CODE_INTERPRETER_CALL("code_interpreter_call")`
2623
2624 - `LocalShellCall`
2625
2626 - `String id`
2627
2628 The unique ID of the local shell call.
2629
2630 - `Action action`
2631
2632 Execute a shell command on the server.
2633
2634 - `List<String> command`
2635
2636 The command to run.
2637
2638 - `Env env`
2639
2640 Environment variables to set for the command.
2641
2642 - `JsonValue; type "exec"constant`
2643
2644 The type of the local shell action. Always `exec`.
2645
2646 - `EXEC("exec")`
2647
2648 - `Optional<Long> timeoutMs`
2649
2650 Optional timeout in milliseconds for the command.
2651
2652 - `Optional<String> user`
2653
2654 Optional user to run the command as.
2655
2656 - `Optional<String> workingDirectory`
2657
2658 Optional working directory to run the command in.
2659
2660 - `String callId`
2661
2662 The unique ID of the local shell tool call generated by the model.
2663
2664 - `Status status`
2665
2666 The status of the local shell call.
2667
2668 - `IN_PROGRESS("in_progress")`
2669
2670 - `COMPLETED("completed")`
2671
2672 - `INCOMPLETE("incomplete")`
2673
2674 - `JsonValue; type "local_shell_call"constant`
2675
2676 The type of the local shell call. Always `local_shell_call`.
2677
2678 - `LOCAL_SHELL_CALL("local_shell_call")`
2679
2680 - `LocalShellCallOutput`
2681
2682 - `String id`
2683
2684 The unique ID of the local shell tool call generated by the model.
2685
2686 - `String output`
2687
2688 A JSON string of the output of the local shell tool call.
2689
2690 - `JsonValue; type "local_shell_call_output"constant`
2691
2692 The type of the local shell tool call output. Always `local_shell_call_output`.
2693
2694 - `LOCAL_SHELL_CALL_OUTPUT("local_shell_call_output")`
2695
2696 - `Optional<Status> status`
2697
2698 The status of the item. One of `in_progress`, `completed`, or `incomplete`.
2699
2700 - `IN_PROGRESS("in_progress")`
2701
2702 - `COMPLETED("completed")`
2703
2704 - `INCOMPLETE("incomplete")`
2705
2706 - `ShellCall`
2707
2708 - `Action action`
2709
2710 The shell commands and limits that describe how to run the tool call.
2711
2712 - `List<String> commands`
2713
2714 Ordered shell commands for the execution environment to run.
2715
2716 - `Optional<Long> maxOutputLength`
2717
2718 Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
2719
2720 - `Optional<Long> timeoutMs`
2721
2722 Maximum wall-clock time in milliseconds to allow the shell commands to run.
2723
2724 - `String callId`
2725
2726 The unique ID of the shell tool call generated by the model.
2727
2728 - `JsonValue; type "shell_call"constant`
2729
2730 The type of the item. Always `shell_call`.
2731
2732 - `SHELL_CALL("shell_call")`
2733
2734 - `Optional<String> id`
2735
2736 The unique ID of the shell tool call. Populated when this item is returned via API.
2737
2738 - `Optional<Caller> caller`
2739
2740 The execution context that produced this tool call.
2741
2742 - `JsonValue;`
2743
2744 - `JsonValue; type "direct"constant`
2745
2746 The caller type. Always `direct`.
2747
2748 - `DIRECT("direct")`
2749
2750 - `class Program:`
2751
2752 - `String callerId`
2753
2754 The call ID of the program item that produced this tool call.
2755
2756 - `JsonValue; type "program"constant`
2757
2758 The caller type. Always `program`.
2759
2760 - `PROGRAM("program")`
2761
2762 - `Optional<Environment> environment`
2763
2764 The environment to execute the shell commands in.
2765
2766 - `class LocalEnvironment:`
2767
2768 - `class ContainerReference:`
2769
2770 - `Optional<Status> status`
2771
2772 The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
2773
2774 - `IN_PROGRESS("in_progress")`
2775
2776 - `COMPLETED("completed")`
2777
2778 - `INCOMPLETE("incomplete")`
2779
2780 - `ShellCallOutput`
2781
2782 - `String callId`
2783
2784 The unique ID of the shell tool call generated by the model.
2785
2786 - `List<ResponseFunctionShellCallOutputContent> output`
2787
2788 Captured chunks of stdout and stderr output, along with their associated outcomes.
2789
2790 - `Outcome outcome`
2791
2792 The exit or timeout outcome associated with this shell call.
2793
2794 - `JsonValue;`
2795
2796 - `JsonValue; type "timeout"constant`
2797
2798 The outcome type. Always `timeout`.
2799
2800 - `TIMEOUT("timeout")`
2801
2802 - `class Exit:`
2803
2804 Indicates that the shell commands finished and returned an exit code.
2805
2806 - `long exitCode`
2807
2808 The exit code returned by the shell process.
2809
2810 - `JsonValue; type "exit"constant`
2811
2812 The outcome type. Always `exit`.
2813
2814 - `EXIT("exit")`
2815
2816 - `String stderr`
2817
2818 Captured stderr output for the shell call.
2819
2820 - `String stdout`
2821
2822 Captured stdout output for the shell call.
2823
2824 - `JsonValue; type "shell_call_output"constant`
2825
2826 The type of the item. Always `shell_call_output`.
2827
2828 - `SHELL_CALL_OUTPUT("shell_call_output")`
2829
2830 - `Optional<String> id`
2831
2832 The unique ID of the shell tool call output. Populated when this item is returned via API.
2833
2834 - `Optional<Caller> caller`
2835
2836 The execution context that produced this tool call.
2837
2838 - `JsonValue;`
2839
2840 - `JsonValue; type "direct"constant`
2841
2842 The caller type. Always `direct`.
2843
2844 - `DIRECT("direct")`
2845
2846 - `class Program:`
2847
2848 - `String callerId`
2849
2850 The call ID of the program item that produced this tool call.
2851
2852 - `JsonValue; type "program"constant`
2853
2854 The caller type. Always `program`.
2855
2856 - `PROGRAM("program")`
2857
2858 - `Optional<Long> maxOutputLength`
2859
2860 The maximum number of UTF-8 characters captured for this shell call's combined output.
2861
2862 - `Optional<Status> status`
2863
2864 The status of the shell call output.
2865
2866 - `IN_PROGRESS("in_progress")`
2867
2868 - `COMPLETED("completed")`
2869
2870 - `INCOMPLETE("incomplete")`
2871
2872 - `ApplyPatchCall`
2873
2874 - `String callId`
2875
2876 The unique ID of the apply patch tool call generated by the model.
2877
2878 - `Operation operation`
2879
2880 The specific create, delete, or update instruction for the apply_patch tool call.
2881
2882 - `class CreateFile:`
2883
2884 Instruction for creating a new file via the apply_patch tool.
2885
2886 - `String diff`
2887
2888 Unified diff content to apply when creating the file.
2889
2890 - `String path`
2891
2892 Path of the file to create relative to the workspace root.
2893
2894 - `JsonValue; type "create_file"constant`
2895
2896 The operation type. Always `create_file`.
2897
2898 - `CREATE_FILE("create_file")`
2899
2900 - `class DeleteFile:`
2901
2902 Instruction for deleting an existing file via the apply_patch tool.
2903
2904 - `String path`
2905
2906 Path of the file to delete relative to the workspace root.
2907
2908 - `JsonValue; type "delete_file"constant`
2909
2910 The operation type. Always `delete_file`.
2911
2912 - `DELETE_FILE("delete_file")`
2913
2914 - `class UpdateFile:`
2915
2916 Instruction for updating an existing file via the apply_patch tool.
2917
2918 - `String diff`
2919
2920 Unified diff content to apply to the existing file.
2921
2922 - `String path`
2923
2924 Path of the file to update relative to the workspace root.
2925
2926 - `JsonValue; type "update_file"constant`
2927
2928 The operation type. Always `update_file`.
2929
2930 - `UPDATE_FILE("update_file")`
2931
2932 - `Status status`
2933
2934 The status of the apply patch tool call. One of `in_progress` or `completed`.
2935
2936 - `IN_PROGRESS("in_progress")`
2937
2938 - `COMPLETED("completed")`
2939
2940 - `JsonValue; type "apply_patch_call"constant`
2941
2942 The type of the item. Always `apply_patch_call`.
2943
2944 - `APPLY_PATCH_CALL("apply_patch_call")`
2945
2946 - `Optional<String> id`
2947
2948 The unique ID of the apply patch tool call. Populated when this item is returned via API.
2949
2950 - `Optional<Caller> caller`
2951
2952 The execution context that produced this tool call.
2953
2954 - `JsonValue;`
2955
2956 - `JsonValue; type "direct"constant`
2957
2958 The caller type. Always `direct`.
2959
2960 - `DIRECT("direct")`
2961
2962 - `class Program:`
2963
2964 - `String callerId`
2965
2966 The call ID of the program item that produced this tool call.
2967
2968 - `JsonValue; type "program"constant`
2969
2970 The caller type. Always `program`.
2971
2972 - `PROGRAM("program")`
2973
2974 - `ApplyPatchCallOutput`
2975
2976 - `String callId`
2977
2978 The unique ID of the apply patch tool call generated by the model.
2979
2980 - `Status status`
2981
2982 The status of the apply patch tool call output. One of `completed` or `failed`.
2983
2984 - `COMPLETED("completed")`
2985
2986 - `FAILED("failed")`
2987
2988 - `JsonValue; type "apply_patch_call_output"constant`
2989
2990 The type of the item. Always `apply_patch_call_output`.
2991
2992 - `APPLY_PATCH_CALL_OUTPUT("apply_patch_call_output")`
2993
2994 - `Optional<String> id`
2995
2996 The unique ID of the apply patch tool call output. Populated when this item is returned via API.
2997
2998 - `Optional<Caller> caller`
2999
3000 The execution context that produced this tool call.
3001
3002 - `JsonValue;`
3003
3004 - `JsonValue; type "direct"constant`
3005
3006 The caller type. Always `direct`.
3007
3008 - `DIRECT("direct")`
3009
3010 - `class Program:`
3011
3012 - `String callerId`
3013
3014 The call ID of the program item that produced this tool call.
3015
3016 - `JsonValue; type "program"constant`
3017
3018 The caller type. Always `program`.
3019
3020 - `PROGRAM("program")`
3021
3022 - `Optional<String> output`
3023
3024 Optional human-readable log text from the apply patch tool (e.g., patch results or errors).
3025
3026 - `McpListTools`
3027
3028 - `String id`
3029
3030 The unique ID of the list.
3031
3032 - `String serverLabel`
3033
3034 The label of the MCP server.
3035
3036 - `List<Tool> tools`
3037
3038 The tools available on the server.
3039
3040 - `JsonValue inputSchema`
3041
3042 The JSON schema describing the tool's input.
3043
3044 - `String name`
3045
3046 The name of the tool.
3047
3048 - `Optional<JsonValue> annotations`
3049
3050 Additional annotations about the tool.
3051
3052 - `Optional<String> description`
3053
3054 The description of the tool.
3055
3056 - `JsonValue; type "mcp_list_tools"constant`
3057
3058 The type of the item. Always `mcp_list_tools`.
3059
3060 - `MCP_LIST_TOOLS("mcp_list_tools")`
3061
3062 - `Optional<String> error`
3063
3064 Error message if the server could not list tools.
3065
3066 - `McpApprovalRequest`
3067
3068 - `String id`
3069
3070 The unique ID of the approval request.
3071
3072 - `String arguments`
3073
3074 A JSON string of arguments for the tool.
3075
3076 - `String name`
3077
3078 The name of the tool to run.
3079
3080 - `String serverLabel`
3081
3082 The label of the MCP server making the request.
3083
3084 - `JsonValue; type "mcp_approval_request"constant`
3085
3086 The type of the item. Always `mcp_approval_request`.
3087
3088 - `MCP_APPROVAL_REQUEST("mcp_approval_request")`
3089
3090 - `McpApprovalResponse`
3091
3092 - `String approvalRequestId`
3093
3094 The ID of the approval request being answered.
3095
3096 - `boolean approve`
3097
3098 Whether the request was approved.
3099
3100 - `JsonValue; type "mcp_approval_response"constant`
3101
3102 The type of the item. Always `mcp_approval_response`.
3103
3104 - `MCP_APPROVAL_RESPONSE("mcp_approval_response")`
3105
3106 - `Optional<String> id`
3107
3108 The unique ID of the approval response
3109
3110 - `Optional<String> reason`
3111
3112 Optional reason for the decision.
3113
3114 - `McpCall`
3115
3116 - `String id`
3117
3118 The unique ID of the tool call.
3119
3120 - `String arguments`
3121
3122 A JSON string of the arguments passed to the tool.
3123
3124 - `String name`
3125
3126 The name of the tool that was run.
3127
3128 - `String serverLabel`
3129
3130 The label of the MCP server running the tool.
3131
3132 - `JsonValue; type "mcp_call"constant`
3133
3134 The type of the item. Always `mcp_call`.
3135
3136 - `MCP_CALL("mcp_call")`
3137
3138 - `Optional<String> approvalRequestId`
3139
3140 Unique identifier for the MCP tool call approval request.
3141 Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.
3142
3143 - `Optional<String> error`
3144
3145 The error from the tool call, if any.
3146
3147 - `Optional<String> output`
3148
3149 The output from the tool call.
3150
3151 - `Optional<Status> status`
3152
3153 The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
3154
3155 - `IN_PROGRESS("in_progress")`
3156
3157 - `COMPLETED("completed")`
3158
3159 - `INCOMPLETE("incomplete")`
3160
3161 - `CALLING("calling")`
3162
3163 - `FAILED("failed")`
3164
3165 - `class ResponseCustomToolCallOutput:`
3166
3167 The output of a custom tool call from your code, being sent back to the model.
3168
3169 - `String callId`
3170
3171 The call ID, used to map this custom tool call output to a custom tool call.
3172
3173 - `Output output`
3174
3175 The output from the custom tool call generated by your code.
3176 Can be a string or an list of output content.
3177
3178 - `String`
3179
3180 - `List<FunctionAndCustomToolCallOutput>`
3181
3182 - `class ResponseInputText:`
3183
3184 A text input to the model.
3185
3186 - `class ResponseInputImage:`
3187
3188 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
3189
3190 - `class ResponseInputFile:`
3191
3192 A file input to the model.
3193
3194 - `JsonValue; type "custom_tool_call_output"constant`
3195
3196 The type of the custom tool call output. Always `custom_tool_call_output`.
3197
3198 - `CUSTOM_TOOL_CALL_OUTPUT("custom_tool_call_output")`
3199
3200 - `Optional<String> id`
3201
3202 The unique ID of the custom tool call output in the OpenAI platform.
3203
3204 - `Optional<Caller> caller`
3205
3206 The execution context that produced this tool call.
3207
3208 - `JsonValue;`
3209
3210 - `JsonValue; type "direct"constant`
3211
3212 The caller type. Always `direct`.
3213
3214 - `DIRECT("direct")`
3215
3216 - `class Program:`
3217
3218 - `String callerId`
3219
3220 The call ID of the program item that produced this tool call.
3221
3222 - `JsonValue; type "program"constant`
3223
3224 The caller type. Always `program`.
3225
3226 - `PROGRAM("program")`
3227
3228 - `class ResponseCustomToolCall:`
3229
3230 A call to a custom tool created by the model.
3231
3232 - `String callId`
3233
3234 An identifier used to map this custom tool call to a tool call output.
3235
3236 - `String input`
3237
3238 The input for the custom tool call generated by the model.
3239
3240 - `String name`
3241
3242 The name of the custom tool being called.
3243
3244 - `JsonValue; type "custom_tool_call"constant`
3245
3246 The type of the custom tool call. Always `custom_tool_call`.
3247
3248 - `CUSTOM_TOOL_CALL("custom_tool_call")`
3249
3250 - `Optional<String> id`
3251
3252 The unique ID of the custom tool call in the OpenAI platform.
3253
3254 - `Optional<Caller> caller`
3255
3256 The execution context that produced this tool call.
3257
3258 - `JsonValue;`
3259
3260 - `JsonValue; type "direct"constant`
3261
3262 - `DIRECT("direct")`
3263
3264 - `class Program:`
3265
3266 - `String callerId`
3267
3268 The call ID of the program item that produced this tool call.
3269
3270 - `JsonValue; type "program"constant`
3271
3272 - `PROGRAM("program")`
3273
3274 - `Optional<String> namespace`
3275
3276 The namespace of the custom tool being called.
3277
3278 - `JsonValue;`
3279
3280 - `JsonValue; type "compaction_trigger"constant`
3281
3282 The type of the item. Always `compaction_trigger`.
3283
3284 - `COMPACTION_TRIGGER("compaction_trigger")`
3285
3286 - `ItemReference`
3287
3288 - `String id`
3289
3290 The ID of the item to reference.
3291
3292 - `Optional<Type> type`
3293
3294 The type of item to reference. Always `item_reference`.
3295
3296 - `ITEM_REFERENCE("item_reference")`
3297
3298 - `Program`
3299
3300 - `String id`
3301
3302 The unique ID of this program item.
3303
3304 - `String callId`
3305
3306 The stable call ID of the program item.
3307
3308 - `String code`
3309
3310 The JavaScript source executed by programmatic tool calling.
3311
3312 - `String fingerprint`
3313
3314 Opaque program replay fingerprint that must be round-tripped.
3315
3316 - `JsonValue; type "program"constant`
3317
3318 The item type. Always `program`.
3319
3320 - `PROGRAM("program")`
3321
3322 - `ProgramOutput`
3323
3324 - `String id`
3325
3326 The unique ID of this program output item.
3327
3328 - `String callId`
3329
3330 The call ID of the program item.
3331
3332 - `String result`
3333
3334 The result produced by the program item.
3335
3336 - `Status status`
3337
3338 The terminal status of the program output.
3339
3340 - `COMPLETED("completed")`
3341
3342 - `INCOMPLETE("incomplete")`
3343
3344 - `JsonValue; type "program_output"constant`
3345
3346 The item type. Always `program_output`.
3347
3348 - `PROGRAM_OUTPUT("program_output")`
3349
3350 - `Optional<Metadata> metadata`
3351
3352 Set of 16 key-value pairs that can be attached to an object. This can be
3353 useful for storing additional information about the object in a structured
3354 format, and querying for objects via API or the dashboard.
3355
3356 Keys are strings with a maximum length of 64 characters. Values are strings
3357 with a maximum length of 512 characters.
3358
3359### Returns
3360
3361- `class Conversation:`
3362
3363 - `String id`
3364
3365 The unique ID of the conversation.
3366
3367 - `long createdAt`
3368
3369 The time at which the conversation was created, measured in seconds since the Unix epoch.
3370
3371 - `JsonValue metadata`
3372
3373 Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
3374 Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
3375
3376 - `JsonValue; object_ "conversation"constant`
3377
3378 The object type, which is always `conversation`.
3379
3380 - `CONVERSATION("conversation")`
3381
3382### Example
3383
3384```java
3385package com.openai.example;
3386
3387import com.openai.client.OpenAIClient;
3388import com.openai.client.okhttp.OpenAIOkHttpClient;
3389import com.openai.models.conversations.Conversation;
3390import com.openai.models.conversations.ConversationCreateParams;
3391
3392public final class Main {
3393 private Main() {}
3394
3395 public static void main(String[] args) {
3396 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
3397
3398 Conversation conversation = client.conversations().create();
3399 }
3400}
3401```
3402
3403#### Response
3404
3405```json
3406{
3407 "id": "id",
3408 "created_at": 0,
3409 "metadata": {},
3410 "object": "conversation"
3411}
3412```