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