resources/conversations/subresources/items/methods/retrieve/index.md +0 −2857 deleted
File Deleted View Diff
1## Retrieve an item
2
3**get** `/conversations/{conversation_id}/items/{item_id}`
4
5Get a single item from a conversation with the given IDs.
6
7### Path Parameters
8
9- `conversation_id: string`
10
11- `item_id: string`
12
13### Query Parameters
14
15- `include: optional array of ResponseIncludable`
16
17 Additional fields to include in the response. See the `include`
18 parameter for [listing Conversation items above](/docs/api-reference/conversations/list-items#conversations_list_items-include) for more information.
19
20 - `"file_search_call.results"`
21
22 - `"web_search_call.results"`
23
24 - `"web_search_call.action.sources"`
25
26 - `"message.input_image.image_url"`
27
28 - `"computer_call_output.output.image_url"`
29
30 - `"code_interpreter_call.outputs"`
31
32 - `"reasoning.encrypted_content"`
33
34 - `"message.output_text.logprobs"`
35
36### Returns
37
38- `ConversationItem = Message or object { id, arguments, call_id, 5 more } or object { id, call_id, output, 3 more } or 22 more`
39
40 A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](/docs/api-reference/responses/object#responses/object-output).
41
42 - `Message object { id, content, role, 3 more }`
43
44 A message to or from the model.
45
46 - `id: string`
47
48 The unique ID of the message.
49
50 - `content: array of ResponseInputText or ResponseOutputText or TextContent or 6 more`
51
52 The content of the message
53
54 - `ResponseInputText object { text, type }`
55
56 A text input to the model.
57
58 - `text: string`
59
60 The text input to the model.
61
62 - `type: "input_text"`
63
64 The type of the input item. Always `input_text`.
65
66 - `"input_text"`
67
68 - `ResponseOutputText object { annotations, logprobs, text, type }`
69
70 A text output from the model.
71
72 - `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 }`
73
74 The annotations of the text output.
75
76 - `FileCitation object { file_id, filename, index, type }`
77
78 A citation to a file.
79
80 - `file_id: string`
81
82 The ID of the file.
83
84 - `filename: string`
85
86 The filename of the file cited.
87
88 - `index: number`
89
90 The index of the file in the list of files.
91
92 - `type: "file_citation"`
93
94 The type of the file citation. Always `file_citation`.
95
96 - `"file_citation"`
97
98 - `URLCitation object { end_index, start_index, title, 2 more }`
99
100 A citation for a web resource used to generate a model response.
101
102 - `end_index: number`
103
104 The index of the last character of the URL citation in the message.
105
106 - `start_index: number`
107
108 The index of the first character of the URL citation in the message.
109
110 - `title: string`
111
112 The title of the web resource.
113
114 - `type: "url_citation"`
115
116 The type of the URL citation. Always `url_citation`.
117
118 - `"url_citation"`
119
120 - `url: string`
121
122 The URL of the web resource.
123
124 - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }`
125
126 A citation for a container file used to generate a model response.
127
128 - `container_id: string`
129
130 The ID of the container file.
131
132 - `end_index: number`
133
134 The index of the last character of the container file citation in the message.
135
136 - `file_id: string`
137
138 The ID of the file.
139
140 - `filename: string`
141
142 The filename of the container file cited.
143
144 - `start_index: number`
145
146 The index of the first character of the container file citation in the message.
147
148 - `type: "container_file_citation"`
149
150 The type of the container file citation. Always `container_file_citation`.
151
152 - `"container_file_citation"`
153
154 - `FilePath object { file_id, index, type }`
155
156 A path to a file.
157
158 - `file_id: string`
159
160 The ID of the file.
161
162 - `index: number`
163
164 The index of the file in the list of files.
165
166 - `type: "file_path"`
167
168 The type of the file path. Always `file_path`.
169
170 - `"file_path"`
171
172 - `logprobs: array of object { token, bytes, logprob, top_logprobs }`
173
174 - `token: string`
175
176 - `bytes: array of number`
177
178 - `logprob: number`
179
180 - `top_logprobs: array of object { token, bytes, logprob }`
181
182 - `token: string`
183
184 - `bytes: array of number`
185
186 - `logprob: number`
187
188 - `text: string`
189
190 The text output from the model.
191
192 - `type: "output_text"`
193
194 The type of the output text. Always `output_text`.
195
196 - `"output_text"`
197
198 - `TextContent object { text, type }`
199
200 A text content.
201
202 - `text: string`
203
204 - `type: "text"`
205
206 - `"text"`
207
208 - `SummaryTextContent object { text, type }`
209
210 A summary text from the model.
211
212 - `text: string`
213
214 A summary of the reasoning output from the model so far.
215
216 - `type: "summary_text"`
217
218 The type of the object. Always `summary_text`.
219
220 - `"summary_text"`
221
222 - `ReasoningText object { text, type }`
223
224 Reasoning text from the model.
225
226 - `text: string`
227
228 The reasoning text from the model.
229
230 - `type: "reasoning_text"`
231
232 The type of the reasoning text. Always `reasoning_text`.
233
234 - `"reasoning_text"`
235
236 - `ResponseOutputRefusal object { refusal, type }`
237
238 A refusal from the model.
239
240 - `refusal: string`
241
242 The refusal explanation from the model.
243
244 - `type: "refusal"`
245
246 The type of the refusal. Always `refusal`.
247
248 - `"refusal"`
249
250 - `ResponseInputImage object { detail, type, file_id, image_url }`
251
252 An image input to the model. Learn about [image inputs](/docs/guides/vision).
253
254 - `detail: "low" or "high" or "auto" or "original"`
255
256 The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
257
258 - `"low"`
259
260 - `"high"`
261
262 - `"auto"`
263
264 - `"original"`
265
266 - `type: "input_image"`
267
268 The type of the input item. Always `input_image`.
269
270 - `"input_image"`
271
272 - `file_id: optional string`
273
274 The ID of the file to be sent to the model.
275
276 - `image_url: optional string`
277
278 The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
279
280 - `ComputerScreenshotContent object { detail, file_id, image_url, type }`
281
282 A screenshot of a computer.
283
284 - `detail: "low" or "high" or "auto" or "original"`
285
286 The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
287
288 - `"low"`
289
290 - `"high"`
291
292 - `"auto"`
293
294 - `"original"`
295
296 - `file_id: string`
297
298 The identifier of an uploaded file that contains the screenshot.
299
300 - `image_url: string`
301
302 The URL of the screenshot image.
303
304 - `type: "computer_screenshot"`
305
306 Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.
307
308 - `"computer_screenshot"`
309
310 - `ResponseInputFile object { type, detail, file_data, 3 more }`
311
312 A file input to the model.
313
314 - `type: "input_file"`
315
316 The type of the input item. Always `input_file`.
317
318 - `"input_file"`
319
320 - `detail: optional "low" or "high"`
321
322 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`.
323
324 - `"low"`
325
326 - `"high"`
327
328 - `file_data: optional string`
329
330 The content of the file to be sent to the model.
331
332 - `file_id: optional string`
333
334 The ID of the file to be sent to the model.
335
336 - `file_url: optional string`
337
338 The URL of the file to be sent to the model.
339
340 - `filename: optional string`
341
342 The name of the file to be sent to the model.
343
344 - `role: "unknown" or "user" or "assistant" or 5 more`
345
346 The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`.
347
348 - `"unknown"`
349
350 - `"user"`
351
352 - `"assistant"`
353
354 - `"system"`
355
356 - `"critic"`
357
358 - `"discriminator"`
359
360 - `"developer"`
361
362 - `"tool"`
363
364 - `status: "in_progress" or "completed" or "incomplete"`
365
366 The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
367
368 - `"in_progress"`
369
370 - `"completed"`
371
372 - `"incomplete"`
373
374 - `type: "message"`
375
376 The type of the message. Always set to `message`.
377
378 - `"message"`
379
380 - `phase: optional "commentary" or "final_answer"`
381
382 Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
383
384 - `"commentary"`
385
386 - `"final_answer"`
387
388 - `FunctionCall object { id, arguments, call_id, 5 more }`
389
390 - `id: string`
391
392 The unique ID of the function tool call.
393
394 - `arguments: string`
395
396 A JSON string of the arguments to pass to the function.
397
398 - `call_id: string`
399
400 The unique ID of the function tool call generated by the model.
401
402 - `name: string`
403
404 The name of the function to run.
405
406 - `status: "in_progress" or "completed" or "incomplete"`
407
408 The status of the item. One of `in_progress`, `completed`, or
409 `incomplete`. Populated when items are returned via API.
410
411 - `"in_progress"`
412
413 - `"completed"`
414
415 - `"incomplete"`
416
417 - `type: "function_call"`
418
419 The type of the function tool call. Always `function_call`.
420
421 - `"function_call"`
422
423 - `created_by: optional string`
424
425 The identifier of the actor that created the item.
426
427 - `namespace: optional string`
428
429 The namespace of the function to run.
430
431 - `FunctionCallOutput object { id, call_id, output, 3 more }`
432
433 - `id: string`
434
435 The unique ID of the function call tool output.
436
437 - `call_id: string`
438
439 The unique ID of the function tool call generated by the model.
440
441 - `output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFile`
442
443 The output from the function call generated by your code.
444 Can be a string or an list of output content.
445
446 - `StringOutput = string`
447
448 A string of the output of the function call.
449
450 - `OutputContentList = array of ResponseInputText or ResponseInputImage or ResponseInputFile`
451
452 Text, image, or file output of the function call.
453
454 - `ResponseInputText object { text, type }`
455
456 A text input to the model.
457
458 - `ResponseInputImage object { detail, type, file_id, image_url }`
459
460 An image input to the model. Learn about [image inputs](/docs/guides/vision).
461
462 - `ResponseInputFile object { type, detail, file_data, 3 more }`
463
464 A file input to the model.
465
466 - `status: "in_progress" or "completed" or "incomplete"`
467
468 The status of the item. One of `in_progress`, `completed`, or
469 `incomplete`. Populated when items are returned via API.
470
471 - `"in_progress"`
472
473 - `"completed"`
474
475 - `"incomplete"`
476
477 - `type: "function_call_output"`
478
479 The type of the function tool call output. Always `function_call_output`.
480
481 - `"function_call_output"`
482
483 - `created_by: optional string`
484
485 The identifier of the actor that created the item.
486
487 - `FileSearchCall object { id, queries, status, 2 more }`
488
489 The results of a file search tool call. See the
490 [file search guide](/docs/guides/tools-file-search) for more information.
491
492 - `id: string`
493
494 The unique ID of the file search tool call.
495
496 - `queries: array of string`
497
498 The queries used to search for files.
499
500 - `status: "in_progress" or "searching" or "completed" or 2 more`
501
502 The status of the file search tool call. One of `in_progress`,
503 `searching`, `incomplete` or `failed`,
504
505 - `"in_progress"`
506
507 - `"searching"`
508
509 - `"completed"`
510
511 - `"incomplete"`
512
513 - `"failed"`
514
515 - `type: "file_search_call"`
516
517 The type of the file search tool call. Always `file_search_call`.
518
519 - `"file_search_call"`
520
521 - `results: optional array of object { attributes, file_id, filename, 2 more }`
522
523 The results of the file search tool call.
524
525 - `attributes: optional map[string or number or boolean]`
526
527 Set of 16 key-value pairs that can be attached to an object. This can be
528 useful for storing additional information about the object in a structured
529 format, and querying for objects via API or the dashboard. Keys are strings
530 with a maximum length of 64 characters. Values are strings with a maximum
531 length of 512 characters, booleans, or numbers.
532
533 - `string`
534
535 - `number`
536
537 - `boolean`
538
539 - `file_id: optional string`
540
541 The unique ID of the file.
542
543 - `filename: optional string`
544
545 The name of the file.
546
547 - `score: optional number`
548
549 The relevance score of the file - a value between 0 and 1.
550
551 - `text: optional string`
552
553 The text that was retrieved from the file.
554
555 - `WebSearchCall object { id, action, status, type }`
556
557 The results of a web search tool call. See the
558 [web search guide](/docs/guides/tools-web-search) for more information.
559
560 - `id: string`
561
562 The unique ID of the web search tool call.
563
564 - `action: object { query, type, queries, sources } or object { type, url } or object { pattern, type, url }`
565
566 An object describing the specific action taken in this web search call.
567 Includes details on how the model used the web (search, open_page, find_in_page).
568
569 - `Search object { query, type, queries, sources }`
570
571 Action type "search" - Performs a web search query.
572
573 - `query: string`
574
575 [DEPRECATED] The search query.
576
577 - `type: "search"`
578
579 The action type.
580
581 - `"search"`
582
583 - `queries: optional array of string`
584
585 The search queries.
586
587 - `sources: optional array of object { type, url }`
588
589 The sources used in the search.
590
591 - `type: "url"`
592
593 The type of source. Always `url`.
594
595 - `"url"`
596
597 - `url: string`
598
599 The URL of the source.
600
601 - `OpenPage object { type, url }`
602
603 Action type "open_page" - Opens a specific URL from search results.
604
605 - `type: "open_page"`
606
607 The action type.
608
609 - `"open_page"`
610
611 - `url: optional string`
612
613 The URL opened by the model.
614
615 - `FindInPage object { pattern, type, url }`
616
617 Action type "find_in_page": Searches for a pattern within a loaded page.
618
619 - `pattern: string`
620
621 The pattern or text to search for within the page.
622
623 - `type: "find_in_page"`
624
625 The action type.
626
627 - `"find_in_page"`
628
629 - `url: string`
630
631 The URL of the page searched for the pattern.
632
633 - `status: "in_progress" or "searching" or "completed" or "failed"`
634
635 The status of the web search tool call.
636
637 - `"in_progress"`
638
639 - `"searching"`
640
641 - `"completed"`
642
643 - `"failed"`
644
645 - `type: "web_search_call"`
646
647 The type of the web search tool call. Always `web_search_call`.
648
649 - `"web_search_call"`
650
651 - `ImageGenerationCall object { id, result, status, type }`
652
653 An image generation request made by the model.
654
655 - `id: string`
656
657 The unique ID of the image generation call.
658
659 - `result: string`
660
661 The generated image encoded in base64.
662
663 - `status: "in_progress" or "completed" or "generating" or "failed"`
664
665 The status of the image generation call.
666
667 - `"in_progress"`
668
669 - `"completed"`
670
671 - `"generating"`
672
673 - `"failed"`
674
675 - `type: "image_generation_call"`
676
677 The type of the image generation call. Always `image_generation_call`.
678
679 - `"image_generation_call"`
680
681 - `ComputerCall object { id, call_id, pending_safety_checks, 4 more }`
682
683 A tool call to a computer use tool. See the
684 [computer use guide](/docs/guides/tools-computer-use) for more information.
685
686 - `id: string`
687
688 The unique ID of the computer call.
689
690 - `call_id: string`
691
692 An identifier used when responding to the tool call with output.
693
694 - `pending_safety_checks: array of object { id, code, message }`
695
696 The pending safety checks for the computer call.
697
698 - `id: string`
699
700 The ID of the pending safety check.
701
702 - `code: optional string`
703
704 The type of the pending safety check.
705
706 - `message: optional string`
707
708 Details about the pending safety check.
709
710 - `status: "in_progress" or "completed" or "incomplete"`
711
712 The status of the item. One of `in_progress`, `completed`, or
713 `incomplete`. Populated when items are returned via API.
714
715 - `"in_progress"`
716
717 - `"completed"`
718
719 - `"incomplete"`
720
721 - `type: "computer_call"`
722
723 The type of the computer call. Always `computer_call`.
724
725 - `"computer_call"`
726
727 - `action: optional ComputerAction`
728
729 A click action.
730
731 - `Click object { button, type, x, 2 more }`
732
733 A click action.
734
735 - `button: "left" or "right" or "wheel" or 2 more`
736
737 Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
738
739 - `"left"`
740
741 - `"right"`
742
743 - `"wheel"`
744
745 - `"back"`
746
747 - `"forward"`
748
749 - `type: "click"`
750
751 Specifies the event type. For a click action, this property is always `click`.
752
753 - `"click"`
754
755 - `x: number`
756
757 The x-coordinate where the click occurred.
758
759 - `y: number`
760
761 The y-coordinate where the click occurred.
762
763 - `keys: optional array of string`
764
765 The keys being held while clicking.
766
767 - `DoubleClick object { keys, type, x, y }`
768
769 A double click action.
770
771 - `keys: array of string`
772
773 The keys being held while double-clicking.
774
775 - `type: "double_click"`
776
777 Specifies the event type. For a double click action, this property is always set to `double_click`.
778
779 - `"double_click"`
780
781 - `x: number`
782
783 The x-coordinate where the double click occurred.
784
785 - `y: number`
786
787 The y-coordinate where the double click occurred.
788
789 - `Drag object { path, type, keys }`
790
791 A drag action.
792
793 - `path: array of object { x, y }`
794
795 An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
796
797 ```
798 [
799 { x: 100, y: 200 },
800 { x: 200, y: 300 }
801 ]
802 ```
803
804 - `x: number`
805
806 The x-coordinate.
807
808 - `y: number`
809
810 The y-coordinate.
811
812 - `type: "drag"`
813
814 Specifies the event type. For a drag action, this property is always set to `drag`.
815
816 - `"drag"`
817
818 - `keys: optional array of string`
819
820 The keys being held while dragging the mouse.
821
822 - `Keypress object { keys, type }`
823
824 A collection of keypresses the model would like to perform.
825
826 - `keys: array of string`
827
828 The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
829
830 - `type: "keypress"`
831
832 Specifies the event type. For a keypress action, this property is always set to `keypress`.
833
834 - `"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 - `"move"`
845
846 - `x: number`
847
848 The x-coordinate to move to.
849
850 - `y: number`
851
852 The y-coordinate to move to.
853
854 - `keys: optional array of string`
855
856 The keys being held while moving the mouse.
857
858 - `Screenshot object { type }`
859
860 A screenshot action.
861
862 - `type: "screenshot"`
863
864 Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
865
866 - `"screenshot"`
867
868 - `Scroll object { scroll_x, scroll_y, type, 3 more }`
869
870 A scroll action.
871
872 - `scroll_x: number`
873
874 The horizontal scroll distance.
875
876 - `scroll_y: number`
877
878 The vertical scroll distance.
879
880 - `type: "scroll"`
881
882 Specifies the event type. For a scroll action, this property is always set to `scroll`.
883
884 - `"scroll"`
885
886 - `x: number`
887
888 The x-coordinate where the scroll occurred.
889
890 - `y: number`
891
892 The y-coordinate where the scroll occurred.
893
894 - `keys: optional array of string`
895
896 The keys being held while scrolling.
897
898 - `Type object { text, type }`
899
900 An action to type in text.
901
902 - `text: string`
903
904 The text to type.
905
906 - `type: "type"`
907
908 Specifies the event type. For a type action, this property is always set to `type`.
909
910 - `"type"`
911
912 - `Wait object { type }`
913
914 A wait action.
915
916 - `type: "wait"`
917
918 Specifies the event type. For a wait action, this property is always set to `wait`.
919
920 - `"wait"`
921
922 - `actions: optional ComputerActionList`
923
924 Flattened batched actions for `computer_use`. Each action includes an
925 `type` discriminator and action-specific fields.
926
927 - `Click object { button, type, x, 2 more }`
928
929 A click action.
930
931 - `DoubleClick object { keys, type, x, y }`
932
933 A double click action.
934
935 - `Drag object { path, type, keys }`
936
937 A drag action.
938
939 - `Keypress object { keys, type }`
940
941 A collection of keypresses the model would like to perform.
942
943 - `Move object { type, x, y, keys }`
944
945 A mouse move action.
946
947 - `Screenshot object { type }`
948
949 A screenshot action.
950
951 - `Scroll object { scroll_x, scroll_y, type, 3 more }`
952
953 A scroll action.
954
955 - `Type object { text, type }`
956
957 An action to type in text.
958
959 - `Wait object { type }`
960
961 A wait action.
962
963 - `ComputerCallOutput object { id, call_id, output, 4 more }`
964
965 - `id: string`
966
967 The unique ID of the computer call tool output.
968
969 - `call_id: string`
970
971 The ID of the computer tool call that produced the output.
972
973 - `output: ResponseComputerToolCallOutputScreenshot`
974
975 A computer screenshot image used with the computer use tool.
976
977 - `type: "computer_screenshot"`
978
979 Specifies the event type. For a computer screenshot, this property is
980 always set to `computer_screenshot`.
981
982 - `"computer_screenshot"`
983
984 - `file_id: optional string`
985
986 The identifier of an uploaded file that contains the screenshot.
987
988 - `image_url: optional string`
989
990 The URL of the screenshot image.
991
992 - `status: "completed" or "incomplete" or "failed" or "in_progress"`
993
994 The status of the message input. One of `in_progress`, `completed`, or
995 `incomplete`. Populated when input items are returned via API.
996
997 - `"completed"`
998
999 - `"incomplete"`
1000
1001 - `"failed"`
1002
1003 - `"in_progress"`
1004
1005 - `type: "computer_call_output"`
1006
1007 The type of the computer tool call output. Always `computer_call_output`.
1008
1009 - `"computer_call_output"`
1010
1011 - `acknowledged_safety_checks: optional array of object { id, code, message }`
1012
1013 The safety checks reported by the API that have been acknowledged by the
1014 developer.
1015
1016 - `id: string`
1017
1018 The ID of the pending safety check.
1019
1020 - `code: optional string`
1021
1022 The type of the pending safety check.
1023
1024 - `message: optional string`
1025
1026 Details about the pending safety check.
1027
1028 - `created_by: optional string`
1029
1030 The identifier of the actor that created the item.
1031
1032 - `ToolSearchCall object { id, arguments, call_id, 4 more }`
1033
1034 - `id: string`
1035
1036 The unique ID of the tool search call item.
1037
1038 - `arguments: unknown`
1039
1040 Arguments used for the tool search call.
1041
1042 - `call_id: string`
1043
1044 The unique ID of the tool search call generated by the model.
1045
1046 - `execution: "server" or "client"`
1047
1048 Whether tool search was executed by the server or by the client.
1049
1050 - `"server"`
1051
1052 - `"client"`
1053
1054 - `status: "in_progress" or "completed" or "incomplete"`
1055
1056 The status of the tool search call item that was recorded.
1057
1058 - `"in_progress"`
1059
1060 - `"completed"`
1061
1062 - `"incomplete"`
1063
1064 - `type: "tool_search_call"`
1065
1066 The type of the item. Always `tool_search_call`.
1067
1068 - `"tool_search_call"`
1069
1070 - `created_by: optional string`
1071
1072 The identifier of the actor that created the item.
1073
1074 - `ToolSearchOutput object { id, call_id, execution, 4 more }`
1075
1076 - `id: string`
1077
1078 The unique ID of the tool search output item.
1079
1080 - `call_id: string`
1081
1082 The unique ID of the tool search call generated by the model.
1083
1084 - `execution: "server" or "client"`
1085
1086 Whether tool search was executed by the server or by the client.
1087
1088 - `"server"`
1089
1090 - `"client"`
1091
1092 - `status: "in_progress" or "completed" or "incomplete"`
1093
1094 The status of the tool search output item that was recorded.
1095
1096 - `"in_progress"`
1097
1098 - `"completed"`
1099
1100 - `"incomplete"`
1101
1102 - `tools: array of object { name, parameters, strict, 3 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 12 more`
1103
1104 The loaded tool definitions returned by tool search.
1105
1106 - `Function object { name, parameters, strict, 3 more }`
1107
1108 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).
1109
1110 - `name: string`
1111
1112 The name of the function to call.
1113
1114 - `parameters: map[unknown]`
1115
1116 A JSON schema object describing the parameters of the function.
1117
1118 - `strict: boolean`
1119
1120 Whether to enforce strict parameter validation. Default `true`.
1121
1122 - `type: "function"`
1123
1124 The type of the function tool. Always `function`.
1125
1126 - `"function"`
1127
1128 - `defer_loading: optional boolean`
1129
1130 Whether this function is deferred and loaded via tool search.
1131
1132 - `description: optional string`
1133
1134 A description of the function. Used by the model to determine whether or not to call the function.
1135
1136 - `FileSearch object { type, vector_store_ids, filters, 2 more }`
1137
1138 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).
1139
1140 - `type: "file_search"`
1141
1142 The type of the file search tool. Always `file_search`.
1143
1144 - `"file_search"`
1145
1146 - `vector_store_ids: array of string`
1147
1148 The IDs of the vector stores to search.
1149
1150 - `filters: optional ComparisonFilter or CompoundFilter`
1151
1152 A filter to apply.
1153
1154 - `ComparisonFilter object { key, type, value }`
1155
1156 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
1157
1158 - `key: string`
1159
1160 The key to compare against the value.
1161
1162 - `type: "eq" or "ne" or "gt" or 5 more`
1163
1164 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.
1165
1166 - `eq`: equals
1167 - `ne`: not equal
1168 - `gt`: greater than
1169 - `gte`: greater than or equal
1170 - `lt`: less than
1171 - `lte`: less than or equal
1172 - `in`: in
1173 - `nin`: not in
1174
1175 - `"eq"`
1176
1177 - `"ne"`
1178
1179 - `"gt"`
1180
1181 - `"gte"`
1182
1183 - `"lt"`
1184
1185 - `"lte"`
1186
1187 - `"in"`
1188
1189 - `"nin"`
1190
1191 - `value: string or number or boolean or array of string or number`
1192
1193 The value to compare against the attribute key; supports string, number, or boolean types.
1194
1195 - `string`
1196
1197 - `number`
1198
1199 - `boolean`
1200
1201 - `array of string or number`
1202
1203 - `string`
1204
1205 - `number`
1206
1207 - `CompoundFilter object { filters, type }`
1208
1209 Combine multiple filters using `and` or `or`.
1210
1211 - `filters: array of ComparisonFilter or unknown`
1212
1213 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
1214
1215 - `ComparisonFilter object { key, type, value }`
1216
1217 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
1218
1219 - `unknown`
1220
1221 - `type: "and" or "or"`
1222
1223 Type of operation: `and` or `or`.
1224
1225 - `"and"`
1226
1227 - `"or"`
1228
1229 - `max_num_results: optional number`
1230
1231 The maximum number of results to return. This number should be between 1 and 50 inclusive.
1232
1233 - `ranking_options: optional object { hybrid_search, ranker, score_threshold }`
1234
1235 Ranking options for search.
1236
1237 - `hybrid_search: optional object { embedding_weight, text_weight }`
1238
1239 Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
1240
1241 - `embedding_weight: number`
1242
1243 The weight of the embedding in the reciprocal ranking fusion.
1244
1245 - `text_weight: number`
1246
1247 The weight of the text in the reciprocal ranking fusion.
1248
1249 - `ranker: optional "auto" or "default-2024-11-15"`
1250
1251 The ranker to use for the file search.
1252
1253 - `"auto"`
1254
1255 - `"default-2024-11-15"`
1256
1257 - `score_threshold: optional number`
1258
1259 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.
1260
1261 - `Computer object { type }`
1262
1263 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
1264
1265 - `type: "computer"`
1266
1267 The type of the computer tool. Always `computer`.
1268
1269 - `"computer"`
1270
1271 - `ComputerUsePreview object { display_height, display_width, environment, type }`
1272
1273 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
1274
1275 - `display_height: number`
1276
1277 The height of the computer display.
1278
1279 - `display_width: number`
1280
1281 The width of the computer display.
1282
1283 - `environment: "windows" or "mac" or "linux" or 2 more`
1284
1285 The type of computer environment to control.
1286
1287 - `"windows"`
1288
1289 - `"mac"`
1290
1291 - `"linux"`
1292
1293 - `"ubuntu"`
1294
1295 - `"browser"`
1296
1297 - `type: "computer_use_preview"`
1298
1299 The type of the computer use tool. Always `computer_use_preview`.
1300
1301 - `"computer_use_preview"`
1302
1303 - `WebSearch object { type, filters, search_context_size, user_location }`
1304
1305 Search the Internet for sources related to the prompt. Learn more about the
1306 [web search tool](/docs/guides/tools-web-search).
1307
1308 - `type: "web_search" or "web_search_2025_08_26"`
1309
1310 The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
1311
1312 - `"web_search"`
1313
1314 - `"web_search_2025_08_26"`
1315
1316 - `filters: optional object { allowed_domains }`
1317
1318 Filters for the search.
1319
1320 - `allowed_domains: optional array of string`
1321
1322 Allowed domains for the search. If not provided, all domains are allowed.
1323 Subdomains of the provided domains are allowed as well.
1324
1325 Example: `["pubmed.ncbi.nlm.nih.gov"]`
1326
1327 - `search_context_size: optional "low" or "medium" or "high"`
1328
1329 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.
1330
1331 - `"low"`
1332
1333 - `"medium"`
1334
1335 - `"high"`
1336
1337 - `user_location: optional object { city, country, region, 2 more }`
1338
1339 The approximate location of the user.
1340
1341 - `city: optional string`
1342
1343 Free text input for the city of the user, e.g. `San Francisco`.
1344
1345 - `country: optional string`
1346
1347 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
1348
1349 - `region: optional string`
1350
1351 Free text input for the region of the user, e.g. `California`.
1352
1353 - `timezone: optional string`
1354
1355 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
1356
1357 - `type: optional "approximate"`
1358
1359 The type of location approximation. Always `approximate`.
1360
1361 - `"approximate"`
1362
1363 - `Mcp object { server_label, type, allowed_tools, 7 more }`
1364
1365 Give the model access to additional tools via remote Model Context Protocol
1366 (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).
1367
1368 - `server_label: string`
1369
1370 A label for this MCP server, used to identify it in tool calls.
1371
1372 - `type: "mcp"`
1373
1374 The type of the MCP tool. Always `mcp`.
1375
1376 - `"mcp"`
1377
1378 - `allowed_tools: optional array of string or object { read_only, tool_names }`
1379
1380 List of allowed tool names or a filter object.
1381
1382 - `McpAllowedTools = array of string`
1383
1384 A string array of allowed tool names
1385
1386 - `McpToolFilter object { read_only, tool_names }`
1387
1388 A filter object to specify which tools are allowed.
1389
1390 - `read_only: optional boolean`
1391
1392 Indicates whether or not a tool modifies data or is read-only. If an
1393 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1394 it will match this filter.
1395
1396 - `tool_names: optional array of string`
1397
1398 List of allowed tool names.
1399
1400 - `authorization: optional string`
1401
1402 An OAuth access token that can be used with a remote MCP server, either
1403 with a custom MCP server URL or a service connector. Your application
1404 must handle the OAuth authorization flow and provide the token here.
1405
1406 - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more`
1407
1408 Identifier for service connectors, like those available in ChatGPT. One of
1409 `server_url` or `connector_id` must be provided. Learn more about service
1410 connectors [here](/docs/guides/tools-remote-mcp#connectors).
1411
1412 Currently supported `connector_id` values are:
1413
1414 - Dropbox: `connector_dropbox`
1415 - Gmail: `connector_gmail`
1416 - Google Calendar: `connector_googlecalendar`
1417 - Google Drive: `connector_googledrive`
1418 - Microsoft Teams: `connector_microsoftteams`
1419 - Outlook Calendar: `connector_outlookcalendar`
1420 - Outlook Email: `connector_outlookemail`
1421 - SharePoint: `connector_sharepoint`
1422
1423 - `"connector_dropbox"`
1424
1425 - `"connector_gmail"`
1426
1427 - `"connector_googlecalendar"`
1428
1429 - `"connector_googledrive"`
1430
1431 - `"connector_microsoftteams"`
1432
1433 - `"connector_outlookcalendar"`
1434
1435 - `"connector_outlookemail"`
1436
1437 - `"connector_sharepoint"`
1438
1439 - `defer_loading: optional boolean`
1440
1441 Whether this MCP tool is deferred and discovered via tool search.
1442
1443 - `headers: optional map[string]`
1444
1445 Optional HTTP headers to send to the MCP server. Use for authentication
1446 or other purposes.
1447
1448 - `require_approval: optional object { always, never } or "always" or "never"`
1449
1450 Specify which of the MCP server's tools require approval.
1451
1452 - `McpToolApprovalFilter object { always, never }`
1453
1454 Specify which of the MCP server's tools require approval. Can be
1455 `always`, `never`, or a filter object associated with tools
1456 that require approval.
1457
1458 - `always: optional object { read_only, tool_names }`
1459
1460 A filter object to specify which tools are allowed.
1461
1462 - `read_only: optional boolean`
1463
1464 Indicates whether or not a tool modifies data or is read-only. If an
1465 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1466 it will match this filter.
1467
1468 - `tool_names: optional array of string`
1469
1470 List of allowed tool names.
1471
1472 - `never: optional object { read_only, tool_names }`
1473
1474 A filter object to specify which tools are allowed.
1475
1476 - `read_only: optional boolean`
1477
1478 Indicates whether or not a tool modifies data or is read-only. If an
1479 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1480 it will match this filter.
1481
1482 - `tool_names: optional array of string`
1483
1484 List of allowed tool names.
1485
1486 - `McpToolApprovalSetting = "always" or "never"`
1487
1488 Specify a single approval policy for all tools. One of `always` or
1489 `never`. When set to `always`, all tools will require approval. When
1490 set to `never`, all tools will not require approval.
1491
1492 - `"always"`
1493
1494 - `"never"`
1495
1496 - `server_description: optional string`
1497
1498 Optional description of the MCP server, used to provide more context.
1499
1500 - `server_url: optional string`
1501
1502 The URL for the MCP server. One of `server_url` or `connector_id` must be
1503 provided.
1504
1505 - `CodeInterpreter object { container, type }`
1506
1507 A tool that runs Python code to help generate a response to a prompt.
1508
1509 - `container: string or object { type, file_ids, memory_limit, network_policy }`
1510
1511 The code interpreter container. Can be a container ID or an object that
1512 specifies uploaded file IDs to make available to your code, along with an
1513 optional `memory_limit` setting.
1514
1515 - `string`
1516
1517 The container ID.
1518
1519 - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }`
1520
1521 Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
1522
1523 - `type: "auto"`
1524
1525 Always `auto`.
1526
1527 - `"auto"`
1528
1529 - `file_ids: optional array of string`
1530
1531 An optional list of uploaded files to make available to your code.
1532
1533 - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`
1534
1535 The memory limit for the code interpreter container.
1536
1537 - `"1g"`
1538
1539 - `"4g"`
1540
1541 - `"16g"`
1542
1543 - `"64g"`
1544
1545 - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`
1546
1547 Network access policy for the container.
1548
1549 - `ContainerNetworkPolicyDisabled object { type }`
1550
1551 - `type: "disabled"`
1552
1553 Disable outbound network access. Always `disabled`.
1554
1555 - `"disabled"`
1556
1557 - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`
1558
1559 - `allowed_domains: array of string`
1560
1561 A list of allowed domains when type is `allowlist`.
1562
1563 - `type: "allowlist"`
1564
1565 Allow outbound network access only to specified domains. Always `allowlist`.
1566
1567 - `"allowlist"`
1568
1569 - `domain_secrets: optional array of ContainerNetworkPolicyDomainSecret`
1570
1571 Optional domain-scoped secrets for allowlisted domains.
1572
1573 - `domain: string`
1574
1575 The domain associated with the secret.
1576
1577 - `name: string`
1578
1579 The name of the secret to inject for the domain.
1580
1581 - `value: string`
1582
1583 The secret value to inject for the domain.
1584
1585 - `type: "code_interpreter"`
1586
1587 The type of the code interpreter tool. Always `code_interpreter`.
1588
1589 - `"code_interpreter"`
1590
1591 - `ImageGeneration object { type, action, background, 9 more }`
1592
1593 A tool that generates images using the GPT image models.
1594
1595 - `type: "image_generation"`
1596
1597 The type of the image generation tool. Always `image_generation`.
1598
1599 - `"image_generation"`
1600
1601 - `action: optional "generate" or "edit" or "auto"`
1602
1603 Whether to generate a new image or edit an existing image. Default: `auto`.
1604
1605 - `"generate"`
1606
1607 - `"edit"`
1608
1609 - `"auto"`
1610
1611 - `background: optional "transparent" or "opaque" or "auto"`
1612
1613 Background type for the generated image. One of `transparent`,
1614 `opaque`, or `auto`. Default: `auto`.
1615
1616 - `"transparent"`
1617
1618 - `"opaque"`
1619
1620 - `"auto"`
1621
1622 - `input_fidelity: optional "high" or "low"`
1623
1624 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`.
1625
1626 - `"high"`
1627
1628 - `"low"`
1629
1630 - `input_image_mask: optional object { file_id, image_url }`
1631
1632 Optional mask for inpainting. Contains `image_url`
1633 (string, optional) and `file_id` (string, optional).
1634
1635 - `file_id: optional string`
1636
1637 File ID for the mask image.
1638
1639 - `image_url: optional string`
1640
1641 Base64-encoded mask image.
1642
1643 - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"`
1644
1645 The image generation model to use. Default: `gpt-image-1`.
1646
1647 - `string`
1648
1649 - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"`
1650
1651 The image generation model to use. Default: `gpt-image-1`.
1652
1653 - `"gpt-image-1"`
1654
1655 - `"gpt-image-1-mini"`
1656
1657 - `"gpt-image-1.5"`
1658
1659 - `moderation: optional "auto" or "low"`
1660
1661 Moderation level for the generated image. Default: `auto`.
1662
1663 - `"auto"`
1664
1665 - `"low"`
1666
1667 - `output_compression: optional number`
1668
1669 Compression level for the output image. Default: 100.
1670
1671 - `output_format: optional "png" or "webp" or "jpeg"`
1672
1673 The output format of the generated image. One of `png`, `webp`, or
1674 `jpeg`. Default: `png`.
1675
1676 - `"png"`
1677
1678 - `"webp"`
1679
1680 - `"jpeg"`
1681
1682 - `partial_images: optional number`
1683
1684 Number of partial images to generate in streaming mode, from 0 (default value) to 3.
1685
1686 - `quality: optional "low" or "medium" or "high" or "auto"`
1687
1688 The quality of the generated image. One of `low`, `medium`, `high`,
1689 or `auto`. Default: `auto`.
1690
1691 - `"low"`
1692
1693 - `"medium"`
1694
1695 - `"high"`
1696
1697 - `"auto"`
1698
1699 - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"`
1700
1701 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`.
1702
1703 - `string`
1704
1705 - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"`
1706
1707 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`.
1708
1709 - `"1024x1024"`
1710
1711 - `"1024x1536"`
1712
1713 - `"1536x1024"`
1714
1715 - `"auto"`
1716
1717 - `LocalShell object { type }`
1718
1719 A tool that allows the model to execute shell commands in a local environment.
1720
1721 - `type: "local_shell"`
1722
1723 The type of the local shell tool. Always `local_shell`.
1724
1725 - `"local_shell"`
1726
1727 - `Shell object { type, environment }`
1728
1729 A tool that allows the model to execute shell commands.
1730
1731 - `type: "shell"`
1732
1733 The type of the shell tool. Always `shell`.
1734
1735 - `"shell"`
1736
1737 - `environment: optional ContainerAuto or LocalEnvironment or ContainerReference`
1738
1739 - `ContainerAuto object { type, file_ids, memory_limit, 2 more }`
1740
1741 - `type: "container_auto"`
1742
1743 Automatically creates a container for this request
1744
1745 - `"container_auto"`
1746
1747 - `file_ids: optional array of string`
1748
1749 An optional list of uploaded files to make available to your code.
1750
1751 - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`
1752
1753 The memory limit for the container.
1754
1755 - `"1g"`
1756
1757 - `"4g"`
1758
1759 - `"16g"`
1760
1761 - `"64g"`
1762
1763 - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`
1764
1765 Network access policy for the container.
1766
1767 - `ContainerNetworkPolicyDisabled object { type }`
1768
1769 - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`
1770
1771 - `skills: optional array of SkillReference or InlineSkill`
1772
1773 An optional list of skills referenced by id or inline data.
1774
1775 - `SkillReference object { skill_id, type, version }`
1776
1777 - `skill_id: string`
1778
1779 The ID of the referenced skill.
1780
1781 - `type: "skill_reference"`
1782
1783 References a skill created with the /v1/skills endpoint.
1784
1785 - `"skill_reference"`
1786
1787 - `version: optional string`
1788
1789 Optional skill version. Use a positive integer or 'latest'. Omit for default.
1790
1791 - `InlineSkill object { description, name, source, type }`
1792
1793 - `description: string`
1794
1795 The description of the skill.
1796
1797 - `name: string`
1798
1799 The name of the skill.
1800
1801 - `source: InlineSkillSource`
1802
1803 Inline skill payload
1804
1805 - `data: string`
1806
1807 Base64-encoded skill zip bundle.
1808
1809 - `media_type: "application/zip"`
1810
1811 The media type of the inline skill payload. Must be `application/zip`.
1812
1813 - `"application/zip"`
1814
1815 - `type: "base64"`
1816
1817 The type of the inline skill source. Must be `base64`.
1818
1819 - `"base64"`
1820
1821 - `type: "inline"`
1822
1823 Defines an inline skill for this request.
1824
1825 - `"inline"`
1826
1827 - `LocalEnvironment object { type, skills }`
1828
1829 - `type: "local"`
1830
1831 Use a local computer environment.
1832
1833 - `"local"`
1834
1835 - `skills: optional array of LocalSkill`
1836
1837 An optional list of skills.
1838
1839 - `description: string`
1840
1841 The description of the skill.
1842
1843 - `name: string`
1844
1845 The name of the skill.
1846
1847 - `path: string`
1848
1849 The path to the directory containing the skill.
1850
1851 - `ContainerReference object { container_id, type }`
1852
1853 - `container_id: string`
1854
1855 The ID of the referenced container.
1856
1857 - `type: "container_reference"`
1858
1859 References a container created with the /v1/containers endpoint
1860
1861 - `"container_reference"`
1862
1863 - `Custom object { name, type, defer_loading, 2 more }`
1864
1865 A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)
1866
1867 - `name: string`
1868
1869 The name of the custom tool, used to identify it in tool calls.
1870
1871 - `type: "custom"`
1872
1873 The type of the custom tool. Always `custom`.
1874
1875 - `"custom"`
1876
1877 - `defer_loading: optional boolean`
1878
1879 Whether this tool should be deferred and discovered via tool search.
1880
1881 - `description: optional string`
1882
1883 Optional description of the custom tool, used to provide more context.
1884
1885 - `format: optional CustomToolInputFormat`
1886
1887 The input format for the custom tool. Default is unconstrained text.
1888
1889 - `Text object { type }`
1890
1891 Unconstrained free-form text.
1892
1893 - `type: "text"`
1894
1895 Unconstrained text format. Always `text`.
1896
1897 - `"text"`
1898
1899 - `Grammar object { definition, syntax, type }`
1900
1901 A grammar defined by the user.
1902
1903 - `definition: string`
1904
1905 The grammar definition.
1906
1907 - `syntax: "lark" or "regex"`
1908
1909 The syntax of the grammar definition. One of `lark` or `regex`.
1910
1911 - `"lark"`
1912
1913 - `"regex"`
1914
1915 - `type: "grammar"`
1916
1917 Grammar format. Always `grammar`.
1918
1919 - `"grammar"`
1920
1921 - `Namespace object { description, name, tools, type }`
1922
1923 Groups function/custom tools under a shared namespace.
1924
1925 - `description: string`
1926
1927 A description of the namespace shown to the model.
1928
1929 - `name: string`
1930
1931 The namespace name used in tool calls (for example, `crm`).
1932
1933 - `tools: array of object { name, type, defer_loading, 3 more } or object { name, type, defer_loading, 2 more }`
1934
1935 The function/custom tools available inside this namespace.
1936
1937 - `Function object { name, type, defer_loading, 3 more }`
1938
1939 - `name: string`
1940
1941 - `type: "function"`
1942
1943 - `"function"`
1944
1945 - `defer_loading: optional boolean`
1946
1947 Whether this function should be deferred and discovered via tool search.
1948
1949 - `description: optional string`
1950
1951 - `parameters: optional unknown`
1952
1953 - `strict: optional boolean`
1954
1955 - `Custom object { name, type, defer_loading, 2 more }`
1956
1957 A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)
1958
1959 - `name: string`
1960
1961 The name of the custom tool, used to identify it in tool calls.
1962
1963 - `type: "custom"`
1964
1965 The type of the custom tool. Always `custom`.
1966
1967 - `"custom"`
1968
1969 - `defer_loading: optional boolean`
1970
1971 Whether this tool should be deferred and discovered via tool search.
1972
1973 - `description: optional string`
1974
1975 Optional description of the custom tool, used to provide more context.
1976
1977 - `format: optional CustomToolInputFormat`
1978
1979 The input format for the custom tool. Default is unconstrained text.
1980
1981 - `type: "namespace"`
1982
1983 The type of the tool. Always `namespace`.
1984
1985 - `"namespace"`
1986
1987 - `ToolSearch object { type, description, execution, parameters }`
1988
1989 Hosted or BYOT tool search configuration for deferred tools.
1990
1991 - `type: "tool_search"`
1992
1993 The type of the tool. Always `tool_search`.
1994
1995 - `"tool_search"`
1996
1997 - `description: optional string`
1998
1999 Description shown to the model for a client-executed tool search tool.
2000
2001 - `execution: optional "server" or "client"`
2002
2003 Whether tool search is executed by the server or by the client.
2004
2005 - `"server"`
2006
2007 - `"client"`
2008
2009 - `parameters: optional unknown`
2010
2011 Parameter schema for a client-executed tool search tool.
2012
2013 - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }`
2014
2015 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).
2016
2017 - `type: "web_search_preview" or "web_search_preview_2025_03_11"`
2018
2019 The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.
2020
2021 - `"web_search_preview"`
2022
2023 - `"web_search_preview_2025_03_11"`
2024
2025 - `search_content_types: optional array of "text" or "image"`
2026
2027 - `"text"`
2028
2029 - `"image"`
2030
2031 - `search_context_size: optional "low" or "medium" or "high"`
2032
2033 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.
2034
2035 - `"low"`
2036
2037 - `"medium"`
2038
2039 - `"high"`
2040
2041 - `user_location: optional object { type, city, country, 2 more }`
2042
2043 The user's location.
2044
2045 - `type: "approximate"`
2046
2047 The type of location approximation. Always `approximate`.
2048
2049 - `"approximate"`
2050
2051 - `city: optional string`
2052
2053 Free text input for the city of the user, e.g. `San Francisco`.
2054
2055 - `country: optional string`
2056
2057 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
2058
2059 - `region: optional string`
2060
2061 Free text input for the region of the user, e.g. `California`.
2062
2063 - `timezone: optional string`
2064
2065 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
2066
2067 - `ApplyPatch object { type }`
2068
2069 Allows the assistant to create, delete, or update files using unified diffs.
2070
2071 - `type: "apply_patch"`
2072
2073 The type of the tool. Always `apply_patch`.
2074
2075 - `"apply_patch"`
2076
2077 - `type: "tool_search_output"`
2078
2079 The type of the item. Always `tool_search_output`.
2080
2081 - `"tool_search_output"`
2082
2083 - `created_by: optional string`
2084
2085 The identifier of the actor that created the item.
2086
2087 - `Reasoning object { id, summary, type, 3 more }`
2088
2089 A description of the chain of thought used by a reasoning model while generating
2090 a response. Be sure to include these items in your `input` to the Responses API
2091 for subsequent turns of a conversation if you are manually
2092 [managing context](/docs/guides/conversation-state).
2093
2094 - `id: string`
2095
2096 The unique identifier of the reasoning content.
2097
2098 - `summary: array of SummaryTextContent`
2099
2100 Reasoning summary content.
2101
2102 - `text: string`
2103
2104 A summary of the reasoning output from the model so far.
2105
2106 - `type: "summary_text"`
2107
2108 The type of the object. Always `summary_text`.
2109
2110 - `type: "reasoning"`
2111
2112 The type of the object. Always `reasoning`.
2113
2114 - `"reasoning"`
2115
2116 - `content: optional array of object { text, type }`
2117
2118 Reasoning text content.
2119
2120 - `text: string`
2121
2122 The reasoning text from the model.
2123
2124 - `type: "reasoning_text"`
2125
2126 The type of the reasoning text. Always `reasoning_text`.
2127
2128 - `"reasoning_text"`
2129
2130 - `encrypted_content: optional string`
2131
2132 The encrypted content of the reasoning item - populated when a response is
2133 generated with `reasoning.encrypted_content` in the `include` parameter.
2134
2135 - `status: optional "in_progress" or "completed" or "incomplete"`
2136
2137 The status of the item. One of `in_progress`, `completed`, or
2138 `incomplete`. Populated when items are returned via API.
2139
2140 - `"in_progress"`
2141
2142 - `"completed"`
2143
2144 - `"incomplete"`
2145
2146 - `Compaction object { id, encrypted_content, type, created_by }`
2147
2148 A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
2149
2150 - `id: string`
2151
2152 The unique ID of the compaction item.
2153
2154 - `encrypted_content: string`
2155
2156 The encrypted content that was produced by compaction.
2157
2158 - `type: "compaction"`
2159
2160 The type of the item. Always `compaction`.
2161
2162 - `"compaction"`
2163
2164 - `created_by: optional string`
2165
2166 The identifier of the actor that created the item.
2167
2168 - `CodeInterpreterCall object { id, code, container_id, 3 more }`
2169
2170 A tool call to run code.
2171
2172 - `id: string`
2173
2174 The unique ID of the code interpreter tool call.
2175
2176 - `code: string`
2177
2178 The code to run, or null if not available.
2179
2180 - `container_id: string`
2181
2182 The ID of the container used to run the code.
2183
2184 - `outputs: array of object { logs, type } or object { type, url }`
2185
2186 The outputs generated by the code interpreter, such as logs or images.
2187 Can be null if no outputs are available.
2188
2189 - `Logs object { logs, type }`
2190
2191 The logs output from the code interpreter.
2192
2193 - `logs: string`
2194
2195 The logs output from the code interpreter.
2196
2197 - `type: "logs"`
2198
2199 The type of the output. Always `logs`.
2200
2201 - `"logs"`
2202
2203 - `Image object { type, url }`
2204
2205 The image output from the code interpreter.
2206
2207 - `type: "image"`
2208
2209 The type of the output. Always `image`.
2210
2211 - `"image"`
2212
2213 - `url: string`
2214
2215 The URL of the image output from the code interpreter.
2216
2217 - `status: "in_progress" or "completed" or "incomplete" or 2 more`
2218
2219 The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
2220
2221 - `"in_progress"`
2222
2223 - `"completed"`
2224
2225 - `"incomplete"`
2226
2227 - `"interpreting"`
2228
2229 - `"failed"`
2230
2231 - `type: "code_interpreter_call"`
2232
2233 The type of the code interpreter tool call. Always `code_interpreter_call`.
2234
2235 - `"code_interpreter_call"`
2236
2237 - `LocalShellCall object { id, action, call_id, 2 more }`
2238
2239 A tool call to run a command on the local shell.
2240
2241 - `id: string`
2242
2243 The unique ID of the local shell call.
2244
2245 - `action: object { command, env, type, 3 more }`
2246
2247 Execute a shell command on the server.
2248
2249 - `command: array of string`
2250
2251 The command to run.
2252
2253 - `env: map[string]`
2254
2255 Environment variables to set for the command.
2256
2257 - `type: "exec"`
2258
2259 The type of the local shell action. Always `exec`.
2260
2261 - `"exec"`
2262
2263 - `timeout_ms: optional number`
2264
2265 Optional timeout in milliseconds for the command.
2266
2267 - `user: optional string`
2268
2269 Optional user to run the command as.
2270
2271 - `working_directory: optional string`
2272
2273 Optional working directory to run the command in.
2274
2275 - `call_id: string`
2276
2277 The unique ID of the local shell tool call generated by the model.
2278
2279 - `status: "in_progress" or "completed" or "incomplete"`
2280
2281 The status of the local shell call.
2282
2283 - `"in_progress"`
2284
2285 - `"completed"`
2286
2287 - `"incomplete"`
2288
2289 - `type: "local_shell_call"`
2290
2291 The type of the local shell call. Always `local_shell_call`.
2292
2293 - `"local_shell_call"`
2294
2295 - `LocalShellCallOutput object { id, output, type, status }`
2296
2297 The output of a local shell tool call.
2298
2299 - `id: string`
2300
2301 The unique ID of the local shell tool call generated by the model.
2302
2303 - `output: string`
2304
2305 A JSON string of the output of the local shell tool call.
2306
2307 - `type: "local_shell_call_output"`
2308
2309 The type of the local shell tool call output. Always `local_shell_call_output`.
2310
2311 - `"local_shell_call_output"`
2312
2313 - `status: optional "in_progress" or "completed" or "incomplete"`
2314
2315 The status of the item. One of `in_progress`, `completed`, or `incomplete`.
2316
2317 - `"in_progress"`
2318
2319 - `"completed"`
2320
2321 - `"incomplete"`
2322
2323 - `ShellCall object { id, action, call_id, 4 more }`
2324
2325 A tool call that executes one or more shell commands in a managed environment.
2326
2327 - `id: string`
2328
2329 The unique ID of the shell tool call. Populated when this item is returned via API.
2330
2331 - `action: object { commands, max_output_length, timeout_ms }`
2332
2333 The shell commands and limits that describe how to run the tool call.
2334
2335 - `commands: array of string`
2336
2337 - `max_output_length: number`
2338
2339 Optional maximum number of characters to return from each command.
2340
2341 - `timeout_ms: number`
2342
2343 Optional timeout in milliseconds for the commands.
2344
2345 - `call_id: string`
2346
2347 The unique ID of the shell tool call generated by the model.
2348
2349 - `environment: ResponseLocalEnvironment or ResponseContainerReference`
2350
2351 Represents the use of a local environment to perform shell actions.
2352
2353 - `ResponseLocalEnvironment object { type }`
2354
2355 Represents the use of a local environment to perform shell actions.
2356
2357 - `type: "local"`
2358
2359 The environment type. Always `local`.
2360
2361 - `"local"`
2362
2363 - `ResponseContainerReference object { container_id, type }`
2364
2365 Represents a container created with /v1/containers.
2366
2367 - `container_id: string`
2368
2369 - `type: "container_reference"`
2370
2371 The environment type. Always `container_reference`.
2372
2373 - `"container_reference"`
2374
2375 - `status: "in_progress" or "completed" or "incomplete"`
2376
2377 The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
2378
2379 - `"in_progress"`
2380
2381 - `"completed"`
2382
2383 - `"incomplete"`
2384
2385 - `type: "shell_call"`
2386
2387 The type of the item. Always `shell_call`.
2388
2389 - `"shell_call"`
2390
2391 - `created_by: optional string`
2392
2393 The ID of the entity that created this tool call.
2394
2395 - `ShellCallOutput object { id, call_id, max_output_length, 4 more }`
2396
2397 The output of a shell tool call that was emitted.
2398
2399 - `id: string`
2400
2401 The unique ID of the shell call output. Populated when this item is returned via API.
2402
2403 - `call_id: string`
2404
2405 The unique ID of the shell tool call generated by the model.
2406
2407 - `max_output_length: number`
2408
2409 The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
2410
2411 - `output: array of object { outcome, stderr, stdout, created_by }`
2412
2413 An array of shell call output contents
2414
2415 - `outcome: object { type } or object { exit_code, type }`
2416
2417 Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
2418
2419 - `Timeout object { type }`
2420
2421 Indicates that the shell call exceeded its configured time limit.
2422
2423 - `type: "timeout"`
2424
2425 The outcome type. Always `timeout`.
2426
2427 - `"timeout"`
2428
2429 - `Exit object { exit_code, type }`
2430
2431 Indicates that the shell commands finished and returned an exit code.
2432
2433 - `exit_code: number`
2434
2435 Exit code from the shell process.
2436
2437 - `type: "exit"`
2438
2439 The outcome type. Always `exit`.
2440
2441 - `"exit"`
2442
2443 - `stderr: string`
2444
2445 The standard error output that was captured.
2446
2447 - `stdout: string`
2448
2449 The standard output that was captured.
2450
2451 - `created_by: optional string`
2452
2453 The identifier of the actor that created the item.
2454
2455 - `status: "in_progress" or "completed" or "incomplete"`
2456
2457 The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
2458
2459 - `"in_progress"`
2460
2461 - `"completed"`
2462
2463 - `"incomplete"`
2464
2465 - `type: "shell_call_output"`
2466
2467 The type of the shell call output. Always `shell_call_output`.
2468
2469 - `"shell_call_output"`
2470
2471 - `created_by: optional string`
2472
2473 The identifier of the actor that created the item.
2474
2475 - `ApplyPatchCall object { id, call_id, operation, 3 more }`
2476
2477 A tool call that applies file diffs by creating, deleting, or updating files.
2478
2479 - `id: string`
2480
2481 The unique ID of the apply patch tool call. Populated when this item is returned via API.
2482
2483 - `call_id: string`
2484
2485 The unique ID of the apply patch tool call generated by the model.
2486
2487 - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }`
2488
2489 One of the create_file, delete_file, or update_file operations applied via apply_patch.
2490
2491 - `CreateFile object { diff, path, type }`
2492
2493 Instruction describing how to create a file via the apply_patch tool.
2494
2495 - `diff: string`
2496
2497 Diff to apply.
2498
2499 - `path: string`
2500
2501 Path of the file to create.
2502
2503 - `type: "create_file"`
2504
2505 Create a new file with the provided diff.
2506
2507 - `"create_file"`
2508
2509 - `DeleteFile object { path, type }`
2510
2511 Instruction describing how to delete a file via the apply_patch tool.
2512
2513 - `path: string`
2514
2515 Path of the file to delete.
2516
2517 - `type: "delete_file"`
2518
2519 Delete the specified file.
2520
2521 - `"delete_file"`
2522
2523 - `UpdateFile object { diff, path, type }`
2524
2525 Instruction describing how to update a file via the apply_patch tool.
2526
2527 - `diff: string`
2528
2529 Diff to apply.
2530
2531 - `path: string`
2532
2533 Path of the file to update.
2534
2535 - `type: "update_file"`
2536
2537 Update an existing file with the provided diff.
2538
2539 - `"update_file"`
2540
2541 - `status: "in_progress" or "completed"`
2542
2543 The status of the apply patch tool call. One of `in_progress` or `completed`.
2544
2545 - `"in_progress"`
2546
2547 - `"completed"`
2548
2549 - `type: "apply_patch_call"`
2550
2551 The type of the item. Always `apply_patch_call`.
2552
2553 - `"apply_patch_call"`
2554
2555 - `created_by: optional string`
2556
2557 The ID of the entity that created this tool call.
2558
2559 - `ApplyPatchCallOutput object { id, call_id, status, 3 more }`
2560
2561 The output emitted by an apply patch tool call.
2562
2563 - `id: string`
2564
2565 The unique ID of the apply patch tool call output. Populated when this item is returned via API.
2566
2567 - `call_id: string`
2568
2569 The unique ID of the apply patch tool call generated by the model.
2570
2571 - `status: "completed" or "failed"`
2572
2573 The status of the apply patch tool call output. One of `completed` or `failed`.
2574
2575 - `"completed"`
2576
2577 - `"failed"`
2578
2579 - `type: "apply_patch_call_output"`
2580
2581 The type of the item. Always `apply_patch_call_output`.
2582
2583 - `"apply_patch_call_output"`
2584
2585 - `created_by: optional string`
2586
2587 The ID of the entity that created this tool call output.
2588
2589 - `output: optional string`
2590
2591 Optional textual output returned by the apply patch tool.
2592
2593 - `McpListTools object { id, server_label, tools, 2 more }`
2594
2595 A list of tools available on an MCP server.
2596
2597 - `id: string`
2598
2599 The unique ID of the list.
2600
2601 - `server_label: string`
2602
2603 The label of the MCP server.
2604
2605 - `tools: array of object { input_schema, name, annotations, description }`
2606
2607 The tools available on the server.
2608
2609 - `input_schema: unknown`
2610
2611 The JSON schema describing the tool's input.
2612
2613 - `name: string`
2614
2615 The name of the tool.
2616
2617 - `annotations: optional unknown`
2618
2619 Additional annotations about the tool.
2620
2621 - `description: optional string`
2622
2623 The description of the tool.
2624
2625 - `type: "mcp_list_tools"`
2626
2627 The type of the item. Always `mcp_list_tools`.
2628
2629 - `"mcp_list_tools"`
2630
2631 - `error: optional string`
2632
2633 Error message if the server could not list tools.
2634
2635 - `McpApprovalRequest object { id, arguments, name, 2 more }`
2636
2637 A request for human approval of a tool invocation.
2638
2639 - `id: string`
2640
2641 The unique ID of the approval request.
2642
2643 - `arguments: string`
2644
2645 A JSON string of arguments for the tool.
2646
2647 - `name: string`
2648
2649 The name of the tool to run.
2650
2651 - `server_label: string`
2652
2653 The label of the MCP server making the request.
2654
2655 - `type: "mcp_approval_request"`
2656
2657 The type of the item. Always `mcp_approval_request`.
2658
2659 - `"mcp_approval_request"`
2660
2661 - `McpApprovalResponse object { id, approval_request_id, approve, 2 more }`
2662
2663 A response to an MCP approval request.
2664
2665 - `id: string`
2666
2667 The unique ID of the approval response
2668
2669 - `approval_request_id: string`
2670
2671 The ID of the approval request being answered.
2672
2673 - `approve: boolean`
2674
2675 Whether the request was approved.
2676
2677 - `type: "mcp_approval_response"`
2678
2679 The type of the item. Always `mcp_approval_response`.
2680
2681 - `"mcp_approval_response"`
2682
2683 - `reason: optional string`
2684
2685 Optional reason for the decision.
2686
2687 - `McpCall object { id, arguments, name, 6 more }`
2688
2689 An invocation of a tool on an MCP server.
2690
2691 - `id: string`
2692
2693 The unique ID of the tool call.
2694
2695 - `arguments: string`
2696
2697 A JSON string of the arguments passed to the tool.
2698
2699 - `name: string`
2700
2701 The name of the tool that was run.
2702
2703 - `server_label: string`
2704
2705 The label of the MCP server running the tool.
2706
2707 - `type: "mcp_call"`
2708
2709 The type of the item. Always `mcp_call`.
2710
2711 - `"mcp_call"`
2712
2713 - `approval_request_id: optional string`
2714
2715 Unique identifier for the MCP tool call approval request.
2716 Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.
2717
2718 - `error: optional string`
2719
2720 The error from the tool call, if any.
2721
2722 - `output: optional string`
2723
2724 The output from the tool call.
2725
2726 - `status: optional "in_progress" or "completed" or "incomplete" or 2 more`
2727
2728 The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
2729
2730 - `"in_progress"`
2731
2732 - `"completed"`
2733
2734 - `"incomplete"`
2735
2736 - `"calling"`
2737
2738 - `"failed"`
2739
2740 - `CustomToolCall object { call_id, input, name, 3 more }`
2741
2742 A call to a custom tool created by the model.
2743
2744 - `call_id: string`
2745
2746 An identifier used to map this custom tool call to a tool call output.
2747
2748 - `input: string`
2749
2750 The input for the custom tool call generated by the model.
2751
2752 - `name: string`
2753
2754 The name of the custom tool being called.
2755
2756 - `type: "custom_tool_call"`
2757
2758 The type of the custom tool call. Always `custom_tool_call`.
2759
2760 - `"custom_tool_call"`
2761
2762 - `id: optional string`
2763
2764 The unique ID of the custom tool call in the OpenAI platform.
2765
2766 - `namespace: optional string`
2767
2768 The namespace of the custom tool being called.
2769
2770 - `CustomToolCallOutput object { call_id, output, type, id }`
2771
2772 The output of a custom tool call from your code, being sent back to the model.
2773
2774 - `call_id: string`
2775
2776 The call ID, used to map this custom tool call output to a custom tool call.
2777
2778 - `output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFile`
2779
2780 The output from the custom tool call generated by your code.
2781 Can be a string or an list of output content.
2782
2783 - `StringOutput = string`
2784
2785 A string of the output of the custom tool call.
2786
2787 - `OutputContentList = array of ResponseInputText or ResponseInputImage or ResponseInputFile`
2788
2789 Text, image, or file output of the custom tool call.
2790
2791 - `ResponseInputText object { text, type }`
2792
2793 A text input to the model.
2794
2795 - `ResponseInputImage object { detail, type, file_id, image_url }`
2796
2797 An image input to the model. Learn about [image inputs](/docs/guides/vision).
2798
2799 - `ResponseInputFile object { type, detail, file_data, 3 more }`
2800
2801 A file input to the model.
2802
2803 - `type: "custom_tool_call_output"`
2804
2805 The type of the custom tool call output. Always `custom_tool_call_output`.
2806
2807 - `"custom_tool_call_output"`
2808
2809 - `id: optional string`
2810
2811 The unique ID of the custom tool call output in the OpenAI platform.
2812
2813### Example
2814
2815```http
2816curl https://api.openai.com/v1/conversations/$CONVERSATION_ID/items/$ITEM_ID \
2817 -H "Authorization: Bearer $OPENAI_API_KEY"
2818```
2819
2820#### Response
2821
2822```json
2823{
2824 "id": "id",
2825 "content": [
2826 {
2827 "text": "text",
2828 "type": "input_text"
2829 }
2830 ],
2831 "role": "unknown",
2832 "status": "in_progress",
2833 "type": "message",
2834 "phase": "commentary"
2835}
2836```
2837
2838### Example
2839
2840```http
2841curl https://api.openai.com/v1/conversations/conv_123/items/msg_abc \
2842 -H "Authorization: Bearer $OPENAI_API_KEY"
2843```
2844
2845#### Response
2846
2847```json
2848{
2849 "type": "message",
2850 "id": "msg_abc",
2851 "status": "completed",
2852 "role": "user",
2853 "content": [
2854 {"type": "input_text", "text": "Hello!"}
2855 ]
2856}
2857```