java/resources/responses/methods/cancel/index.md +0 −4775 deleted
File Deleted View Diff
1## Cancel a response
2
3`Response responses().cancel(ResponseCancelParamsparams = ResponseCancelParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`
4
5**post** `/responses/{response_id}/cancel`
6
7Cancels a model response with the given ID. Only responses created with
8the `background` parameter set to `true` can be cancelled.
9[Learn more](https://platform.openai.com/docs/guides/background).
10
11### Parameters
12
13- `ResponseCancelParams params`
14
15 - `Optional<String> responseId`
16
17### Returns
18
19- `class Response:`
20
21 - `String id`
22
23 Unique identifier for this Response.
24
25 - `double createdAt`
26
27 Unix timestamp (in seconds) of when this Response was created.
28
29 - `Optional<ResponseError> error`
30
31 An error object returned when the model fails to generate a Response.
32
33 - `Code code`
34
35 The error code for the response.
36
37 - `SERVER_ERROR("server_error")`
38
39 - `RATE_LIMIT_EXCEEDED("rate_limit_exceeded")`
40
41 - `INVALID_PROMPT("invalid_prompt")`
42
43 - `VECTOR_STORE_TIMEOUT("vector_store_timeout")`
44
45 - `INVALID_IMAGE("invalid_image")`
46
47 - `INVALID_IMAGE_FORMAT("invalid_image_format")`
48
49 - `INVALID_BASE64_IMAGE("invalid_base64_image")`
50
51 - `INVALID_IMAGE_URL("invalid_image_url")`
52
53 - `IMAGE_TOO_LARGE("image_too_large")`
54
55 - `IMAGE_TOO_SMALL("image_too_small")`
56
57 - `IMAGE_PARSE_ERROR("image_parse_error")`
58
59 - `IMAGE_CONTENT_POLICY_VIOLATION("image_content_policy_violation")`
60
61 - `INVALID_IMAGE_MODE("invalid_image_mode")`
62
63 - `IMAGE_FILE_TOO_LARGE("image_file_too_large")`
64
65 - `UNSUPPORTED_IMAGE_MEDIA_TYPE("unsupported_image_media_type")`
66
67 - `EMPTY_IMAGE_FILE("empty_image_file")`
68
69 - `FAILED_TO_DOWNLOAD_IMAGE("failed_to_download_image")`
70
71 - `IMAGE_FILE_NOT_FOUND("image_file_not_found")`
72
73 - `String message`
74
75 A human-readable description of the error.
76
77 - `Optional<IncompleteDetails> incompleteDetails`
78
79 Details about why the response is incomplete.
80
81 - `Optional<Reason> reason`
82
83 The reason why the response is incomplete.
84
85 - `MAX_OUTPUT_TOKENS("max_output_tokens")`
86
87 - `CONTENT_FILTER("content_filter")`
88
89 - `Optional<Instructions> instructions`
90
91 A system (or developer) message inserted into the model's context.
92
93 When using along with `previous_response_id`, the instructions from a previous
94 response will not be carried over to the next response. This makes it simple
95 to swap out system (or developer) messages in new responses.
96
97 - `String`
98
99 - `List<ResponseInputItem>`
100
101 - `class EasyInputMessage:`
102
103 A message input to the model with a role indicating instruction following
104 hierarchy. Instructions given with the `developer` or `system` role take
105 precedence over instructions given with the `user` role. Messages with the
106 `assistant` role are presumed to have been generated by the model in previous
107 interactions.
108
109 - `Content content`
110
111 Text, image, or audio input to the model, used to generate a response.
112 Can also contain previous assistant responses.
113
114 - `String`
115
116 - `List<ResponseInputContent>`
117
118 - `class ResponseInputText:`
119
120 A text input to the model.
121
122 - `String text`
123
124 The text input to the model.
125
126 - `JsonValue; type "input_text"constant`
127
128 The type of the input item. Always `input_text`.
129
130 - `INPUT_TEXT("input_text")`
131
132 - `class ResponseInputImage:`
133
134 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
135
136 - `Detail detail`
137
138 The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
139
140 - `LOW("low")`
141
142 - `HIGH("high")`
143
144 - `AUTO("auto")`
145
146 - `ORIGINAL("original")`
147
148 - `JsonValue; type "input_image"constant`
149
150 The type of the input item. Always `input_image`.
151
152 - `INPUT_IMAGE("input_image")`
153
154 - `Optional<String> fileId`
155
156 The ID of the file to be sent to the model.
157
158 - `Optional<String> imageUrl`
159
160 The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
161
162 - `class ResponseInputFile:`
163
164 A file input to the model.
165
166 - `JsonValue; type "input_file"constant`
167
168 The type of the input item. Always `input_file`.
169
170 - `INPUT_FILE("input_file")`
171
172 - `Optional<Detail> detail`
173
174 The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
175
176 - `LOW("low")`
177
178 - `HIGH("high")`
179
180 - `Optional<String> fileData`
181
182 The content of the file to be sent to the model.
183
184 - `Optional<String> fileId`
185
186 The ID of the file to be sent to the model.
187
188 - `Optional<String> fileUrl`
189
190 The URL of the file to be sent to the model.
191
192 - `Optional<String> filename`
193
194 The name of the file to be sent to the model.
195
196 - `Role role`
197
198 The role of the message input. One of `user`, `assistant`, `system`, or
199 `developer`.
200
201 - `USER("user")`
202
203 - `ASSISTANT("assistant")`
204
205 - `SYSTEM("system")`
206
207 - `DEVELOPER("developer")`
208
209 - `Optional<Phase> phase`
210
211 Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
212 For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
213 phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
214
215 - `COMMENTARY("commentary")`
216
217 - `FINAL_ANSWER("final_answer")`
218
219 - `Optional<Type> type`
220
221 The type of the message input. Always `message`.
222
223 - `MESSAGE("message")`
224
225 - `Message`
226
227 - `List<ResponseInputContent> content`
228
229 A list of one or many input items to the model, containing different content
230 types.
231
232 - `class ResponseInputText:`
233
234 A text input to the model.
235
236 - `class ResponseInputImage:`
237
238 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
239
240 - `class ResponseInputFile:`
241
242 A file input to the model.
243
244 - `Role role`
245
246 The role of the message input. One of `user`, `system`, or `developer`.
247
248 - `USER("user")`
249
250 - `SYSTEM("system")`
251
252 - `DEVELOPER("developer")`
253
254 - `Optional<Status> status`
255
256 The status of item. One of `in_progress`, `completed`, or
257 `incomplete`. Populated when items are returned via API.
258
259 - `IN_PROGRESS("in_progress")`
260
261 - `COMPLETED("completed")`
262
263 - `INCOMPLETE("incomplete")`
264
265 - `Optional<Type> type`
266
267 The type of the message input. Always set to `message`.
268
269 - `MESSAGE("message")`
270
271 - `class ResponseOutputMessage:`
272
273 An output message from the model.
274
275 - `String id`
276
277 The unique ID of the output message.
278
279 - `List<Content> content`
280
281 The content of the output message.
282
283 - `class ResponseOutputText:`
284
285 A text output from the model.
286
287 - `List<Annotation> annotations`
288
289 The annotations of the text output.
290
291 - `class FileCitation:`
292
293 A citation to a file.
294
295 - `String fileId`
296
297 The ID of the file.
298
299 - `String filename`
300
301 The filename of the file cited.
302
303 - `long index`
304
305 The index of the file in the list of files.
306
307 - `JsonValue; type "file_citation"constant`
308
309 The type of the file citation. Always `file_citation`.
310
311 - `FILE_CITATION("file_citation")`
312
313 - `class UrlCitation:`
314
315 A citation for a web resource used to generate a model response.
316
317 - `long endIndex`
318
319 The index of the last character of the URL citation in the message.
320
321 - `long startIndex`
322
323 The index of the first character of the URL citation in the message.
324
325 - `String title`
326
327 The title of the web resource.
328
329 - `JsonValue; type "url_citation"constant`
330
331 The type of the URL citation. Always `url_citation`.
332
333 - `URL_CITATION("url_citation")`
334
335 - `String url`
336
337 The URL of the web resource.
338
339 - `class ContainerFileCitation:`
340
341 A citation for a container file used to generate a model response.
342
343 - `String containerId`
344
345 The ID of the container file.
346
347 - `long endIndex`
348
349 The index of the last character of the container file citation in the message.
350
351 - `String fileId`
352
353 The ID of the file.
354
355 - `String filename`
356
357 The filename of the container file cited.
358
359 - `long startIndex`
360
361 The index of the first character of the container file citation in the message.
362
363 - `JsonValue; type "container_file_citation"constant`
364
365 The type of the container file citation. Always `container_file_citation`.
366
367 - `CONTAINER_FILE_CITATION("container_file_citation")`
368
369 - `class FilePath:`
370
371 A path to a file.
372
373 - `String fileId`
374
375 The ID of the file.
376
377 - `long index`
378
379 The index of the file in the list of files.
380
381 - `JsonValue; type "file_path"constant`
382
383 The type of the file path. Always `file_path`.
384
385 - `FILE_PATH("file_path")`
386
387 - `String text`
388
389 The text output from the model.
390
391 - `JsonValue; type "output_text"constant`
392
393 The type of the output text. Always `output_text`.
394
395 - `OUTPUT_TEXT("output_text")`
396
397 - `Optional<List<Logprob>> logprobs`
398
399 - `String token`
400
401 - `List<long> bytes`
402
403 - `double logprob`
404
405 - `List<TopLogprob> topLogprobs`
406
407 - `String token`
408
409 - `List<long> bytes`
410
411 - `double logprob`
412
413 - `class ResponseOutputRefusal:`
414
415 A refusal from the model.
416
417 - `String refusal`
418
419 The refusal explanation from the model.
420
421 - `JsonValue; type "refusal"constant`
422
423 The type of the refusal. Always `refusal`.
424
425 - `REFUSAL("refusal")`
426
427 - `JsonValue; role "assistant"constant`
428
429 The role of the output message. Always `assistant`.
430
431 - `ASSISTANT("assistant")`
432
433 - `Status status`
434
435 The status of the message input. One of `in_progress`, `completed`, or
436 `incomplete`. Populated when input items are returned via API.
437
438 - `IN_PROGRESS("in_progress")`
439
440 - `COMPLETED("completed")`
441
442 - `INCOMPLETE("incomplete")`
443
444 - `JsonValue; type "message"constant`
445
446 The type of the output message. Always `message`.
447
448 - `MESSAGE("message")`
449
450 - `Optional<Phase> phase`
451
452 Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
453 For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
454 phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
455
456 - `COMMENTARY("commentary")`
457
458 - `FINAL_ANSWER("final_answer")`
459
460 - `class ResponseFileSearchToolCall:`
461
462 The results of a file search tool call. See the
463 [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.
464
465 - `String id`
466
467 The unique ID of the file search tool call.
468
469 - `List<String> queries`
470
471 The queries used to search for files.
472
473 - `Status status`
474
475 The status of the file search tool call. One of `in_progress`,
476 `searching`, `incomplete` or `failed`,
477
478 - `IN_PROGRESS("in_progress")`
479
480 - `SEARCHING("searching")`
481
482 - `COMPLETED("completed")`
483
484 - `INCOMPLETE("incomplete")`
485
486 - `FAILED("failed")`
487
488 - `JsonValue; type "file_search_call"constant`
489
490 The type of the file search tool call. Always `file_search_call`.
491
492 - `FILE_SEARCH_CALL("file_search_call")`
493
494 - `Optional<List<Result>> results`
495
496 The results of the file search tool call.
497
498 - `Optional<Attributes> attributes`
499
500 Set of 16 key-value pairs that can be attached to an object. This can be
501 useful for storing additional information about the object in a structured
502 format, and querying for objects via API or the dashboard. Keys are strings
503 with a maximum length of 64 characters. Values are strings with a maximum
504 length of 512 characters, booleans, or numbers.
505
506 - `String`
507
508 - `double`
509
510 - `boolean`
511
512 - `Optional<String> fileId`
513
514 The unique ID of the file.
515
516 - `Optional<String> filename`
517
518 The name of the file.
519
520 - `Optional<Double> score`
521
522 The relevance score of the file - a value between 0 and 1.
523
524 - `Optional<String> text`
525
526 The text that was retrieved from the file.
527
528 - `class ResponseComputerToolCall:`
529
530 A tool call to a computer use tool. See the
531 [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.
532
533 - `String id`
534
535 The unique ID of the computer call.
536
537 - `String callId`
538
539 An identifier used when responding to the tool call with output.
540
541 - `List<PendingSafetyCheck> pendingSafetyChecks`
542
543 The pending safety checks for the computer call.
544
545 - `String id`
546
547 The ID of the pending safety check.
548
549 - `Optional<String> code`
550
551 The type of the pending safety check.
552
553 - `Optional<String> message`
554
555 Details about the pending safety check.
556
557 - `Status status`
558
559 The status of the item. One of `in_progress`, `completed`, or
560 `incomplete`. Populated when items are returned via API.
561
562 - `IN_PROGRESS("in_progress")`
563
564 - `COMPLETED("completed")`
565
566 - `INCOMPLETE("incomplete")`
567
568 - `Type type`
569
570 The type of the computer call. Always `computer_call`.
571
572 - `COMPUTER_CALL("computer_call")`
573
574 - `Optional<Action> action`
575
576 A click action.
577
578 - `class Click:`
579
580 A click action.
581
582 - `Button button`
583
584 Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
585
586 - `LEFT("left")`
587
588 - `RIGHT("right")`
589
590 - `WHEEL("wheel")`
591
592 - `BACK("back")`
593
594 - `FORWARD("forward")`
595
596 - `JsonValue; type "click"constant`
597
598 Specifies the event type. For a click action, this property is always `click`.
599
600 - `CLICK("click")`
601
602 - `long x`
603
604 The x-coordinate where the click occurred.
605
606 - `long y`
607
608 The y-coordinate where the click occurred.
609
610 - `Optional<List<String>> keys`
611
612 The keys being held while clicking.
613
614 - `class DoubleClick:`
615
616 A double click action.
617
618 - `Optional<List<String>> keys`
619
620 The keys being held while double-clicking.
621
622 - `JsonValue; type "double_click"constant`
623
624 Specifies the event type. For a double click action, this property is always set to `double_click`.
625
626 - `DOUBLE_CLICK("double_click")`
627
628 - `long x`
629
630 The x-coordinate where the double click occurred.
631
632 - `long y`
633
634 The y-coordinate where the double click occurred.
635
636 - `class Drag:`
637
638 A drag action.
639
640 - `List<Path> path`
641
642 An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
643
644 ```
645 [
646 { x: 100, y: 200 },
647 { x: 200, y: 300 }
648 ]
649 ```
650
651 - `long x`
652
653 The x-coordinate.
654
655 - `long y`
656
657 The y-coordinate.
658
659 - `JsonValue; type "drag"constant`
660
661 Specifies the event type. For a drag action, this property is always set to `drag`.
662
663 - `DRAG("drag")`
664
665 - `Optional<List<String>> keys`
666
667 The keys being held while dragging the mouse.
668
669 - `class Keypress:`
670
671 A collection of keypresses the model would like to perform.
672
673 - `List<String> keys`
674
675 The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
676
677 - `JsonValue; type "keypress"constant`
678
679 Specifies the event type. For a keypress action, this property is always set to `keypress`.
680
681 - `KEYPRESS("keypress")`
682
683 - `class Move:`
684
685 A mouse move action.
686
687 - `JsonValue; type "move"constant`
688
689 Specifies the event type. For a move action, this property is always set to `move`.
690
691 - `MOVE("move")`
692
693 - `long x`
694
695 The x-coordinate to move to.
696
697 - `long y`
698
699 The y-coordinate to move to.
700
701 - `Optional<List<String>> keys`
702
703 The keys being held while moving the mouse.
704
705 - `JsonValue;`
706
707 - `JsonValue; type "screenshot"constant`
708
709 Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
710
711 - `SCREENSHOT("screenshot")`
712
713 - `class Scroll:`
714
715 A scroll action.
716
717 - `long scrollX`
718
719 The horizontal scroll distance.
720
721 - `long scrollY`
722
723 The vertical scroll distance.
724
725 - `JsonValue; type "scroll"constant`
726
727 Specifies the event type. For a scroll action, this property is always set to `scroll`.
728
729 - `SCROLL("scroll")`
730
731 - `long x`
732
733 The x-coordinate where the scroll occurred.
734
735 - `long y`
736
737 The y-coordinate where the scroll occurred.
738
739 - `Optional<List<String>> keys`
740
741 The keys being held while scrolling.
742
743 - `class Type:`
744
745 An action to type in text.
746
747 - `String text`
748
749 The text to type.
750
751 - `JsonValue; type "type"constant`
752
753 Specifies the event type. For a type action, this property is always set to `type`.
754
755 - `TYPE("type")`
756
757 - `JsonValue;`
758
759 - `JsonValue; type "wait"constant`
760
761 Specifies the event type. For a wait action, this property is always set to `wait`.
762
763 - `WAIT("wait")`
764
765 - `Optional<List<ComputerAction>> actions`
766
767 Flattened batched actions for `computer_use`. Each action includes an
768 `type` discriminator and action-specific fields.
769
770 - `Click`
771
772 - `Button button`
773
774 Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
775
776 - `LEFT("left")`
777
778 - `RIGHT("right")`
779
780 - `WHEEL("wheel")`
781
782 - `BACK("back")`
783
784 - `FORWARD("forward")`
785
786 - `JsonValue; type "click"constant`
787
788 Specifies the event type. For a click action, this property is always `click`.
789
790 - `CLICK("click")`
791
792 - `long x`
793
794 The x-coordinate where the click occurred.
795
796 - `long y`
797
798 The y-coordinate where the click occurred.
799
800 - `Optional<List<String>> keys`
801
802 The keys being held while clicking.
803
804 - `DoubleClick`
805
806 - `Optional<List<String>> keys`
807
808 The keys being held while double-clicking.
809
810 - `JsonValue; type "double_click"constant`
811
812 Specifies the event type. For a double click action, this property is always set to `double_click`.
813
814 - `DOUBLE_CLICK("double_click")`
815
816 - `long x`
817
818 The x-coordinate where the double click occurred.
819
820 - `long y`
821
822 The y-coordinate where the double click occurred.
823
824 - `Drag`
825
826 - `List<Path> path`
827
828 An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
829
830 ```
831 [
832 { x: 100, y: 200 },
833 { x: 200, y: 300 }
834 ]
835 ```
836
837 - `long x`
838
839 The x-coordinate.
840
841 - `long y`
842
843 The y-coordinate.
844
845 - `JsonValue; type "drag"constant`
846
847 Specifies the event type. For a drag action, this property is always set to `drag`.
848
849 - `DRAG("drag")`
850
851 - `Optional<List<String>> keys`
852
853 The keys being held while dragging the mouse.
854
855 - `Keypress`
856
857 - `List<String> keys`
858
859 The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
860
861 - `JsonValue; type "keypress"constant`
862
863 Specifies the event type. For a keypress action, this property is always set to `keypress`.
864
865 - `KEYPRESS("keypress")`
866
867 - `Move`
868
869 - `JsonValue; type "move"constant`
870
871 Specifies the event type. For a move action, this property is always set to `move`.
872
873 - `MOVE("move")`
874
875 - `long x`
876
877 The x-coordinate to move to.
878
879 - `long y`
880
881 The y-coordinate to move to.
882
883 - `Optional<List<String>> keys`
884
885 The keys being held while moving the mouse.
886
887 - `JsonValue;`
888
889 - `JsonValue; type "screenshot"constant`
890
891 Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
892
893 - `SCREENSHOT("screenshot")`
894
895 - `Scroll`
896
897 - `long scrollX`
898
899 The horizontal scroll distance.
900
901 - `long scrollY`
902
903 The vertical scroll distance.
904
905 - `JsonValue; type "scroll"constant`
906
907 Specifies the event type. For a scroll action, this property is always set to `scroll`.
908
909 - `SCROLL("scroll")`
910
911 - `long x`
912
913 The x-coordinate where the scroll occurred.
914
915 - `long y`
916
917 The y-coordinate where the scroll occurred.
918
919 - `Optional<List<String>> keys`
920
921 The keys being held while scrolling.
922
923 - `Type`
924
925 - `String text`
926
927 The text to type.
928
929 - `JsonValue; type "type"constant`
930
931 Specifies the event type. For a type action, this property is always set to `type`.
932
933 - `TYPE("type")`
934
935 - `JsonValue;`
936
937 - `JsonValue; type "wait"constant`
938
939 Specifies the event type. For a wait action, this property is always set to `wait`.
940
941 - `WAIT("wait")`
942
943 - `ComputerCallOutput`
944
945 - `String callId`
946
947 The ID of the computer tool call that produced the output.
948
949 - `ResponseComputerToolCallOutputScreenshot output`
950
951 A computer screenshot image used with the computer use tool.
952
953 - `JsonValue; type "computer_screenshot"constant`
954
955 Specifies the event type. For a computer screenshot, this property is
956 always set to `computer_screenshot`.
957
958 - `COMPUTER_SCREENSHOT("computer_screenshot")`
959
960 - `Optional<String> fileId`
961
962 The identifier of an uploaded file that contains the screenshot.
963
964 - `Optional<String> imageUrl`
965
966 The URL of the screenshot image.
967
968 - `JsonValue; type "computer_call_output"constant`
969
970 The type of the computer tool call output. Always `computer_call_output`.
971
972 - `COMPUTER_CALL_OUTPUT("computer_call_output")`
973
974 - `Optional<String> id`
975
976 The ID of the computer tool call output.
977
978 - `Optional<List<AcknowledgedSafetyCheck>> acknowledgedSafetyChecks`
979
980 The safety checks reported by the API that have been acknowledged by the developer.
981
982 - `String id`
983
984 The ID of the pending safety check.
985
986 - `Optional<String> code`
987
988 The type of the pending safety check.
989
990 - `Optional<String> message`
991
992 Details about the pending safety check.
993
994 - `Optional<Status> status`
995
996 The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.
997
998 - `IN_PROGRESS("in_progress")`
999
1000 - `COMPLETED("completed")`
1001
1002 - `INCOMPLETE("incomplete")`
1003
1004 - `class ResponseFunctionWebSearch:`
1005
1006 The results of a web search tool call. See the
1007 [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.
1008
1009 - `String id`
1010
1011 The unique ID of the web search tool call.
1012
1013 - `Action action`
1014
1015 An object describing the specific action taken in this web search call.
1016 Includes details on how the model used the web (search, open_page, find_in_page).
1017
1018 - `class Search:`
1019
1020 Action type "search" - Performs a web search query.
1021
1022 - `String query`
1023
1024 [DEPRECATED] The search query.
1025
1026 - `JsonValue; type "search"constant`
1027
1028 The action type.
1029
1030 - `SEARCH("search")`
1031
1032 - `Optional<List<String>> queries`
1033
1034 The search queries.
1035
1036 - `Optional<List<Source>> sources`
1037
1038 The sources used in the search.
1039
1040 - `JsonValue; type "url"constant`
1041
1042 The type of source. Always `url`.
1043
1044 - `URL("url")`
1045
1046 - `String url`
1047
1048 The URL of the source.
1049
1050 - `class OpenPage:`
1051
1052 Action type "open_page" - Opens a specific URL from search results.
1053
1054 - `JsonValue; type "open_page"constant`
1055
1056 The action type.
1057
1058 - `OPEN_PAGE("open_page")`
1059
1060 - `Optional<String> url`
1061
1062 The URL opened by the model.
1063
1064 - `class FindInPage:`
1065
1066 Action type "find_in_page": Searches for a pattern within a loaded page.
1067
1068 - `String pattern`
1069
1070 The pattern or text to search for within the page.
1071
1072 - `JsonValue; type "find_in_page"constant`
1073
1074 The action type.
1075
1076 - `FIND_IN_PAGE("find_in_page")`
1077
1078 - `String url`
1079
1080 The URL of the page searched for the pattern.
1081
1082 - `Status status`
1083
1084 The status of the web search tool call.
1085
1086 - `IN_PROGRESS("in_progress")`
1087
1088 - `SEARCHING("searching")`
1089
1090 - `COMPLETED("completed")`
1091
1092 - `FAILED("failed")`
1093
1094 - `JsonValue; type "web_search_call"constant`
1095
1096 The type of the web search tool call. Always `web_search_call`.
1097
1098 - `WEB_SEARCH_CALL("web_search_call")`
1099
1100 - `class ResponseFunctionToolCall:`
1101
1102 A tool call to run a function. See the
1103 [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.
1104
1105 - `String arguments`
1106
1107 A JSON string of the arguments to pass to the function.
1108
1109 - `String callId`
1110
1111 The unique ID of the function tool call generated by the model.
1112
1113 - `String name`
1114
1115 The name of the function to run.
1116
1117 - `JsonValue; type "function_call"constant`
1118
1119 The type of the function tool call. Always `function_call`.
1120
1121 - `FUNCTION_CALL("function_call")`
1122
1123 - `Optional<String> id`
1124
1125 The unique ID of the function tool call.
1126
1127 - `Optional<String> namespace`
1128
1129 The namespace of the function to run.
1130
1131 - `Optional<Status> status`
1132
1133 The status of the item. One of `in_progress`, `completed`, or
1134 `incomplete`. Populated when items are returned via API.
1135
1136 - `IN_PROGRESS("in_progress")`
1137
1138 - `COMPLETED("completed")`
1139
1140 - `INCOMPLETE("incomplete")`
1141
1142 - `FunctionCallOutput`
1143
1144 - `String callId`
1145
1146 The unique ID of the function tool call generated by the model.
1147
1148 - `Output output`
1149
1150 Text, image, or file output of the function tool call.
1151
1152 - `String`
1153
1154 - `List<ResponseFunctionCallOutputItem>`
1155
1156 - `class ResponseInputTextContent:`
1157
1158 A text input to the model.
1159
1160 - `String text`
1161
1162 The text input to the model.
1163
1164 - `JsonValue; type "input_text"constant`
1165
1166 The type of the input item. Always `input_text`.
1167
1168 - `INPUT_TEXT("input_text")`
1169
1170 - `class ResponseInputImageContent:`
1171
1172 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)
1173
1174 - `JsonValue; type "input_image"constant`
1175
1176 The type of the input item. Always `input_image`.
1177
1178 - `INPUT_IMAGE("input_image")`
1179
1180 - `Optional<Detail> detail`
1181
1182 The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
1183
1184 - `LOW("low")`
1185
1186 - `HIGH("high")`
1187
1188 - `AUTO("auto")`
1189
1190 - `ORIGINAL("original")`
1191
1192 - `Optional<String> fileId`
1193
1194 The ID of the file to be sent to the model.
1195
1196 - `Optional<String> imageUrl`
1197
1198 The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
1199
1200 - `class ResponseInputFileContent:`
1201
1202 A file input to the model.
1203
1204 - `JsonValue; type "input_file"constant`
1205
1206 The type of the input item. Always `input_file`.
1207
1208 - `INPUT_FILE("input_file")`
1209
1210 - `Optional<Detail> detail`
1211
1212 The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
1213
1214 - `LOW("low")`
1215
1216 - `HIGH("high")`
1217
1218 - `Optional<String> fileData`
1219
1220 The base64-encoded data of the file to be sent to the model.
1221
1222 - `Optional<String> fileId`
1223
1224 The ID of the file to be sent to the model.
1225
1226 - `Optional<String> fileUrl`
1227
1228 The URL of the file to be sent to the model.
1229
1230 - `Optional<String> filename`
1231
1232 The name of the file to be sent to the model.
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<Status> status`
1245
1246 The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
1247
1248 - `IN_PROGRESS("in_progress")`
1249
1250 - `COMPLETED("completed")`
1251
1252 - `INCOMPLETE("incomplete")`
1253
1254 - `ToolSearchCall`
1255
1256 - `JsonValue arguments`
1257
1258 The arguments supplied to the tool search call.
1259
1260 - `JsonValue; type "tool_search_call"constant`
1261
1262 The item type. Always `tool_search_call`.
1263
1264 - `TOOL_SEARCH_CALL("tool_search_call")`
1265
1266 - `Optional<String> id`
1267
1268 The unique ID of this tool search call.
1269
1270 - `Optional<String> callId`
1271
1272 The unique ID of the tool search call generated by the model.
1273
1274 - `Optional<Execution> execution`
1275
1276 Whether tool search was executed by the server or by the client.
1277
1278 - `SERVER("server")`
1279
1280 - `CLIENT("client")`
1281
1282 - `Optional<Status> status`
1283
1284 The status of the tool search call.
1285
1286 - `IN_PROGRESS("in_progress")`
1287
1288 - `COMPLETED("completed")`
1289
1290 - `INCOMPLETE("incomplete")`
1291
1292 - `class ResponseToolSearchOutputItemParam:`
1293
1294 - `List<Tool> tools`
1295
1296 The loaded tool definitions returned by the tool search output.
1297
1298 - `class FunctionTool:`
1299
1300 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).
1301
1302 - `String name`
1303
1304 The name of the function to call.
1305
1306 - `Optional<Parameters> parameters`
1307
1308 A JSON schema object describing the parameters of the function.
1309
1310 - `Optional<Boolean> strict`
1311
1312 Whether to enforce strict parameter validation. Default `true`.
1313
1314 - `JsonValue; type "function"constant`
1315
1316 The type of the function tool. Always `function`.
1317
1318 - `FUNCTION("function")`
1319
1320 - `Optional<Boolean> deferLoading`
1321
1322 Whether this function is deferred and loaded via tool search.
1323
1324 - `Optional<String> description`
1325
1326 A description of the function. Used by the model to determine whether or not to call the function.
1327
1328 - `class FileSearchTool:`
1329
1330 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).
1331
1332 - `JsonValue; type "file_search"constant`
1333
1334 The type of the file search tool. Always `file_search`.
1335
1336 - `FILE_SEARCH("file_search")`
1337
1338 - `List<String> vectorStoreIds`
1339
1340 The IDs of the vector stores to search.
1341
1342 - `Optional<Filters> filters`
1343
1344 A filter to apply.
1345
1346 - `class ComparisonFilter:`
1347
1348 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
1349
1350 - `String key`
1351
1352 The key to compare against the value.
1353
1354 - `Type type`
1355
1356 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.
1357
1358 - `eq`: equals
1359 - `ne`: not equal
1360 - `gt`: greater than
1361 - `gte`: greater than or equal
1362 - `lt`: less than
1363 - `lte`: less than or equal
1364 - `in`: in
1365 - `nin`: not in
1366
1367 - `EQ("eq")`
1368
1369 - `NE("ne")`
1370
1371 - `GT("gt")`
1372
1373 - `GTE("gte")`
1374
1375 - `LT("lt")`
1376
1377 - `LTE("lte")`
1378
1379 - `IN("in")`
1380
1381 - `NIN("nin")`
1382
1383 - `Value value`
1384
1385 The value to compare against the attribute key; supports string, number, or boolean types.
1386
1387 - `String`
1388
1389 - `double`
1390
1391 - `boolean`
1392
1393 - `List<ComparisonFilterValueItem>`
1394
1395 - `String`
1396
1397 - `double`
1398
1399 - `class CompoundFilter:`
1400
1401 Combine multiple filters using `and` or `or`.
1402
1403 - `List<Filter> filters`
1404
1405 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
1406
1407 - `class ComparisonFilter:`
1408
1409 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
1410
1411 - `JsonValue`
1412
1413 - `Type type`
1414
1415 Type of operation: `and` or `or`.
1416
1417 - `AND("and")`
1418
1419 - `OR("or")`
1420
1421 - `Optional<Long> maxNumResults`
1422
1423 The maximum number of results to return. This number should be between 1 and 50 inclusive.
1424
1425 - `Optional<RankingOptions> rankingOptions`
1426
1427 Ranking options for search.
1428
1429 - `Optional<HybridSearch> hybridSearch`
1430
1431 Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
1432
1433 - `double embeddingWeight`
1434
1435 The weight of the embedding in the reciprocal ranking fusion.
1436
1437 - `double textWeight`
1438
1439 The weight of the text in the reciprocal ranking fusion.
1440
1441 - `Optional<Ranker> ranker`
1442
1443 The ranker to use for the file search.
1444
1445 - `AUTO("auto")`
1446
1447 - `DEFAULT_2024_11_15("default-2024-11-15")`
1448
1449 - `Optional<Double> scoreThreshold`
1450
1451 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.
1452
1453 - `class ComputerTool:`
1454
1455 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
1456
1457 - `JsonValue; type "computer"constant`
1458
1459 The type of the computer tool. Always `computer`.
1460
1461 - `COMPUTER("computer")`
1462
1463 - `class ComputerUsePreviewTool:`
1464
1465 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
1466
1467 - `long displayHeight`
1468
1469 The height of the computer display.
1470
1471 - `long displayWidth`
1472
1473 The width of the computer display.
1474
1475 - `Environment environment`
1476
1477 The type of computer environment to control.
1478
1479 - `WINDOWS("windows")`
1480
1481 - `MAC("mac")`
1482
1483 - `LINUX("linux")`
1484
1485 - `UBUNTU("ubuntu")`
1486
1487 - `BROWSER("browser")`
1488
1489 - `JsonValue; type "computer_use_preview"constant`
1490
1491 The type of the computer use tool. Always `computer_use_preview`.
1492
1493 - `COMPUTER_USE_PREVIEW("computer_use_preview")`
1494
1495 - `class WebSearchTool:`
1496
1497 Search the Internet for sources related to the prompt. Learn more about the
1498 [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
1499
1500 - `Type type`
1501
1502 The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
1503
1504 - `WEB_SEARCH("web_search")`
1505
1506 - `WEB_SEARCH_2025_08_26("web_search_2025_08_26")`
1507
1508 - `Optional<Filters> filters`
1509
1510 Filters for the search.
1511
1512 - `Optional<List<String>> allowedDomains`
1513
1514 Allowed domains for the search. If not provided, all domains are allowed.
1515 Subdomains of the provided domains are allowed as well.
1516
1517 Example: `["pubmed.ncbi.nlm.nih.gov"]`
1518
1519 - `Optional<SearchContextSize> searchContextSize`
1520
1521 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.
1522
1523 - `LOW("low")`
1524
1525 - `MEDIUM("medium")`
1526
1527 - `HIGH("high")`
1528
1529 - `Optional<UserLocation> userLocation`
1530
1531 The approximate location of the user.
1532
1533 - `Optional<String> city`
1534
1535 Free text input for the city of the user, e.g. `San Francisco`.
1536
1537 - `Optional<String> country`
1538
1539 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
1540
1541 - `Optional<String> region`
1542
1543 Free text input for the region of the user, e.g. `California`.
1544
1545 - `Optional<String> timezone`
1546
1547 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
1548
1549 - `Optional<Type> type`
1550
1551 The type of location approximation. Always `approximate`.
1552
1553 - `APPROXIMATE("approximate")`
1554
1555 - `Mcp`
1556
1557 - `String serverLabel`
1558
1559 A label for this MCP server, used to identify it in tool calls.
1560
1561 - `JsonValue; type "mcp"constant`
1562
1563 The type of the MCP tool. Always `mcp`.
1564
1565 - `MCP("mcp")`
1566
1567 - `Optional<AllowedTools> allowedTools`
1568
1569 List of allowed tool names or a filter object.
1570
1571 - `List<String>`
1572
1573 - `class McpToolFilter:`
1574
1575 A filter object to specify which tools are allowed.
1576
1577 - `Optional<Boolean> readOnly`
1578
1579 Indicates whether or not a tool modifies data or is read-only. If an
1580 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1581 it will match this filter.
1582
1583 - `Optional<List<String>> toolNames`
1584
1585 List of allowed tool names.
1586
1587 - `Optional<String> authorization`
1588
1589 An OAuth access token that can be used with a remote MCP server, either
1590 with a custom MCP server URL or a service connector. Your application
1591 must handle the OAuth authorization flow and provide the token here.
1592
1593 - `Optional<ConnectorId> connectorId`
1594
1595 Identifier for service connectors, like those available in ChatGPT. One of
1596 `server_url` or `connector_id` must be provided. Learn more about service
1597 connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
1598
1599 Currently supported `connector_id` values are:
1600
1601 - Dropbox: `connector_dropbox`
1602 - Gmail: `connector_gmail`
1603 - Google Calendar: `connector_googlecalendar`
1604 - Google Drive: `connector_googledrive`
1605 - Microsoft Teams: `connector_microsoftteams`
1606 - Outlook Calendar: `connector_outlookcalendar`
1607 - Outlook Email: `connector_outlookemail`
1608 - SharePoint: `connector_sharepoint`
1609
1610 - `CONNECTOR_DROPBOX("connector_dropbox")`
1611
1612 - `CONNECTOR_GMAIL("connector_gmail")`
1613
1614 - `CONNECTOR_GOOGLECALENDAR("connector_googlecalendar")`
1615
1616 - `CONNECTOR_GOOGLEDRIVE("connector_googledrive")`
1617
1618 - `CONNECTOR_MICROSOFTTEAMS("connector_microsoftteams")`
1619
1620 - `CONNECTOR_OUTLOOKCALENDAR("connector_outlookcalendar")`
1621
1622 - `CONNECTOR_OUTLOOKEMAIL("connector_outlookemail")`
1623
1624 - `CONNECTOR_SHAREPOINT("connector_sharepoint")`
1625
1626 - `Optional<Boolean> deferLoading`
1627
1628 Whether this MCP tool is deferred and discovered via tool search.
1629
1630 - `Optional<Headers> headers`
1631
1632 Optional HTTP headers to send to the MCP server. Use for authentication
1633 or other purposes.
1634
1635 - `Optional<RequireApproval> requireApproval`
1636
1637 Specify which of the MCP server's tools require approval.
1638
1639 - `class McpToolApprovalFilter:`
1640
1641 Specify which of the MCP server's tools require approval. Can be
1642 `always`, `never`, or a filter object associated with tools
1643 that require approval.
1644
1645 - `Optional<Always> always`
1646
1647 A filter object to specify which tools are allowed.
1648
1649 - `Optional<Boolean> readOnly`
1650
1651 Indicates whether or not a tool modifies data or is read-only. If an
1652 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1653 it will match this filter.
1654
1655 - `Optional<List<String>> toolNames`
1656
1657 List of allowed tool names.
1658
1659 - `Optional<Never> never`
1660
1661 A filter object to specify which tools are allowed.
1662
1663 - `Optional<Boolean> readOnly`
1664
1665 Indicates whether or not a tool modifies data or is read-only. If an
1666 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1667 it will match this filter.
1668
1669 - `Optional<List<String>> toolNames`
1670
1671 List of allowed tool names.
1672
1673 - `enum McpToolApprovalSetting:`
1674
1675 Specify a single approval policy for all tools. One of `always` or
1676 `never`. When set to `always`, all tools will require approval. When
1677 set to `never`, all tools will not require approval.
1678
1679 - `ALWAYS("always")`
1680
1681 - `NEVER("never")`
1682
1683 - `Optional<String> serverDescription`
1684
1685 Optional description of the MCP server, used to provide more context.
1686
1687 - `Optional<String> serverUrl`
1688
1689 The URL for the MCP server. One of `server_url` or `connector_id` must be
1690 provided.
1691
1692 - `CodeInterpreter`
1693
1694 - `Container container`
1695
1696 The code interpreter container. Can be a container ID or an object that
1697 specifies uploaded file IDs to make available to your code, along with an
1698 optional `memory_limit` setting.
1699
1700 - `String`
1701
1702 - `class CodeInterpreterToolAuto:`
1703
1704 Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
1705
1706 - `JsonValue; type "auto"constant`
1707
1708 Always `auto`.
1709
1710 - `AUTO("auto")`
1711
1712 - `Optional<List<String>> fileIds`
1713
1714 An optional list of uploaded files to make available to your code.
1715
1716 - `Optional<MemoryLimit> memoryLimit`
1717
1718 The memory limit for the code interpreter container.
1719
1720 - `_1G("1g")`
1721
1722 - `_4G("4g")`
1723
1724 - `_16G("16g")`
1725
1726 - `_64G("64g")`
1727
1728 - `Optional<NetworkPolicy> networkPolicy`
1729
1730 Network access policy for the container.
1731
1732 - `class ContainerNetworkPolicyDisabled:`
1733
1734 - `JsonValue; type "disabled"constant`
1735
1736 Disable outbound network access. Always `disabled`.
1737
1738 - `DISABLED("disabled")`
1739
1740 - `class ContainerNetworkPolicyAllowlist:`
1741
1742 - `List<String> allowedDomains`
1743
1744 A list of allowed domains when type is `allowlist`.
1745
1746 - `JsonValue; type "allowlist"constant`
1747
1748 Allow outbound network access only to specified domains. Always `allowlist`.
1749
1750 - `ALLOWLIST("allowlist")`
1751
1752 - `Optional<List<ContainerNetworkPolicyDomainSecret>> domainSecrets`
1753
1754 Optional domain-scoped secrets for allowlisted domains.
1755
1756 - `String domain`
1757
1758 The domain associated with the secret.
1759
1760 - `String name`
1761
1762 The name of the secret to inject for the domain.
1763
1764 - `String value`
1765
1766 The secret value to inject for the domain.
1767
1768 - `JsonValue; type "code_interpreter"constant`
1769
1770 The type of the code interpreter tool. Always `code_interpreter`.
1771
1772 - `CODE_INTERPRETER("code_interpreter")`
1773
1774 - `ImageGeneration`
1775
1776 - `JsonValue; type "image_generation"constant`
1777
1778 The type of the image generation tool. Always `image_generation`.
1779
1780 - `IMAGE_GENERATION("image_generation")`
1781
1782 - `Optional<Action> action`
1783
1784 Whether to generate a new image or edit an existing image. Default: `auto`.
1785
1786 - `GENERATE("generate")`
1787
1788 - `EDIT("edit")`
1789
1790 - `AUTO("auto")`
1791
1792 - `Optional<Background> background`
1793
1794 Allows to set transparency for the background of the generated image(s).
1795 This parameter is only supported for GPT image models that support
1796 transparent backgrounds. Must be one of `transparent`, `opaque`, or
1797 `auto` (default value). When `auto` is used, the model will
1798 automatically determine the best background for the image.
1799
1800 `gpt-image-2` and `gpt-image-2-2026-04-21` do not support
1801 transparent backgrounds. Requests with `background` set to
1802 `transparent` will return an error for these models; use `opaque` or
1803 `auto` instead.
1804
1805 If `transparent`, the output format needs to support transparency,
1806 so it should be set to either `png` (default value) or `webp`.
1807
1808 - `TRANSPARENT("transparent")`
1809
1810 - `OPAQUE("opaque")`
1811
1812 - `AUTO("auto")`
1813
1814 - `Optional<InputFidelity> inputFidelity`
1815
1816 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`.
1817
1818 - `HIGH("high")`
1819
1820 - `LOW("low")`
1821
1822 - `Optional<InputImageMask> inputImageMask`
1823
1824 Optional mask for inpainting. Contains `image_url`
1825 (string, optional) and `file_id` (string, optional).
1826
1827 - `Optional<String> fileId`
1828
1829 File ID for the mask image.
1830
1831 - `Optional<String> imageUrl`
1832
1833 Base64-encoded mask image.
1834
1835 - `Optional<Model> model`
1836
1837 The image generation model to use. Default: `gpt-image-1`.
1838
1839 - `GPT_IMAGE_1("gpt-image-1")`
1840
1841 - `GPT_IMAGE_1_MINI("gpt-image-1-mini")`
1842
1843 - `GPT_IMAGE_2("gpt-image-2")`
1844
1845 - `GPT_IMAGE_2_2026_04_21("gpt-image-2-2026-04-21")`
1846
1847 - `GPT_IMAGE_1_5("gpt-image-1.5")`
1848
1849 - `CHATGPT_IMAGE_LATEST("chatgpt-image-latest")`
1850
1851 - `Optional<Moderation> moderation`
1852
1853 Moderation level for the generated image. Default: `auto`.
1854
1855 - `AUTO("auto")`
1856
1857 - `LOW("low")`
1858
1859 - `Optional<Long> outputCompression`
1860
1861 Compression level for the output image. Default: 100.
1862
1863 - `Optional<OutputFormat> outputFormat`
1864
1865 The output format of the generated image. One of `png`, `webp`, or
1866 `jpeg`. Default: `png`.
1867
1868 - `PNG("png")`
1869
1870 - `WEBP("webp")`
1871
1872 - `JPEG("jpeg")`
1873
1874 - `Optional<Long> partialImages`
1875
1876 Number of partial images to generate in streaming mode, from 0 (default value) to 3.
1877
1878 - `Optional<Quality> quality`
1879
1880 The quality of the generated image. One of `low`, `medium`, `high`,
1881 or `auto`. Default: `auto`.
1882
1883 - `LOW("low")`
1884
1885 - `MEDIUM("medium")`
1886
1887 - `HIGH("high")`
1888
1889 - `AUTO("auto")`
1890
1891 - `Optional<Size> size`
1892
1893 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`.
1894
1895 - `_1024X1024("1024x1024")`
1896
1897 - `_1024X1536("1024x1536")`
1898
1899 - `_1536X1024("1536x1024")`
1900
1901 - `AUTO("auto")`
1902
1903 - `JsonValue;`
1904
1905 - `JsonValue; type "local_shell"constant`
1906
1907 The type of the local shell tool. Always `local_shell`.
1908
1909 - `LOCAL_SHELL("local_shell")`
1910
1911 - `class FunctionShellTool:`
1912
1913 A tool that allows the model to execute shell commands.
1914
1915 - `JsonValue; type "shell"constant`
1916
1917 The type of the shell tool. Always `shell`.
1918
1919 - `SHELL("shell")`
1920
1921 - `Optional<Environment> environment`
1922
1923 - `class ContainerAuto:`
1924
1925 - `JsonValue; type "container_auto"constant`
1926
1927 Automatically creates a container for this request
1928
1929 - `CONTAINER_AUTO("container_auto")`
1930
1931 - `Optional<List<String>> fileIds`
1932
1933 An optional list of uploaded files to make available to your code.
1934
1935 - `Optional<MemoryLimit> memoryLimit`
1936
1937 The memory limit for the container.
1938
1939 - `_1G("1g")`
1940
1941 - `_4G("4g")`
1942
1943 - `_16G("16g")`
1944
1945 - `_64G("64g")`
1946
1947 - `Optional<NetworkPolicy> networkPolicy`
1948
1949 Network access policy for the container.
1950
1951 - `class ContainerNetworkPolicyDisabled:`
1952
1953 - `class ContainerNetworkPolicyAllowlist:`
1954
1955 - `Optional<List<Skill>> skills`
1956
1957 An optional list of skills referenced by id or inline data.
1958
1959 - `class SkillReference:`
1960
1961 - `String skillId`
1962
1963 The ID of the referenced skill.
1964
1965 - `JsonValue; type "skill_reference"constant`
1966
1967 References a skill created with the /v1/skills endpoint.
1968
1969 - `SKILL_REFERENCE("skill_reference")`
1970
1971 - `Optional<String> version`
1972
1973 Optional skill version. Use a positive integer or 'latest'. Omit for default.
1974
1975 - `class InlineSkill:`
1976
1977 - `String description`
1978
1979 The description of the skill.
1980
1981 - `String name`
1982
1983 The name of the skill.
1984
1985 - `InlineSkillSource source`
1986
1987 Inline skill payload
1988
1989 - `String data`
1990
1991 Base64-encoded skill zip bundle.
1992
1993 - `JsonValue; mediaType "application/zip"constant`
1994
1995 The media type of the inline skill payload. Must be `application/zip`.
1996
1997 - `APPLICATION_ZIP("application/zip")`
1998
1999 - `JsonValue; type "base64"constant`
2000
2001 The type of the inline skill source. Must be `base64`.
2002
2003 - `BASE64("base64")`
2004
2005 - `JsonValue; type "inline"constant`
2006
2007 Defines an inline skill for this request.
2008
2009 - `INLINE("inline")`
2010
2011 - `class LocalEnvironment:`
2012
2013 - `JsonValue; type "local"constant`
2014
2015 Use a local computer environment.
2016
2017 - `LOCAL("local")`
2018
2019 - `Optional<List<LocalSkill>> skills`
2020
2021 An optional list of skills.
2022
2023 - `String description`
2024
2025 The description of the skill.
2026
2027 - `String name`
2028
2029 The name of the skill.
2030
2031 - `String path`
2032
2033 The path to the directory containing the skill.
2034
2035 - `class ContainerReference:`
2036
2037 - `String containerId`
2038
2039 The ID of the referenced container.
2040
2041 - `JsonValue; type "container_reference"constant`
2042
2043 References a container created with the /v1/containers endpoint
2044
2045 - `CONTAINER_REFERENCE("container_reference")`
2046
2047 - `class CustomTool:`
2048
2049 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)
2050
2051 - `String name`
2052
2053 The name of the custom tool, used to identify it in tool calls.
2054
2055 - `JsonValue; type "custom"constant`
2056
2057 The type of the custom tool. Always `custom`.
2058
2059 - `CUSTOM("custom")`
2060
2061 - `Optional<Boolean> deferLoading`
2062
2063 Whether this tool should be deferred and discovered via tool search.
2064
2065 - `Optional<String> description`
2066
2067 Optional description of the custom tool, used to provide more context.
2068
2069 - `Optional<CustomToolInputFormat> format`
2070
2071 The input format for the custom tool. Default is unconstrained text.
2072
2073 - `JsonValue;`
2074
2075 - `JsonValue; type "text"constant`
2076
2077 Unconstrained text format. Always `text`.
2078
2079 - `TEXT("text")`
2080
2081 - `Grammar`
2082
2083 - `String definition`
2084
2085 The grammar definition.
2086
2087 - `Syntax syntax`
2088
2089 The syntax of the grammar definition. One of `lark` or `regex`.
2090
2091 - `LARK("lark")`
2092
2093 - `REGEX("regex")`
2094
2095 - `JsonValue; type "grammar"constant`
2096
2097 Grammar format. Always `grammar`.
2098
2099 - `GRAMMAR("grammar")`
2100
2101 - `class NamespaceTool:`
2102
2103 Groups function/custom tools under a shared namespace.
2104
2105 - `String description`
2106
2107 A description of the namespace shown to the model.
2108
2109 - `String name`
2110
2111 The namespace name used in tool calls (for example, `crm`).
2112
2113 - `List<Tool> tools`
2114
2115 The function/custom tools available inside this namespace.
2116
2117 - `class Function:`
2118
2119 - `String name`
2120
2121 - `JsonValue; type "function"constant`
2122
2123 - `FUNCTION("function")`
2124
2125 - `Optional<Boolean> deferLoading`
2126
2127 Whether this function should be deferred and discovered via tool search.
2128
2129 - `Optional<String> description`
2130
2131 - `Optional<JsonValue> parameters`
2132
2133 - `Optional<Boolean> strict`
2134
2135 - `class CustomTool:`
2136
2137 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)
2138
2139 - `JsonValue; type "namespace"constant`
2140
2141 The type of the tool. Always `namespace`.
2142
2143 - `NAMESPACE("namespace")`
2144
2145 - `class ToolSearchTool:`
2146
2147 Hosted or BYOT tool search configuration for deferred tools.
2148
2149 - `JsonValue; type "tool_search"constant`
2150
2151 The type of the tool. Always `tool_search`.
2152
2153 - `TOOL_SEARCH("tool_search")`
2154
2155 - `Optional<String> description`
2156
2157 Description shown to the model for a client-executed tool search tool.
2158
2159 - `Optional<Execution> execution`
2160
2161 Whether tool search is executed by the server or by the client.
2162
2163 - `SERVER("server")`
2164
2165 - `CLIENT("client")`
2166
2167 - `Optional<JsonValue> parameters`
2168
2169 Parameter schema for a client-executed tool search tool.
2170
2171 - `class WebSearchPreviewTool:`
2172
2173 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).
2174
2175 - `Type type`
2176
2177 The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.
2178
2179 - `WEB_SEARCH_PREVIEW("web_search_preview")`
2180
2181 - `WEB_SEARCH_PREVIEW_2025_03_11("web_search_preview_2025_03_11")`
2182
2183 - `Optional<List<SearchContentType>> searchContentTypes`
2184
2185 - `TEXT("text")`
2186
2187 - `IMAGE("image")`
2188
2189 - `Optional<SearchContextSize> searchContextSize`
2190
2191 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.
2192
2193 - `LOW("low")`
2194
2195 - `MEDIUM("medium")`
2196
2197 - `HIGH("high")`
2198
2199 - `Optional<UserLocation> userLocation`
2200
2201 The user's location.
2202
2203 - `JsonValue; type "approximate"constant`
2204
2205 The type of location approximation. Always `approximate`.
2206
2207 - `APPROXIMATE("approximate")`
2208
2209 - `Optional<String> city`
2210
2211 Free text input for the city of the user, e.g. `San Francisco`.
2212
2213 - `Optional<String> country`
2214
2215 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
2216
2217 - `Optional<String> region`
2218
2219 Free text input for the region of the user, e.g. `California`.
2220
2221 - `Optional<String> timezone`
2222
2223 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
2224
2225 - `class ApplyPatchTool:`
2226
2227 Allows the assistant to create, delete, or update files using unified diffs.
2228
2229 - `JsonValue; type "apply_patch"constant`
2230
2231 The type of the tool. Always `apply_patch`.
2232
2233 - `APPLY_PATCH("apply_patch")`
2234
2235 - `JsonValue; type "tool_search_output"constant`
2236
2237 The item type. Always `tool_search_output`.
2238
2239 - `TOOL_SEARCH_OUTPUT("tool_search_output")`
2240
2241 - `Optional<String> id`
2242
2243 The unique ID of this tool search output.
2244
2245 - `Optional<String> callId`
2246
2247 The unique ID of the tool search call generated by the model.
2248
2249 - `Optional<Execution> execution`
2250
2251 Whether tool search was executed by the server or by the client.
2252
2253 - `SERVER("server")`
2254
2255 - `CLIENT("client")`
2256
2257 - `Optional<Status> status`
2258
2259 The status of the tool search output.
2260
2261 - `IN_PROGRESS("in_progress")`
2262
2263 - `COMPLETED("completed")`
2264
2265 - `INCOMPLETE("incomplete")`
2266
2267 - `class ResponseReasoningItem:`
2268
2269 A description of the chain of thought used by a reasoning model while generating
2270 a response. Be sure to include these items in your `input` to the Responses API
2271 for subsequent turns of a conversation if you are manually
2272 [managing context](https://platform.openai.com/docs/guides/conversation-state).
2273
2274 - `String id`
2275
2276 The unique identifier of the reasoning content.
2277
2278 - `List<Summary> summary`
2279
2280 Reasoning summary content.
2281
2282 - `String text`
2283
2284 A summary of the reasoning output from the model so far.
2285
2286 - `JsonValue; type "summary_text"constant`
2287
2288 The type of the object. Always `summary_text`.
2289
2290 - `SUMMARY_TEXT("summary_text")`
2291
2292 - `JsonValue; type "reasoning"constant`
2293
2294 The type of the object. Always `reasoning`.
2295
2296 - `REASONING("reasoning")`
2297
2298 - `Optional<List<Content>> content`
2299
2300 Reasoning text content.
2301
2302 - `String text`
2303
2304 The reasoning text from the model.
2305
2306 - `JsonValue; type "reasoning_text"constant`
2307
2308 The type of the reasoning text. Always `reasoning_text`.
2309
2310 - `REASONING_TEXT("reasoning_text")`
2311
2312 - `Optional<String> encryptedContent`
2313
2314 The encrypted content of the reasoning item - populated when a response is
2315 generated with `reasoning.encrypted_content` in the `include` parameter.
2316
2317 - `Optional<Status> status`
2318
2319 The status of the item. One of `in_progress`, `completed`, or
2320 `incomplete`. Populated when items are returned via API.
2321
2322 - `IN_PROGRESS("in_progress")`
2323
2324 - `COMPLETED("completed")`
2325
2326 - `INCOMPLETE("incomplete")`
2327
2328 - `class ResponseCompactionItemParam:`
2329
2330 A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
2331
2332 - `String encryptedContent`
2333
2334 The encrypted content of the compaction summary.
2335
2336 - `JsonValue; type "compaction"constant`
2337
2338 The type of the item. Always `compaction`.
2339
2340 - `COMPACTION("compaction")`
2341
2342 - `Optional<String> id`
2343
2344 The ID of the compaction item.
2345
2346 - `ImageGenerationCall`
2347
2348 - `String id`
2349
2350 The unique ID of the image generation call.
2351
2352 - `Optional<String> result`
2353
2354 The generated image encoded in base64.
2355
2356 - `Status status`
2357
2358 The status of the image generation call.
2359
2360 - `IN_PROGRESS("in_progress")`
2361
2362 - `COMPLETED("completed")`
2363
2364 - `GENERATING("generating")`
2365
2366 - `FAILED("failed")`
2367
2368 - `JsonValue; type "image_generation_call"constant`
2369
2370 The type of the image generation call. Always `image_generation_call`.
2371
2372 - `IMAGE_GENERATION_CALL("image_generation_call")`
2373
2374 - `class ResponseCodeInterpreterToolCall:`
2375
2376 A tool call to run code.
2377
2378 - `String id`
2379
2380 The unique ID of the code interpreter tool call.
2381
2382 - `Optional<String> code`
2383
2384 The code to run, or null if not available.
2385
2386 - `String containerId`
2387
2388 The ID of the container used to run the code.
2389
2390 - `Optional<List<Output>> outputs`
2391
2392 The outputs generated by the code interpreter, such as logs or images.
2393 Can be null if no outputs are available.
2394
2395 - `class Logs:`
2396
2397 The logs output from the code interpreter.
2398
2399 - `String logs`
2400
2401 The logs output from the code interpreter.
2402
2403 - `JsonValue; type "logs"constant`
2404
2405 The type of the output. Always `logs`.
2406
2407 - `LOGS("logs")`
2408
2409 - `class Image:`
2410
2411 The image output from the code interpreter.
2412
2413 - `JsonValue; type "image"constant`
2414
2415 The type of the output. Always `image`.
2416
2417 - `IMAGE("image")`
2418
2419 - `String url`
2420
2421 The URL of the image output from the code interpreter.
2422
2423 - `Status status`
2424
2425 The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
2426
2427 - `IN_PROGRESS("in_progress")`
2428
2429 - `COMPLETED("completed")`
2430
2431 - `INCOMPLETE("incomplete")`
2432
2433 - `INTERPRETING("interpreting")`
2434
2435 - `FAILED("failed")`
2436
2437 - `JsonValue; type "code_interpreter_call"constant`
2438
2439 The type of the code interpreter tool call. Always `code_interpreter_call`.
2440
2441 - `CODE_INTERPRETER_CALL("code_interpreter_call")`
2442
2443 - `LocalShellCall`
2444
2445 - `String id`
2446
2447 The unique ID of the local shell call.
2448
2449 - `Action action`
2450
2451 Execute a shell command on the server.
2452
2453 - `List<String> command`
2454
2455 The command to run.
2456
2457 - `Env env`
2458
2459 Environment variables to set for the command.
2460
2461 - `JsonValue; type "exec"constant`
2462
2463 The type of the local shell action. Always `exec`.
2464
2465 - `EXEC("exec")`
2466
2467 - `Optional<Long> timeoutMs`
2468
2469 Optional timeout in milliseconds for the command.
2470
2471 - `Optional<String> user`
2472
2473 Optional user to run the command as.
2474
2475 - `Optional<String> workingDirectory`
2476
2477 Optional working directory to run the command in.
2478
2479 - `String callId`
2480
2481 The unique ID of the local shell tool call generated by the model.
2482
2483 - `Status status`
2484
2485 The status of the local shell call.
2486
2487 - `IN_PROGRESS("in_progress")`
2488
2489 - `COMPLETED("completed")`
2490
2491 - `INCOMPLETE("incomplete")`
2492
2493 - `JsonValue; type "local_shell_call"constant`
2494
2495 The type of the local shell call. Always `local_shell_call`.
2496
2497 - `LOCAL_SHELL_CALL("local_shell_call")`
2498
2499 - `LocalShellCallOutput`
2500
2501 - `String id`
2502
2503 The unique ID of the local shell tool call generated by the model.
2504
2505 - `String output`
2506
2507 A JSON string of the output of the local shell tool call.
2508
2509 - `JsonValue; type "local_shell_call_output"constant`
2510
2511 The type of the local shell tool call output. Always `local_shell_call_output`.
2512
2513 - `LOCAL_SHELL_CALL_OUTPUT("local_shell_call_output")`
2514
2515 - `Optional<Status> status`
2516
2517 The status of the item. One of `in_progress`, `completed`, or `incomplete`.
2518
2519 - `IN_PROGRESS("in_progress")`
2520
2521 - `COMPLETED("completed")`
2522
2523 - `INCOMPLETE("incomplete")`
2524
2525 - `ShellCall`
2526
2527 - `Action action`
2528
2529 The shell commands and limits that describe how to run the tool call.
2530
2531 - `List<String> commands`
2532
2533 Ordered shell commands for the execution environment to run.
2534
2535 - `Optional<Long> maxOutputLength`
2536
2537 Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
2538
2539 - `Optional<Long> timeoutMs`
2540
2541 Maximum wall-clock time in milliseconds to allow the shell commands to run.
2542
2543 - `String callId`
2544
2545 The unique ID of the shell tool call generated by the model.
2546
2547 - `JsonValue; type "shell_call"constant`
2548
2549 The type of the item. Always `shell_call`.
2550
2551 - `SHELL_CALL("shell_call")`
2552
2553 - `Optional<String> id`
2554
2555 The unique ID of the shell tool call. Populated when this item is returned via API.
2556
2557 - `Optional<Environment> environment`
2558
2559 The environment to execute the shell commands in.
2560
2561 - `class LocalEnvironment:`
2562
2563 - `class ContainerReference:`
2564
2565 - `Optional<Status> status`
2566
2567 The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
2568
2569 - `IN_PROGRESS("in_progress")`
2570
2571 - `COMPLETED("completed")`
2572
2573 - `INCOMPLETE("incomplete")`
2574
2575 - `ShellCallOutput`
2576
2577 - `String callId`
2578
2579 The unique ID of the shell tool call generated by the model.
2580
2581 - `List<ResponseFunctionShellCallOutputContent> output`
2582
2583 Captured chunks of stdout and stderr output, along with their associated outcomes.
2584
2585 - `Outcome outcome`
2586
2587 The exit or timeout outcome associated with this shell call.
2588
2589 - `JsonValue;`
2590
2591 - `JsonValue; type "timeout"constant`
2592
2593 The outcome type. Always `timeout`.
2594
2595 - `TIMEOUT("timeout")`
2596
2597 - `class Exit:`
2598
2599 Indicates that the shell commands finished and returned an exit code.
2600
2601 - `long exitCode`
2602
2603 The exit code returned by the shell process.
2604
2605 - `JsonValue; type "exit"constant`
2606
2607 The outcome type. Always `exit`.
2608
2609 - `EXIT("exit")`
2610
2611 - `String stderr`
2612
2613 Captured stderr output for the shell call.
2614
2615 - `String stdout`
2616
2617 Captured stdout output for the shell call.
2618
2619 - `JsonValue; type "shell_call_output"constant`
2620
2621 The type of the item. Always `shell_call_output`.
2622
2623 - `SHELL_CALL_OUTPUT("shell_call_output")`
2624
2625 - `Optional<String> id`
2626
2627 The unique ID of the shell tool call output. Populated when this item is returned via API.
2628
2629 - `Optional<Long> maxOutputLength`
2630
2631 The maximum number of UTF-8 characters captured for this shell call's combined output.
2632
2633 - `Optional<Status> status`
2634
2635 The status of the shell call output.
2636
2637 - `IN_PROGRESS("in_progress")`
2638
2639 - `COMPLETED("completed")`
2640
2641 - `INCOMPLETE("incomplete")`
2642
2643 - `ApplyPatchCall`
2644
2645 - `String callId`
2646
2647 The unique ID of the apply patch tool call generated by the model.
2648
2649 - `Operation operation`
2650
2651 The specific create, delete, or update instruction for the apply_patch tool call.
2652
2653 - `class CreateFile:`
2654
2655 Instruction for creating a new file via the apply_patch tool.
2656
2657 - `String diff`
2658
2659 Unified diff content to apply when creating the file.
2660
2661 - `String path`
2662
2663 Path of the file to create relative to the workspace root.
2664
2665 - `JsonValue; type "create_file"constant`
2666
2667 The operation type. Always `create_file`.
2668
2669 - `CREATE_FILE("create_file")`
2670
2671 - `class DeleteFile:`
2672
2673 Instruction for deleting an existing file via the apply_patch tool.
2674
2675 - `String path`
2676
2677 Path of the file to delete relative to the workspace root.
2678
2679 - `JsonValue; type "delete_file"constant`
2680
2681 The operation type. Always `delete_file`.
2682
2683 - `DELETE_FILE("delete_file")`
2684
2685 - `class UpdateFile:`
2686
2687 Instruction for updating an existing file via the apply_patch tool.
2688
2689 - `String diff`
2690
2691 Unified diff content to apply to the existing file.
2692
2693 - `String path`
2694
2695 Path of the file to update relative to the workspace root.
2696
2697 - `JsonValue; type "update_file"constant`
2698
2699 The operation type. Always `update_file`.
2700
2701 - `UPDATE_FILE("update_file")`
2702
2703 - `Status status`
2704
2705 The status of the apply patch tool call. One of `in_progress` or `completed`.
2706
2707 - `IN_PROGRESS("in_progress")`
2708
2709 - `COMPLETED("completed")`
2710
2711 - `JsonValue; type "apply_patch_call"constant`
2712
2713 The type of the item. Always `apply_patch_call`.
2714
2715 - `APPLY_PATCH_CALL("apply_patch_call")`
2716
2717 - `Optional<String> id`
2718
2719 The unique ID of the apply patch tool call. Populated when this item is returned via API.
2720
2721 - `ApplyPatchCallOutput`
2722
2723 - `String callId`
2724
2725 The unique ID of the apply patch tool call generated by the model.
2726
2727 - `Status status`
2728
2729 The status of the apply patch tool call output. One of `completed` or `failed`.
2730
2731 - `COMPLETED("completed")`
2732
2733 - `FAILED("failed")`
2734
2735 - `JsonValue; type "apply_patch_call_output"constant`
2736
2737 The type of the item. Always `apply_patch_call_output`.
2738
2739 - `APPLY_PATCH_CALL_OUTPUT("apply_patch_call_output")`
2740
2741 - `Optional<String> id`
2742
2743 The unique ID of the apply patch tool call output. Populated when this item is returned via API.
2744
2745 - `Optional<String> output`
2746
2747 Optional human-readable log text from the apply patch tool (e.g., patch results or errors).
2748
2749 - `McpListTools`
2750
2751 - `String id`
2752
2753 The unique ID of the list.
2754
2755 - `String serverLabel`
2756
2757 The label of the MCP server.
2758
2759 - `List<Tool> tools`
2760
2761 The tools available on the server.
2762
2763 - `JsonValue inputSchema`
2764
2765 The JSON schema describing the tool's input.
2766
2767 - `String name`
2768
2769 The name of the tool.
2770
2771 - `Optional<JsonValue> annotations`
2772
2773 Additional annotations about the tool.
2774
2775 - `Optional<String> description`
2776
2777 The description of the tool.
2778
2779 - `JsonValue; type "mcp_list_tools"constant`
2780
2781 The type of the item. Always `mcp_list_tools`.
2782
2783 - `MCP_LIST_TOOLS("mcp_list_tools")`
2784
2785 - `Optional<String> error`
2786
2787 Error message if the server could not list tools.
2788
2789 - `McpApprovalRequest`
2790
2791 - `String id`
2792
2793 The unique ID of the approval request.
2794
2795 - `String arguments`
2796
2797 A JSON string of arguments for the tool.
2798
2799 - `String name`
2800
2801 The name of the tool to run.
2802
2803 - `String serverLabel`
2804
2805 The label of the MCP server making the request.
2806
2807 - `JsonValue; type "mcp_approval_request"constant`
2808
2809 The type of the item. Always `mcp_approval_request`.
2810
2811 - `MCP_APPROVAL_REQUEST("mcp_approval_request")`
2812
2813 - `McpApprovalResponse`
2814
2815 - `String approvalRequestId`
2816
2817 The ID of the approval request being answered.
2818
2819 - `boolean approve`
2820
2821 Whether the request was approved.
2822
2823 - `JsonValue; type "mcp_approval_response"constant`
2824
2825 The type of the item. Always `mcp_approval_response`.
2826
2827 - `MCP_APPROVAL_RESPONSE("mcp_approval_response")`
2828
2829 - `Optional<String> id`
2830
2831 The unique ID of the approval response
2832
2833 - `Optional<String> reason`
2834
2835 Optional reason for the decision.
2836
2837 - `McpCall`
2838
2839 - `String id`
2840
2841 The unique ID of the tool call.
2842
2843 - `String arguments`
2844
2845 A JSON string of the arguments passed to the tool.
2846
2847 - `String name`
2848
2849 The name of the tool that was run.
2850
2851 - `String serverLabel`
2852
2853 The label of the MCP server running the tool.
2854
2855 - `JsonValue; type "mcp_call"constant`
2856
2857 The type of the item. Always `mcp_call`.
2858
2859 - `MCP_CALL("mcp_call")`
2860
2861 - `Optional<String> approvalRequestId`
2862
2863 Unique identifier for the MCP tool call approval request.
2864 Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.
2865
2866 - `Optional<String> error`
2867
2868 The error from the tool call, if any.
2869
2870 - `Optional<String> output`
2871
2872 The output from the tool call.
2873
2874 - `Optional<Status> status`
2875
2876 The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
2877
2878 - `IN_PROGRESS("in_progress")`
2879
2880 - `COMPLETED("completed")`
2881
2882 - `INCOMPLETE("incomplete")`
2883
2884 - `CALLING("calling")`
2885
2886 - `FAILED("failed")`
2887
2888 - `class ResponseCustomToolCallOutput:`
2889
2890 The output of a custom tool call from your code, being sent back to the model.
2891
2892 - `String callId`
2893
2894 The call ID, used to map this custom tool call output to a custom tool call.
2895
2896 - `Output output`
2897
2898 The output from the custom tool call generated by your code.
2899 Can be a string or an list of output content.
2900
2901 - `String`
2902
2903 - `List<FunctionAndCustomToolCallOutput>`
2904
2905 - `class ResponseInputText:`
2906
2907 A text input to the model.
2908
2909 - `class ResponseInputImage:`
2910
2911 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
2912
2913 - `class ResponseInputFile:`
2914
2915 A file input to the model.
2916
2917 - `JsonValue; type "custom_tool_call_output"constant`
2918
2919 The type of the custom tool call output. Always `custom_tool_call_output`.
2920
2921 - `CUSTOM_TOOL_CALL_OUTPUT("custom_tool_call_output")`
2922
2923 - `Optional<String> id`
2924
2925 The unique ID of the custom tool call output in the OpenAI platform.
2926
2927 - `class ResponseCustomToolCall:`
2928
2929 A call to a custom tool created by the model.
2930
2931 - `String callId`
2932
2933 An identifier used to map this custom tool call to a tool call output.
2934
2935 - `String input`
2936
2937 The input for the custom tool call generated by the model.
2938
2939 - `String name`
2940
2941 The name of the custom tool being called.
2942
2943 - `JsonValue; type "custom_tool_call"constant`
2944
2945 The type of the custom tool call. Always `custom_tool_call`.
2946
2947 - `CUSTOM_TOOL_CALL("custom_tool_call")`
2948
2949 - `Optional<String> id`
2950
2951 The unique ID of the custom tool call in the OpenAI platform.
2952
2953 - `Optional<String> namespace`
2954
2955 The namespace of the custom tool being called.
2956
2957 - `JsonValue;`
2958
2959 - `JsonValue; type "compaction_trigger"constant`
2960
2961 The type of the item. Always `compaction_trigger`.
2962
2963 - `COMPACTION_TRIGGER("compaction_trigger")`
2964
2965 - `ItemReference`
2966
2967 - `String id`
2968
2969 The ID of the item to reference.
2970
2971 - `Optional<Type> type`
2972
2973 The type of item to reference. Always `item_reference`.
2974
2975 - `ITEM_REFERENCE("item_reference")`
2976
2977 - `Optional<Metadata> metadata`
2978
2979 Set of 16 key-value pairs that can be attached to an object. This can be
2980 useful for storing additional information about the object in a structured
2981 format, and querying for objects via API or the dashboard.
2982
2983 Keys are strings with a maximum length of 64 characters. Values are strings
2984 with a maximum length of 512 characters.
2985
2986 - `ResponsesModel model`
2987
2988 Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
2989 offers a wide range of models with different capabilities, performance
2990 characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
2991 to browse and compare available models.
2992
2993 - `String`
2994
2995 - `enum ChatModel:`
2996
2997 - `GPT_5_4("gpt-5.4")`
2998
2999 - `GPT_5_4_MINI("gpt-5.4-mini")`
3000
3001 - `GPT_5_4_NANO("gpt-5.4-nano")`
3002
3003 - `GPT_5_4_MINI_2026_03_17("gpt-5.4-mini-2026-03-17")`
3004
3005 - `GPT_5_4_NANO_2026_03_17("gpt-5.4-nano-2026-03-17")`
3006
3007 - `GPT_5_3_CHAT_LATEST("gpt-5.3-chat-latest")`
3008
3009 - `GPT_5_2("gpt-5.2")`
3010
3011 - `GPT_5_2_2025_12_11("gpt-5.2-2025-12-11")`
3012
3013 - `GPT_5_2_CHAT_LATEST("gpt-5.2-chat-latest")`
3014
3015 - `GPT_5_2_PRO("gpt-5.2-pro")`
3016
3017 - `GPT_5_2_PRO_2025_12_11("gpt-5.2-pro-2025-12-11")`
3018
3019 - `GPT_5_1("gpt-5.1")`
3020
3021 - `GPT_5_1_2025_11_13("gpt-5.1-2025-11-13")`
3022
3023 - `GPT_5_1_CODEX("gpt-5.1-codex")`
3024
3025 - `GPT_5_1_MINI("gpt-5.1-mini")`
3026
3027 - `GPT_5_1_CHAT_LATEST("gpt-5.1-chat-latest")`
3028
3029 - `GPT_5("gpt-5")`
3030
3031 - `GPT_5_MINI("gpt-5-mini")`
3032
3033 - `GPT_5_NANO("gpt-5-nano")`
3034
3035 - `GPT_5_2025_08_07("gpt-5-2025-08-07")`
3036
3037 - `GPT_5_MINI_2025_08_07("gpt-5-mini-2025-08-07")`
3038
3039 - `GPT_5_NANO_2025_08_07("gpt-5-nano-2025-08-07")`
3040
3041 - `GPT_5_CHAT_LATEST("gpt-5-chat-latest")`
3042
3043 - `GPT_4_1("gpt-4.1")`
3044
3045 - `GPT_4_1_MINI("gpt-4.1-mini")`
3046
3047 - `GPT_4_1_NANO("gpt-4.1-nano")`
3048
3049 - `GPT_4_1_2025_04_14("gpt-4.1-2025-04-14")`
3050
3051 - `GPT_4_1_MINI_2025_04_14("gpt-4.1-mini-2025-04-14")`
3052
3053 - `GPT_4_1_NANO_2025_04_14("gpt-4.1-nano-2025-04-14")`
3054
3055 - `O4_MINI("o4-mini")`
3056
3057 - `O4_MINI_2025_04_16("o4-mini-2025-04-16")`
3058
3059 - `O3("o3")`
3060
3061 - `O3_2025_04_16("o3-2025-04-16")`
3062
3063 - `O3_MINI("o3-mini")`
3064
3065 - `O3_MINI_2025_01_31("o3-mini-2025-01-31")`
3066
3067 - `O1("o1")`
3068
3069 - `O1_2024_12_17("o1-2024-12-17")`
3070
3071 - `O1_PREVIEW("o1-preview")`
3072
3073 - `O1_PREVIEW_2024_09_12("o1-preview-2024-09-12")`
3074
3075 - `O1_MINI("o1-mini")`
3076
3077 - `O1_MINI_2024_09_12("o1-mini-2024-09-12")`
3078
3079 - `GPT_4O("gpt-4o")`
3080
3081 - `GPT_4O_2024_11_20("gpt-4o-2024-11-20")`
3082
3083 - `GPT_4O_2024_08_06("gpt-4o-2024-08-06")`
3084
3085 - `GPT_4O_2024_05_13("gpt-4o-2024-05-13")`
3086
3087 - `GPT_4O_AUDIO_PREVIEW("gpt-4o-audio-preview")`
3088
3089 - `GPT_4O_AUDIO_PREVIEW_2024_10_01("gpt-4o-audio-preview-2024-10-01")`
3090
3091 - `GPT_4O_AUDIO_PREVIEW_2024_12_17("gpt-4o-audio-preview-2024-12-17")`
3092
3093 - `GPT_4O_AUDIO_PREVIEW_2025_06_03("gpt-4o-audio-preview-2025-06-03")`
3094
3095 - `GPT_4O_MINI_AUDIO_PREVIEW("gpt-4o-mini-audio-preview")`
3096
3097 - `GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17("gpt-4o-mini-audio-preview-2024-12-17")`
3098
3099 - `GPT_4O_SEARCH_PREVIEW("gpt-4o-search-preview")`
3100
3101 - `GPT_4O_MINI_SEARCH_PREVIEW("gpt-4o-mini-search-preview")`
3102
3103 - `GPT_4O_SEARCH_PREVIEW_2025_03_11("gpt-4o-search-preview-2025-03-11")`
3104
3105 - `GPT_4O_MINI_SEARCH_PREVIEW_2025_03_11("gpt-4o-mini-search-preview-2025-03-11")`
3106
3107 - `CHATGPT_4O_LATEST("chatgpt-4o-latest")`
3108
3109 - `CODEX_MINI_LATEST("codex-mini-latest")`
3110
3111 - `GPT_4O_MINI("gpt-4o-mini")`
3112
3113 - `GPT_4O_MINI_2024_07_18("gpt-4o-mini-2024-07-18")`
3114
3115 - `GPT_4_TURBO("gpt-4-turbo")`
3116
3117 - `GPT_4_TURBO_2024_04_09("gpt-4-turbo-2024-04-09")`
3118
3119 - `GPT_4_0125_PREVIEW("gpt-4-0125-preview")`
3120
3121 - `GPT_4_TURBO_PREVIEW("gpt-4-turbo-preview")`
3122
3123 - `GPT_4_1106_PREVIEW("gpt-4-1106-preview")`
3124
3125 - `GPT_4_VISION_PREVIEW("gpt-4-vision-preview")`
3126
3127 - `GPT_4("gpt-4")`
3128
3129 - `GPT_4_0314("gpt-4-0314")`
3130
3131 - `GPT_4_0613("gpt-4-0613")`
3132
3133 - `GPT_4_32K("gpt-4-32k")`
3134
3135 - `GPT_4_32K_0314("gpt-4-32k-0314")`
3136
3137 - `GPT_4_32K_0613("gpt-4-32k-0613")`
3138
3139 - `GPT_3_5_TURBO("gpt-3.5-turbo")`
3140
3141 - `GPT_3_5_TURBO_16K("gpt-3.5-turbo-16k")`
3142
3143 - `GPT_3_5_TURBO_0301("gpt-3.5-turbo-0301")`
3144
3145 - `GPT_3_5_TURBO_0613("gpt-3.5-turbo-0613")`
3146
3147 - `GPT_3_5_TURBO_1106("gpt-3.5-turbo-1106")`
3148
3149 - `GPT_3_5_TURBO_0125("gpt-3.5-turbo-0125")`
3150
3151 - `GPT_3_5_TURBO_16K_0613("gpt-3.5-turbo-16k-0613")`
3152
3153 - `ResponsesOnlyModel`
3154
3155 - `O1_PRO("o1-pro")`
3156
3157 - `O1_PRO_2025_03_19("o1-pro-2025-03-19")`
3158
3159 - `O3_PRO("o3-pro")`
3160
3161 - `O3_PRO_2025_06_10("o3-pro-2025-06-10")`
3162
3163 - `O3_DEEP_RESEARCH("o3-deep-research")`
3164
3165 - `O3_DEEP_RESEARCH_2025_06_26("o3-deep-research-2025-06-26")`
3166
3167 - `O4_MINI_DEEP_RESEARCH("o4-mini-deep-research")`
3168
3169 - `O4_MINI_DEEP_RESEARCH_2025_06_26("o4-mini-deep-research-2025-06-26")`
3170
3171 - `COMPUTER_USE_PREVIEW("computer-use-preview")`
3172
3173 - `COMPUTER_USE_PREVIEW_2025_03_11("computer-use-preview-2025-03-11")`
3174
3175 - `GPT_5_CODEX("gpt-5-codex")`
3176
3177 - `GPT_5_PRO("gpt-5-pro")`
3178
3179 - `GPT_5_PRO_2025_10_06("gpt-5-pro-2025-10-06")`
3180
3181 - `GPT_5_1_CODEX_MAX("gpt-5.1-codex-max")`
3182
3183 - `JsonValue; object_ "response"constant`
3184
3185 The object type of this resource - always set to `response`.
3186
3187 - `RESPONSE("response")`
3188
3189 - `List<ResponseOutputItem> output`
3190
3191 An array of content items generated by the model.
3192
3193 - The length and order of items in the `output` array is dependent
3194 on the model's response.
3195 - Rather than accessing the first item in the `output` array and
3196 assuming it's an `assistant` message with the content generated by
3197 the model, you might consider using the `output_text` property where
3198 supported in SDKs.
3199
3200 - `class ResponseOutputMessage:`
3201
3202 An output message from the model.
3203
3204 - `class ResponseFileSearchToolCall:`
3205
3206 The results of a file search tool call. See the
3207 [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.
3208
3209 - `class ResponseFunctionToolCall:`
3210
3211 A tool call to run a function. See the
3212 [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.
3213
3214 - `class ResponseFunctionToolCallOutputItem:`
3215
3216 - `String id`
3217
3218 The unique ID of the function call tool output.
3219
3220 - `String callId`
3221
3222 The unique ID of the function tool call generated by the model.
3223
3224 - `Output output`
3225
3226 The output from the function call generated by your code.
3227 Can be a string or an list of output content.
3228
3229 - `String`
3230
3231 - `List<FunctionAndCustomToolCallOutput>`
3232
3233 - `class ResponseInputText:`
3234
3235 A text input to the model.
3236
3237 - `class ResponseInputImage:`
3238
3239 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
3240
3241 - `class ResponseInputFile:`
3242
3243 A file input to the model.
3244
3245 - `Status status`
3246
3247 The status of the item. One of `in_progress`, `completed`, or
3248 `incomplete`. Populated when items are returned via API.
3249
3250 - `IN_PROGRESS("in_progress")`
3251
3252 - `COMPLETED("completed")`
3253
3254 - `INCOMPLETE("incomplete")`
3255
3256 - `JsonValue; type "function_call_output"constant`
3257
3258 The type of the function tool call output. Always `function_call_output`.
3259
3260 - `FUNCTION_CALL_OUTPUT("function_call_output")`
3261
3262 - `Optional<String> createdBy`
3263
3264 The identifier of the actor that created the item.
3265
3266 - `class ResponseFunctionWebSearch:`
3267
3268 The results of a web search tool call. See the
3269 [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.
3270
3271 - `class ResponseComputerToolCall:`
3272
3273 A tool call to a computer use tool. See the
3274 [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.
3275
3276 - `class ResponseComputerToolCallOutputItem:`
3277
3278 - `String id`
3279
3280 The unique ID of the computer call tool output.
3281
3282 - `String callId`
3283
3284 The ID of the computer tool call that produced the output.
3285
3286 - `ResponseComputerToolCallOutputScreenshot output`
3287
3288 A computer screenshot image used with the computer use tool.
3289
3290 - `Status status`
3291
3292 The status of the message input. One of `in_progress`, `completed`, or
3293 `incomplete`. Populated when input items are returned via API.
3294
3295 - `COMPLETED("completed")`
3296
3297 - `INCOMPLETE("incomplete")`
3298
3299 - `FAILED("failed")`
3300
3301 - `IN_PROGRESS("in_progress")`
3302
3303 - `JsonValue; type "computer_call_output"constant`
3304
3305 The type of the computer tool call output. Always `computer_call_output`.
3306
3307 - `COMPUTER_CALL_OUTPUT("computer_call_output")`
3308
3309 - `Optional<List<AcknowledgedSafetyCheck>> acknowledgedSafetyChecks`
3310
3311 The safety checks reported by the API that have been acknowledged by the
3312 developer.
3313
3314 - `String id`
3315
3316 The ID of the pending safety check.
3317
3318 - `Optional<String> code`
3319
3320 The type of the pending safety check.
3321
3322 - `Optional<String> message`
3323
3324 Details about the pending safety check.
3325
3326 - `Optional<String> createdBy`
3327
3328 The identifier of the actor that created the item.
3329
3330 - `class ResponseReasoningItem:`
3331
3332 A description of the chain of thought used by a reasoning model while generating
3333 a response. Be sure to include these items in your `input` to the Responses API
3334 for subsequent turns of a conversation if you are manually
3335 [managing context](https://platform.openai.com/docs/guides/conversation-state).
3336
3337 - `class ResponseToolSearchCall:`
3338
3339 - `String id`
3340
3341 The unique ID of the tool search call item.
3342
3343 - `JsonValue arguments`
3344
3345 Arguments used for the tool search call.
3346
3347 - `Optional<String> callId`
3348
3349 The unique ID of the tool search call generated by the model.
3350
3351 - `Execution execution`
3352
3353 Whether tool search was executed by the server or by the client.
3354
3355 - `SERVER("server")`
3356
3357 - `CLIENT("client")`
3358
3359 - `Status status`
3360
3361 The status of the tool search call item that was recorded.
3362
3363 - `IN_PROGRESS("in_progress")`
3364
3365 - `COMPLETED("completed")`
3366
3367 - `INCOMPLETE("incomplete")`
3368
3369 - `JsonValue; type "tool_search_call"constant`
3370
3371 The type of the item. Always `tool_search_call`.
3372
3373 - `TOOL_SEARCH_CALL("tool_search_call")`
3374
3375 - `Optional<String> createdBy`
3376
3377 The identifier of the actor that created the item.
3378
3379 - `class ResponseToolSearchOutputItem:`
3380
3381 - `String id`
3382
3383 The unique ID of the tool search output item.
3384
3385 - `Optional<String> callId`
3386
3387 The unique ID of the tool search call generated by the model.
3388
3389 - `Execution execution`
3390
3391 Whether tool search was executed by the server or by the client.
3392
3393 - `SERVER("server")`
3394
3395 - `CLIENT("client")`
3396
3397 - `Status status`
3398
3399 The status of the tool search output item that was recorded.
3400
3401 - `IN_PROGRESS("in_progress")`
3402
3403 - `COMPLETED("completed")`
3404
3405 - `INCOMPLETE("incomplete")`
3406
3407 - `List<Tool> tools`
3408
3409 The loaded tool definitions returned by tool search.
3410
3411 - `class FunctionTool:`
3412
3413 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).
3414
3415 - `class FileSearchTool:`
3416
3417 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).
3418
3419 - `class ComputerTool:`
3420
3421 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
3422
3423 - `class ComputerUsePreviewTool:`
3424
3425 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
3426
3427 - `class WebSearchTool:`
3428
3429 Search the Internet for sources related to the prompt. Learn more about the
3430 [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
3431
3432 - `Mcp`
3433
3434 - `CodeInterpreter`
3435
3436 - `ImageGeneration`
3437
3438 - `JsonValue;`
3439
3440 - `class FunctionShellTool:`
3441
3442 A tool that allows the model to execute shell commands.
3443
3444 - `class CustomTool:`
3445
3446 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)
3447
3448 - `class NamespaceTool:`
3449
3450 Groups function/custom tools under a shared namespace.
3451
3452 - `class ToolSearchTool:`
3453
3454 Hosted or BYOT tool search configuration for deferred tools.
3455
3456 - `class WebSearchPreviewTool:`
3457
3458 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).
3459
3460 - `class ApplyPatchTool:`
3461
3462 Allows the assistant to create, delete, or update files using unified diffs.
3463
3464 - `JsonValue; type "tool_search_output"constant`
3465
3466 The type of the item. Always `tool_search_output`.
3467
3468 - `TOOL_SEARCH_OUTPUT("tool_search_output")`
3469
3470 - `Optional<String> createdBy`
3471
3472 The identifier of the actor that created the item.
3473
3474 - `class ResponseCompactionItem:`
3475
3476 A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
3477
3478 - `String id`
3479
3480 The unique ID of the compaction item.
3481
3482 - `String encryptedContent`
3483
3484 The encrypted content that was produced by compaction.
3485
3486 - `JsonValue; type "compaction"constant`
3487
3488 The type of the item. Always `compaction`.
3489
3490 - `COMPACTION("compaction")`
3491
3492 - `Optional<String> createdBy`
3493
3494 The identifier of the actor that created the item.
3495
3496 - `ImageGenerationCall`
3497
3498 - `String id`
3499
3500 The unique ID of the image generation call.
3501
3502 - `Optional<String> result`
3503
3504 The generated image encoded in base64.
3505
3506 - `Status status`
3507
3508 The status of the image generation call.
3509
3510 - `IN_PROGRESS("in_progress")`
3511
3512 - `COMPLETED("completed")`
3513
3514 - `GENERATING("generating")`
3515
3516 - `FAILED("failed")`
3517
3518 - `JsonValue; type "image_generation_call"constant`
3519
3520 The type of the image generation call. Always `image_generation_call`.
3521
3522 - `IMAGE_GENERATION_CALL("image_generation_call")`
3523
3524 - `class ResponseCodeInterpreterToolCall:`
3525
3526 A tool call to run code.
3527
3528 - `LocalShellCall`
3529
3530 - `String id`
3531
3532 The unique ID of the local shell call.
3533
3534 - `Action action`
3535
3536 Execute a shell command on the server.
3537
3538 - `List<String> command`
3539
3540 The command to run.
3541
3542 - `Env env`
3543
3544 Environment variables to set for the command.
3545
3546 - `JsonValue; type "exec"constant`
3547
3548 The type of the local shell action. Always `exec`.
3549
3550 - `EXEC("exec")`
3551
3552 - `Optional<Long> timeoutMs`
3553
3554 Optional timeout in milliseconds for the command.
3555
3556 - `Optional<String> user`
3557
3558 Optional user to run the command as.
3559
3560 - `Optional<String> workingDirectory`
3561
3562 Optional working directory to run the command in.
3563
3564 - `String callId`
3565
3566 The unique ID of the local shell tool call generated by the model.
3567
3568 - `Status status`
3569
3570 The status of the local shell call.
3571
3572 - `IN_PROGRESS("in_progress")`
3573
3574 - `COMPLETED("completed")`
3575
3576 - `INCOMPLETE("incomplete")`
3577
3578 - `JsonValue; type "local_shell_call"constant`
3579
3580 The type of the local shell call. Always `local_shell_call`.
3581
3582 - `LOCAL_SHELL_CALL("local_shell_call")`
3583
3584 - `LocalShellCallOutput`
3585
3586 - `String id`
3587
3588 The unique ID of the local shell tool call generated by the model.
3589
3590 - `String output`
3591
3592 A JSON string of the output of the local shell tool call.
3593
3594 - `JsonValue; type "local_shell_call_output"constant`
3595
3596 The type of the local shell tool call output. Always `local_shell_call_output`.
3597
3598 - `LOCAL_SHELL_CALL_OUTPUT("local_shell_call_output")`
3599
3600 - `Optional<Status> status`
3601
3602 The status of the item. One of `in_progress`, `completed`, or `incomplete`.
3603
3604 - `IN_PROGRESS("in_progress")`
3605
3606 - `COMPLETED("completed")`
3607
3608 - `INCOMPLETE("incomplete")`
3609
3610 - `class ResponseFunctionShellToolCall:`
3611
3612 A tool call that executes one or more shell commands in a managed environment.
3613
3614 - `String id`
3615
3616 The unique ID of the shell tool call. Populated when this item is returned via API.
3617
3618 - `Action action`
3619
3620 The shell commands and limits that describe how to run the tool call.
3621
3622 - `List<String> commands`
3623
3624 - `Optional<Long> maxOutputLength`
3625
3626 Optional maximum number of characters to return from each command.
3627
3628 - `Optional<Long> timeoutMs`
3629
3630 Optional timeout in milliseconds for the commands.
3631
3632 - `String callId`
3633
3634 The unique ID of the shell tool call generated by the model.
3635
3636 - `Optional<Environment> environment`
3637
3638 Represents the use of a local environment to perform shell actions.
3639
3640 - `class ResponseLocalEnvironment:`
3641
3642 Represents the use of a local environment to perform shell actions.
3643
3644 - `JsonValue; type "local"constant`
3645
3646 The environment type. Always `local`.
3647
3648 - `LOCAL("local")`
3649
3650 - `class ResponseContainerReference:`
3651
3652 Represents a container created with /v1/containers.
3653
3654 - `String containerId`
3655
3656 - `JsonValue; type "container_reference"constant`
3657
3658 The environment type. Always `container_reference`.
3659
3660 - `CONTAINER_REFERENCE("container_reference")`
3661
3662 - `Status status`
3663
3664 The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
3665
3666 - `IN_PROGRESS("in_progress")`
3667
3668 - `COMPLETED("completed")`
3669
3670 - `INCOMPLETE("incomplete")`
3671
3672 - `JsonValue; type "shell_call"constant`
3673
3674 The type of the item. Always `shell_call`.
3675
3676 - `SHELL_CALL("shell_call")`
3677
3678 - `Optional<String> createdBy`
3679
3680 The ID of the entity that created this tool call.
3681
3682 - `class ResponseFunctionShellToolCallOutput:`
3683
3684 The output of a shell tool call that was emitted.
3685
3686 - `String id`
3687
3688 The unique ID of the shell call output. Populated when this item is returned via API.
3689
3690 - `String callId`
3691
3692 The unique ID of the shell tool call generated by the model.
3693
3694 - `Optional<Long> maxOutputLength`
3695
3696 The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
3697
3698 - `List<Output> output`
3699
3700 An array of shell call output contents
3701
3702 - `Outcome outcome`
3703
3704 Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
3705
3706 - `JsonValue;`
3707
3708 - `JsonValue; type "timeout"constant`
3709
3710 The outcome type. Always `timeout`.
3711
3712 - `TIMEOUT("timeout")`
3713
3714 - `class Exit:`
3715
3716 Indicates that the shell commands finished and returned an exit code.
3717
3718 - `long exitCode`
3719
3720 Exit code from the shell process.
3721
3722 - `JsonValue; type "exit"constant`
3723
3724 The outcome type. Always `exit`.
3725
3726 - `EXIT("exit")`
3727
3728 - `String stderr`
3729
3730 The standard error output that was captured.
3731
3732 - `String stdout`
3733
3734 The standard output that was captured.
3735
3736 - `Optional<String> createdBy`
3737
3738 The identifier of the actor that created the item.
3739
3740 - `Status status`
3741
3742 The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
3743
3744 - `IN_PROGRESS("in_progress")`
3745
3746 - `COMPLETED("completed")`
3747
3748 - `INCOMPLETE("incomplete")`
3749
3750 - `JsonValue; type "shell_call_output"constant`
3751
3752 The type of the shell call output. Always `shell_call_output`.
3753
3754 - `SHELL_CALL_OUTPUT("shell_call_output")`
3755
3756 - `Optional<String> createdBy`
3757
3758 The identifier of the actor that created the item.
3759
3760 - `class ResponseApplyPatchToolCall:`
3761
3762 A tool call that applies file diffs by creating, deleting, or updating files.
3763
3764 - `String id`
3765
3766 The unique ID of the apply patch tool call. Populated when this item is returned via API.
3767
3768 - `String callId`
3769
3770 The unique ID of the apply patch tool call generated by the model.
3771
3772 - `Operation operation`
3773
3774 One of the create_file, delete_file, or update_file operations applied via apply_patch.
3775
3776 - `class CreateFile:`
3777
3778 Instruction describing how to create a file via the apply_patch tool.
3779
3780 - `String diff`
3781
3782 Diff to apply.
3783
3784 - `String path`
3785
3786 Path of the file to create.
3787
3788 - `JsonValue; type "create_file"constant`
3789
3790 Create a new file with the provided diff.
3791
3792 - `CREATE_FILE("create_file")`
3793
3794 - `class DeleteFile:`
3795
3796 Instruction describing how to delete a file via the apply_patch tool.
3797
3798 - `String path`
3799
3800 Path of the file to delete.
3801
3802 - `JsonValue; type "delete_file"constant`
3803
3804 Delete the specified file.
3805
3806 - `DELETE_FILE("delete_file")`
3807
3808 - `class UpdateFile:`
3809
3810 Instruction describing how to update a file via the apply_patch tool.
3811
3812 - `String diff`
3813
3814 Diff to apply.
3815
3816 - `String path`
3817
3818 Path of the file to update.
3819
3820 - `JsonValue; type "update_file"constant`
3821
3822 Update an existing file with the provided diff.
3823
3824 - `UPDATE_FILE("update_file")`
3825
3826 - `Status status`
3827
3828 The status of the apply patch tool call. One of `in_progress` or `completed`.
3829
3830 - `IN_PROGRESS("in_progress")`
3831
3832 - `COMPLETED("completed")`
3833
3834 - `JsonValue; type "apply_patch_call"constant`
3835
3836 The type of the item. Always `apply_patch_call`.
3837
3838 - `APPLY_PATCH_CALL("apply_patch_call")`
3839
3840 - `Optional<String> createdBy`
3841
3842 The ID of the entity that created this tool call.
3843
3844 - `class ResponseApplyPatchToolCallOutput:`
3845
3846 The output emitted by an apply patch tool call.
3847
3848 - `String id`
3849
3850 The unique ID of the apply patch tool call output. Populated when this item is returned via API.
3851
3852 - `String callId`
3853
3854 The unique ID of the apply patch tool call generated by the model.
3855
3856 - `Status status`
3857
3858 The status of the apply patch tool call output. One of `completed` or `failed`.
3859
3860 - `COMPLETED("completed")`
3861
3862 - `FAILED("failed")`
3863
3864 - `JsonValue; type "apply_patch_call_output"constant`
3865
3866 The type of the item. Always `apply_patch_call_output`.
3867
3868 - `APPLY_PATCH_CALL_OUTPUT("apply_patch_call_output")`
3869
3870 - `Optional<String> createdBy`
3871
3872 The ID of the entity that created this tool call output.
3873
3874 - `Optional<String> output`
3875
3876 Optional textual output returned by the apply patch tool.
3877
3878 - `McpCall`
3879
3880 - `String id`
3881
3882 The unique ID of the tool call.
3883
3884 - `String arguments`
3885
3886 A JSON string of the arguments passed to the tool.
3887
3888 - `String name`
3889
3890 The name of the tool that was run.
3891
3892 - `String serverLabel`
3893
3894 The label of the MCP server running the tool.
3895
3896 - `JsonValue; type "mcp_call"constant`
3897
3898 The type of the item. Always `mcp_call`.
3899
3900 - `MCP_CALL("mcp_call")`
3901
3902 - `Optional<String> approvalRequestId`
3903
3904 Unique identifier for the MCP tool call approval request.
3905 Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.
3906
3907 - `Optional<String> error`
3908
3909 The error from the tool call, if any.
3910
3911 - `Optional<String> output`
3912
3913 The output from the tool call.
3914
3915 - `Optional<Status> status`
3916
3917 The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
3918
3919 - `IN_PROGRESS("in_progress")`
3920
3921 - `COMPLETED("completed")`
3922
3923 - `INCOMPLETE("incomplete")`
3924
3925 - `CALLING("calling")`
3926
3927 - `FAILED("failed")`
3928
3929 - `McpListTools`
3930
3931 - `String id`
3932
3933 The unique ID of the list.
3934
3935 - `String serverLabel`
3936
3937 The label of the MCP server.
3938
3939 - `List<Tool> tools`
3940
3941 The tools available on the server.
3942
3943 - `JsonValue inputSchema`
3944
3945 The JSON schema describing the tool's input.
3946
3947 - `String name`
3948
3949 The name of the tool.
3950
3951 - `Optional<JsonValue> annotations`
3952
3953 Additional annotations about the tool.
3954
3955 - `Optional<String> description`
3956
3957 The description of the tool.
3958
3959 - `JsonValue; type "mcp_list_tools"constant`
3960
3961 The type of the item. Always `mcp_list_tools`.
3962
3963 - `MCP_LIST_TOOLS("mcp_list_tools")`
3964
3965 - `Optional<String> error`
3966
3967 Error message if the server could not list tools.
3968
3969 - `McpApprovalRequest`
3970
3971 - `String id`
3972
3973 The unique ID of the approval request.
3974
3975 - `String arguments`
3976
3977 A JSON string of arguments for the tool.
3978
3979 - `String name`
3980
3981 The name of the tool to run.
3982
3983 - `String serverLabel`
3984
3985 The label of the MCP server making the request.
3986
3987 - `JsonValue; type "mcp_approval_request"constant`
3988
3989 The type of the item. Always `mcp_approval_request`.
3990
3991 - `MCP_APPROVAL_REQUEST("mcp_approval_request")`
3992
3993 - `McpApprovalResponse`
3994
3995 - `String id`
3996
3997 The unique ID of the approval response
3998
3999 - `String approvalRequestId`
4000
4001 The ID of the approval request being answered.
4002
4003 - `boolean approve`
4004
4005 Whether the request was approved.
4006
4007 - `JsonValue; type "mcp_approval_response"constant`
4008
4009 The type of the item. Always `mcp_approval_response`.
4010
4011 - `MCP_APPROVAL_RESPONSE("mcp_approval_response")`
4012
4013 - `Optional<String> reason`
4014
4015 Optional reason for the decision.
4016
4017 - `class ResponseCustomToolCall:`
4018
4019 A call to a custom tool created by the model.
4020
4021 - `class ResponseCustomToolCallOutputItem:`
4022
4023 The output of a custom tool call from your code, being sent back to the model.
4024
4025 - `String id`
4026
4027 The unique ID of the custom tool call output item.
4028
4029 - `Status status`
4030
4031 The status of the item. One of `in_progress`, `completed`, or
4032 `incomplete`. Populated when items are returned via API.
4033
4034 - `IN_PROGRESS("in_progress")`
4035
4036 - `COMPLETED("completed")`
4037
4038 - `INCOMPLETE("incomplete")`
4039
4040 - `Optional<String> createdBy`
4041
4042 The identifier of the actor that created the item.
4043
4044 - `boolean parallelToolCalls`
4045
4046 Whether to allow the model to run tool calls in parallel.
4047
4048 - `Optional<Double> temperature`
4049
4050 What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
4051 We generally recommend altering this or `top_p` but not both.
4052
4053 - `ToolChoice toolChoice`
4054
4055 How the model should select which tool (or tools) to use when generating
4056 a response. See the `tools` parameter to see how to specify which tools
4057 the model can call.
4058
4059 - `enum ToolChoiceOptions:`
4060
4061 Controls which (if any) tool is called by the model.
4062
4063 `none` means the model will not call any tool and instead generates a message.
4064
4065 `auto` means the model can pick between generating a message or calling one or
4066 more tools.
4067
4068 `required` means the model must call one or more tools.
4069
4070 - `NONE("none")`
4071
4072 - `AUTO("auto")`
4073
4074 - `REQUIRED("required")`
4075
4076 - `class ToolChoiceAllowed:`
4077
4078 Constrains the tools available to the model to a pre-defined set.
4079
4080 - `Mode mode`
4081
4082 Constrains the tools available to the model to a pre-defined set.
4083
4084 `auto` allows the model to pick from among the allowed tools and generate a
4085 message.
4086
4087 `required` requires the model to call one or more of the allowed tools.
4088
4089 - `AUTO("auto")`
4090
4091 - `REQUIRED("required")`
4092
4093 - `List<Tool> tools`
4094
4095 A list of tool definitions that the model should be allowed to call.
4096
4097 For the Responses API, the list of tool definitions might look like:
4098
4099 ```json
4100 [
4101 { "type": "function", "name": "get_weather" },
4102 { "type": "mcp", "server_label": "deepwiki" },
4103 { "type": "image_generation" }
4104 ]
4105 ```
4106
4107 - `JsonValue; type "allowed_tools"constant`
4108
4109 Allowed tool configuration type. Always `allowed_tools`.
4110
4111 - `ALLOWED_TOOLS("allowed_tools")`
4112
4113 - `class ToolChoiceTypes:`
4114
4115 Indicates that the model should use a built-in tool to generate a response.
4116 [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
4117
4118 - `Type type`
4119
4120 The type of hosted tool the model should to use. Learn more about
4121 [built-in tools](https://platform.openai.com/docs/guides/tools).
4122
4123 Allowed values are:
4124
4125 - `file_search`
4126 - `web_search_preview`
4127 - `computer`
4128 - `computer_use_preview`
4129 - `computer_use`
4130 - `code_interpreter`
4131 - `image_generation`
4132
4133 - `FILE_SEARCH("file_search")`
4134
4135 - `WEB_SEARCH_PREVIEW("web_search_preview")`
4136
4137 - `COMPUTER("computer")`
4138
4139 - `COMPUTER_USE_PREVIEW("computer_use_preview")`
4140
4141 - `COMPUTER_USE("computer_use")`
4142
4143 - `WEB_SEARCH_PREVIEW_2025_03_11("web_search_preview_2025_03_11")`
4144
4145 - `IMAGE_GENERATION("image_generation")`
4146
4147 - `CODE_INTERPRETER("code_interpreter")`
4148
4149 - `class ToolChoiceFunction:`
4150
4151 Use this option to force the model to call a specific function.
4152
4153 - `String name`
4154
4155 The name of the function to call.
4156
4157 - `JsonValue; type "function"constant`
4158
4159 For function calling, the type is always `function`.
4160
4161 - `FUNCTION("function")`
4162
4163 - `class ToolChoiceMcp:`
4164
4165 Use this option to force the model to call a specific tool on a remote MCP server.
4166
4167 - `String serverLabel`
4168
4169 The label of the MCP server to use.
4170
4171 - `JsonValue; type "mcp"constant`
4172
4173 For MCP tools, the type is always `mcp`.
4174
4175 - `MCP("mcp")`
4176
4177 - `Optional<String> name`
4178
4179 The name of the tool to call on the server.
4180
4181 - `class ToolChoiceCustom:`
4182
4183 Use this option to force the model to call a specific custom tool.
4184
4185 - `String name`
4186
4187 The name of the custom tool to call.
4188
4189 - `JsonValue; type "custom"constant`
4190
4191 For custom tool calling, the type is always `custom`.
4192
4193 - `CUSTOM("custom")`
4194
4195 - `class ToolChoiceApplyPatch:`
4196
4197 Forces the model to call the apply_patch tool when executing a tool call.
4198
4199 - `JsonValue; type "apply_patch"constant`
4200
4201 The tool to call. Always `apply_patch`.
4202
4203 - `APPLY_PATCH("apply_patch")`
4204
4205 - `class ToolChoiceShell:`
4206
4207 Forces the model to call the shell tool when a tool call is required.
4208
4209 - `JsonValue; type "shell"constant`
4210
4211 The tool to call. Always `shell`.
4212
4213 - `SHELL("shell")`
4214
4215 - `List<Tool> tools`
4216
4217 An array of tools the model may call while generating a response. You
4218 can specify which tool to use by setting the `tool_choice` parameter.
4219
4220 We support the following categories of tools:
4221
4222 - **Built-in tools**: Tools that are provided by OpenAI that extend the
4223 model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search)
4224 or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about
4225 [built-in tools](https://platform.openai.com/docs/guides/tools).
4226 - **MCP Tools**: Integrations with third-party systems via custom MCP servers
4227 or predefined connectors such as Google Drive and SharePoint. Learn more about
4228 [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).
4229 - **Function calls (custom tools)**: Functions that are defined by you,
4230 enabling the model to call your own code with strongly typed arguments
4231 and outputs. Learn more about
4232 [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use
4233 custom tools to call your own code.
4234
4235 - `class FunctionTool:`
4236
4237 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).
4238
4239 - `class FileSearchTool:`
4240
4241 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).
4242
4243 - `class ComputerTool:`
4244
4245 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
4246
4247 - `class ComputerUsePreviewTool:`
4248
4249 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
4250
4251 - `class WebSearchTool:`
4252
4253 Search the Internet for sources related to the prompt. Learn more about the
4254 [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
4255
4256 - `Mcp`
4257
4258 - `CodeInterpreter`
4259
4260 - `ImageGeneration`
4261
4262 - `JsonValue;`
4263
4264 - `class FunctionShellTool:`
4265
4266 A tool that allows the model to execute shell commands.
4267
4268 - `class CustomTool:`
4269
4270 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)
4271
4272 - `class NamespaceTool:`
4273
4274 Groups function/custom tools under a shared namespace.
4275
4276 - `class ToolSearchTool:`
4277
4278 Hosted or BYOT tool search configuration for deferred tools.
4279
4280 - `class WebSearchPreviewTool:`
4281
4282 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).
4283
4284 - `class ApplyPatchTool:`
4285
4286 Allows the assistant to create, delete, or update files using unified diffs.
4287
4288 - `Optional<Double> topP`
4289
4290 An alternative to sampling with temperature, called nucleus sampling,
4291 where the model considers the results of the tokens with top_p probability
4292 mass. So 0.1 means only the tokens comprising the top 10% probability mass
4293 are considered.
4294
4295 We generally recommend altering this or `temperature` but not both.
4296
4297 - `Optional<Boolean> background`
4298
4299 Whether to run the model response in the background.
4300 [Learn more](https://platform.openai.com/docs/guides/background).
4301
4302 - `Optional<Double> completedAt`
4303
4304 Unix timestamp (in seconds) of when this Response was completed.
4305 Only present when the status is `completed`.
4306
4307 - `Optional<Conversation> conversation`
4308
4309 The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
4310
4311 - `String id`
4312
4313 The unique ID of the conversation that this response was associated with.
4314
4315 - `Optional<Long> maxOutputTokens`
4316
4317 An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
4318
4319 - `Optional<Long> maxToolCalls`
4320
4321 The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
4322
4323 - `Optional<String> previousResponseId`
4324
4325 The unique ID of the previous response to the model. Use this to
4326 create multi-turn conversations. Learn more about
4327 [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`.
4328
4329 - `Optional<ResponsePrompt> prompt`
4330
4331 Reference to a prompt template and its variables.
4332 [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
4333
4334 - `String id`
4335
4336 The unique identifier of the prompt template to use.
4337
4338 - `Optional<Variables> variables`
4339
4340 Optional map of values to substitute in for variables in your
4341 prompt. The substitution values can either be strings, or other
4342 Response input types like images or files.
4343
4344 - `String`
4345
4346 - `class ResponseInputText:`
4347
4348 A text input to the model.
4349
4350 - `class ResponseInputImage:`
4351
4352 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
4353
4354 - `class ResponseInputFile:`
4355
4356 A file input to the model.
4357
4358 - `Optional<String> version`
4359
4360 Optional version of the prompt template.
4361
4362 - `Optional<String> promptCacheKey`
4363
4364 Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
4365
4366 - `Optional<PromptCacheRetention> promptCacheRetention`
4367
4368 The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
4369
4370 - `IN_MEMORY("in_memory")`
4371
4372 - `_24H("24h")`
4373
4374 - `Optional<Reasoning> reasoning`
4375
4376 **gpt-5 and o-series models only**
4377
4378 Configuration options for
4379 [reasoning models](https://platform.openai.com/docs/guides/reasoning).
4380
4381 - `Optional<ReasoningEffort> effort`
4382
4383 Constrains effort on reasoning for
4384 [reasoning models](https://platform.openai.com/docs/guides/reasoning).
4385 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing
4386 reasoning effort can result in faster responses and fewer tokens used
4387 on reasoning in a response.
4388
4389 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
4390 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
4391 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
4392 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
4393
4394 - `NONE("none")`
4395
4396 - `MINIMAL("minimal")`
4397
4398 - `LOW("low")`
4399
4400 - `MEDIUM("medium")`
4401
4402 - `HIGH("high")`
4403
4404 - `XHIGH("xhigh")`
4405
4406 - `Optional<GenerateSummary> generateSummary`
4407
4408 **Deprecated:** use `summary` instead.
4409
4410 A summary of the reasoning performed by the model. This can be
4411 useful for debugging and understanding the model's reasoning process.
4412 One of `auto`, `concise`, or `detailed`.
4413
4414 - `AUTO("auto")`
4415
4416 - `CONCISE("concise")`
4417
4418 - `DETAILED("detailed")`
4419
4420 - `Optional<Summary> summary`
4421
4422 A summary of the reasoning performed by the model. This can be
4423 useful for debugging and understanding the model's reasoning process.
4424 One of `auto`, `concise`, or `detailed`.
4425
4426 `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.
4427
4428 - `AUTO("auto")`
4429
4430 - `CONCISE("concise")`
4431
4432 - `DETAILED("detailed")`
4433
4434 - `Optional<String> safetyIdentifier`
4435
4436 A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.
4437 The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
4438
4439 - `Optional<ServiceTier> serviceTier`
4440
4441 Specifies the processing type used for serving the request.
4442
4443 - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
4444 - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
4445 - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.
4446 - When not set, the default behavior is 'auto'.
4447
4448 When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.
4449
4450 - `AUTO("auto")`
4451
4452 - `DEFAULT("default")`
4453
4454 - `FLEX("flex")`
4455
4456 - `SCALE("scale")`
4457
4458 - `PRIORITY("priority")`
4459
4460 - `Optional<ResponseStatus> status`
4461
4462 The status of the response generation. One of `completed`, `failed`,
4463 `in_progress`, `cancelled`, `queued`, or `incomplete`.
4464
4465 - `COMPLETED("completed")`
4466
4467 - `FAILED("failed")`
4468
4469 - `IN_PROGRESS("in_progress")`
4470
4471 - `CANCELLED("cancelled")`
4472
4473 - `QUEUED("queued")`
4474
4475 - `INCOMPLETE("incomplete")`
4476
4477 - `Optional<ResponseTextConfig> text`
4478
4479 Configuration options for a text response from the model. Can be plain
4480 text or structured JSON data. Learn more:
4481
4482 - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
4483 - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
4484
4485 - `Optional<ResponseFormatTextConfig> format`
4486
4487 An object specifying the format that the model must output.
4488
4489 Configuring `{ "type": "json_schema" }` enables Structured Outputs,
4490 which ensures the model will match your supplied JSON schema. Learn more in the
4491 [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
4492
4493 The default format is `{ "type": "text" }` with no additional options.
4494
4495 **Not recommended for gpt-4o and newer models:**
4496
4497 Setting to `{ "type": "json_object" }` enables the older JSON mode, which
4498 ensures the message the model generates is valid JSON. Using `json_schema`
4499 is preferred for models that support it.
4500
4501 - `class ResponseFormatText:`
4502
4503 Default response format. Used to generate text responses.
4504
4505 - `JsonValue; type "text"constant`
4506
4507 The type of response format being defined. Always `text`.
4508
4509 - `TEXT("text")`
4510
4511 - `class ResponseFormatTextJsonSchemaConfig:`
4512
4513 JSON Schema response format. Used to generate structured JSON responses.
4514 Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
4515
4516 - `String name`
4517
4518 The name of the response format. Must be a-z, A-Z, 0-9, or contain
4519 underscores and dashes, with a maximum length of 64.
4520
4521 - `Schema schema`
4522
4523 The schema for the response format, described as a JSON Schema object.
4524 Learn how to build JSON schemas [here](https://json-schema.org/).
4525
4526 - `JsonValue; type "json_schema"constant`
4527
4528 The type of response format being defined. Always `json_schema`.
4529
4530 - `JSON_SCHEMA("json_schema")`
4531
4532 - `Optional<String> description`
4533
4534 A description of what the response format is for, used by the model to
4535 determine how to respond in the format.
4536
4537 - `Optional<Boolean> strict`
4538
4539 Whether to enable strict schema adherence when generating the output.
4540 If set to true, the model will always follow the exact schema defined
4541 in the `schema` field. Only a subset of JSON Schema is supported when
4542 `strict` is `true`. To learn more, read the [Structured Outputs
4543 guide](https://platform.openai.com/docs/guides/structured-outputs).
4544
4545 - `class ResponseFormatJsonObject:`
4546
4547 JSON object response format. An older method of generating JSON responses.
4548 Using `json_schema` is recommended for models that support it. Note that the
4549 model will not generate JSON without a system or user message instructing it
4550 to do so.
4551
4552 - `JsonValue; type "json_object"constant`
4553
4554 The type of response format being defined. Always `json_object`.
4555
4556 - `JSON_OBJECT("json_object")`
4557
4558 - `Optional<Verbosity> verbosity`
4559
4560 Constrains the verbosity of the model's response. Lower values will result in
4561 more concise responses, while higher values will result in more verbose responses.
4562 Currently supported values are `low`, `medium`, and `high`.
4563
4564 - `LOW("low")`
4565
4566 - `MEDIUM("medium")`
4567
4568 - `HIGH("high")`
4569
4570 - `Optional<Long> topLogprobs`
4571
4572 An integer between 0 and 20 specifying the maximum number of most likely
4573 tokens to return at each token position, each with an associated log
4574 probability. In some cases, the number of returned tokens may be fewer than
4575 requested.
4576
4577 - `Optional<Truncation> truncation`
4578
4579 The truncation strategy to use for the model response.
4580
4581 - `auto`: If the input to this Response exceeds
4582 the model's context window size, the model will truncate the
4583 response to fit the context window by dropping items from the beginning of the conversation.
4584 - `disabled` (default): If the input size will exceed the context window
4585 size for a model, the request will fail with a 400 error.
4586
4587 - `AUTO("auto")`
4588
4589 - `DISABLED("disabled")`
4590
4591 - `Optional<ResponseUsage> usage`
4592
4593 Represents token usage details including input tokens, output tokens,
4594 a breakdown of output tokens, and the total tokens used.
4595
4596 - `long inputTokens`
4597
4598 The number of input tokens.
4599
4600 - `InputTokensDetails inputTokensDetails`
4601
4602 A detailed breakdown of the input tokens.
4603
4604 - `long cachedTokens`
4605
4606 The number of tokens that were retrieved from the cache.
4607 [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).
4608
4609 - `long outputTokens`
4610
4611 The number of output tokens.
4612
4613 - `OutputTokensDetails outputTokensDetails`
4614
4615 A detailed breakdown of the output tokens.
4616
4617 - `long reasoningTokens`
4618
4619 The number of reasoning tokens.
4620
4621 - `long totalTokens`
4622
4623 The total number of tokens used.
4624
4625 - `Optional<String> user`
4626
4627 This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.
4628 A stable identifier for your end-users.
4629 Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
4630
4631### Example
4632
4633```java
4634package com.openai.example;
4635
4636import com.openai.client.OpenAIClient;
4637import com.openai.client.okhttp.OpenAIOkHttpClient;
4638import com.openai.models.responses.Response;
4639import com.openai.models.responses.ResponseCancelParams;
4640
4641public final class Main {
4642 private Main() {}
4643
4644 public static void main(String[] args) {
4645 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
4646
4647 Response response = client.responses().cancel("resp_677efb5139a88190b512bc3fef8e535d");
4648 }
4649}
4650```
4651
4652#### Response
4653
4654```json
4655{
4656 "id": "id",
4657 "created_at": 0,
4658 "error": {
4659 "code": "server_error",
4660 "message": "message"
4661 },
4662 "incomplete_details": {
4663 "reason": "max_output_tokens"
4664 },
4665 "instructions": "string",
4666 "metadata": {
4667 "foo": "string"
4668 },
4669 "model": "gpt-5.1",
4670 "object": "response",
4671 "output": [
4672 {
4673 "id": "id",
4674 "content": [
4675 {
4676 "annotations": [
4677 {
4678 "file_id": "file_id",
4679 "filename": "filename",
4680 "index": 0,
4681 "type": "file_citation"
4682 }
4683 ],
4684 "text": "text",
4685 "type": "output_text",
4686 "logprobs": [
4687 {
4688 "token": "token",
4689 "bytes": [
4690 0
4691 ],
4692 "logprob": 0,
4693 "top_logprobs": [
4694 {
4695 "token": "token",
4696 "bytes": [
4697 0
4698 ],
4699 "logprob": 0
4700 }
4701 ]
4702 }
4703 ]
4704 }
4705 ],
4706 "role": "assistant",
4707 "status": "in_progress",
4708 "type": "message",
4709 "phase": "commentary"
4710 }
4711 ],
4712 "parallel_tool_calls": true,
4713 "temperature": 1,
4714 "tool_choice": "none",
4715 "tools": [
4716 {
4717 "name": "name",
4718 "parameters": {
4719 "foo": "bar"
4720 },
4721 "strict": true,
4722 "type": "function",
4723 "defer_loading": true,
4724 "description": "description"
4725 }
4726 ],
4727 "top_p": 1,
4728 "background": true,
4729 "completed_at": 0,
4730 "conversation": {
4731 "id": "id"
4732 },
4733 "max_output_tokens": 0,
4734 "max_tool_calls": 0,
4735 "output_text": "output_text",
4736 "previous_response_id": "previous_response_id",
4737 "prompt": {
4738 "id": "id",
4739 "variables": {
4740 "foo": "string"
4741 },
4742 "version": "version"
4743 },
4744 "prompt_cache_key": "prompt-cache-key-1234",
4745 "prompt_cache_retention": "in_memory",
4746 "reasoning": {
4747 "effort": "none",
4748 "generate_summary": "auto",
4749 "summary": "auto"
4750 },
4751 "safety_identifier": "safety-identifier-1234",
4752 "service_tier": "auto",
4753 "status": "completed",
4754 "text": {
4755 "format": {
4756 "type": "text"
4757 },
4758 "verbosity": "low"
4759 },
4760 "top_logprobs": 0,
4761 "truncation": "auto",
4762 "usage": {
4763 "input_tokens": 0,
4764 "input_tokens_details": {
4765 "cached_tokens": 0
4766 },
4767 "output_tokens": 0,
4768 "output_tokens_details": {
4769 "reasoning_tokens": 0
4770 },
4771 "total_tokens": 0
4772 },
4773 "user": "user-1234"
4774}
4775```