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