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