go/resources/conversations/methods/create/index.md +0 −3036 deleted
File Deleted View Diff
1## Create a conversation
2
3`client.Conversations.New(ctx, body) (*Conversation, error)`
4
5**post** `/conversations`
6
7Create a conversation.
8
9### Parameters
10
11- `body ConversationNewParams`
12
13 - `Items param.Field[[]ResponseInputItemUnion]`
14
15 Initial items to include in the conversation context. You may add up to 20 items at a time.
16
17 - `type EasyInputMessage struct{…}`
18
19 A message input to the model with a role indicating instruction following
20 hierarchy. Instructions given with the `developer` or `system` role take
21 precedence over instructions given with the `user` role. Messages with the
22 `assistant` role are presumed to have been generated by the model in previous
23 interactions.
24
25 - `Content EasyInputMessageContentUnion`
26
27 Text, image, or audio input to the model, used to generate a response.
28 Can also contain previous assistant responses.
29
30 - `string`
31
32 - `type ResponseInputMessageContentList []ResponseInputContentUnion`
33
34 A list of one or many input items to the model, containing different content
35 types.
36
37 - `type ResponseInputText struct{…}`
38
39 A text input to the model.
40
41 - `Text string`
42
43 The text input to the model.
44
45 - `Type InputText`
46
47 The type of the input item. Always `input_text`.
48
49 - `const InputTextInputText InputText = "input_text"`
50
51 - `type ResponseInputImage struct{…}`
52
53 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
54
55 - `Detail ResponseInputImageDetail`
56
57 The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
58
59 - `const ResponseInputImageDetailLow ResponseInputImageDetail = "low"`
60
61 - `const ResponseInputImageDetailHigh ResponseInputImageDetail = "high"`
62
63 - `const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto"`
64
65 - `const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"`
66
67 - `Type InputImage`
68
69 The type of the input item. Always `input_image`.
70
71 - `const InputImageInputImage InputImage = "input_image"`
72
73 - `FileID string`
74
75 The ID of the file to be sent to the model.
76
77 - `ImageURL string`
78
79 The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
80
81 - `type ResponseInputFile struct{…}`
82
83 A file input to the model.
84
85 - `Type InputFile`
86
87 The type of the input item. Always `input_file`.
88
89 - `const InputFileInputFile InputFile = "input_file"`
90
91 - `Detail ResponseInputFileDetail`
92
93 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`.
94
95 - `const ResponseInputFileDetailLow ResponseInputFileDetail = "low"`
96
97 - `const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"`
98
99 - `FileData string`
100
101 The content of the file to be sent to the model.
102
103 - `FileID string`
104
105 The ID of the file to be sent to the model.
106
107 - `FileURL string`
108
109 The URL of the file to be sent to the model.
110
111 - `Filename string`
112
113 The name of the file to be sent to the model.
114
115 - `Role EasyInputMessageRole`
116
117 The role of the message input. One of `user`, `assistant`, `system`, or
118 `developer`.
119
120 - `const EasyInputMessageRoleUser EasyInputMessageRole = "user"`
121
122 - `const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant"`
123
124 - `const EasyInputMessageRoleSystem EasyInputMessageRole = "system"`
125
126 - `const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"`
127
128 - `Phase EasyInputMessagePhase`
129
130 Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
131 For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
132 phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
133
134 - `const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary"`
135
136 - `const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"`
137
138 - `Type EasyInputMessageType`
139
140 The type of the message input. Always `message`.
141
142 - `const EasyInputMessageTypeMessage EasyInputMessageType = "message"`
143
144 - `type ResponseInputItemMessage struct{…}`
145
146 A message input to the model with a role indicating instruction following
147 hierarchy. Instructions given with the `developer` or `system` role take
148 precedence over instructions given with the `user` role.
149
150 - `Content ResponseInputMessageContentList`
151
152 A list of one or many input items to the model, containing different content
153 types.
154
155 - `Role string`
156
157 The role of the message input. One of `user`, `system`, or `developer`.
158
159 - `const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user"`
160
161 - `const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system"`
162
163 - `const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"`
164
165 - `Status string`
166
167 The status of item. One of `in_progress`, `completed`, or
168 `incomplete`. Populated when items are returned via API.
169
170 - `const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress"`
171
172 - `const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed"`
173
174 - `const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"`
175
176 - `Type string`
177
178 The type of the message input. Always set to `message`.
179
180 - `const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"`
181
182 - `type ResponseOutputMessage struct{…}`
183
184 An output message from the model.
185
186 - `ID string`
187
188 The unique ID of the output message.
189
190 - `Content []ResponseOutputMessageContentUnion`
191
192 The content of the output message.
193
194 - `type ResponseOutputText struct{…}`
195
196 A text output from the model.
197
198 - `Annotations []ResponseOutputTextAnnotationUnion`
199
200 The annotations of the text output.
201
202 - `type ResponseOutputTextAnnotationFileCitation struct{…}`
203
204 A citation to a file.
205
206 - `FileID string`
207
208 The ID of the file.
209
210 - `Filename string`
211
212 The filename of the file cited.
213
214 - `Index int64`
215
216 The index of the file in the list of files.
217
218 - `Type FileCitation`
219
220 The type of the file citation. Always `file_citation`.
221
222 - `const FileCitationFileCitation FileCitation = "file_citation"`
223
224 - `type ResponseOutputTextAnnotationURLCitation struct{…}`
225
226 A citation for a web resource used to generate a model response.
227
228 - `EndIndex int64`
229
230 The index of the last character of the URL citation in the message.
231
232 - `StartIndex int64`
233
234 The index of the first character of the URL citation in the message.
235
236 - `Title string`
237
238 The title of the web resource.
239
240 - `Type URLCitation`
241
242 The type of the URL citation. Always `url_citation`.
243
244 - `const URLCitationURLCitation URLCitation = "url_citation"`
245
246 - `URL string`
247
248 The URL of the web resource.
249
250 - `type ResponseOutputTextAnnotationContainerFileCitation struct{…}`
251
252 A citation for a container file used to generate a model response.
253
254 - `ContainerID string`
255
256 The ID of the container file.
257
258 - `EndIndex int64`
259
260 The index of the last character of the container file citation in the message.
261
262 - `FileID string`
263
264 The ID of the file.
265
266 - `Filename string`
267
268 The filename of the container file cited.
269
270 - `StartIndex int64`
271
272 The index of the first character of the container file citation in the message.
273
274 - `Type ContainerFileCitation`
275
276 The type of the container file citation. Always `container_file_citation`.
277
278 - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"`
279
280 - `type ResponseOutputTextAnnotationFilePath struct{…}`
281
282 A path to a file.
283
284 - `FileID string`
285
286 The ID of the file.
287
288 - `Index int64`
289
290 The index of the file in the list of files.
291
292 - `Type FilePath`
293
294 The type of the file path. Always `file_path`.
295
296 - `const FilePathFilePath FilePath = "file_path"`
297
298 - `Text string`
299
300 The text output from the model.
301
302 - `Type OutputText`
303
304 The type of the output text. Always `output_text`.
305
306 - `const OutputTextOutputText OutputText = "output_text"`
307
308 - `Logprobs []ResponseOutputTextLogprob`
309
310 - `Token string`
311
312 - `Bytes []int64`
313
314 - `Logprob float64`
315
316 - `TopLogprobs []ResponseOutputTextLogprobTopLogprob`
317
318 - `Token string`
319
320 - `Bytes []int64`
321
322 - `Logprob float64`
323
324 - `type ResponseOutputRefusal struct{…}`
325
326 A refusal from the model.
327
328 - `Refusal string`
329
330 The refusal explanation from the model.
331
332 - `Type Refusal`
333
334 The type of the refusal. Always `refusal`.
335
336 - `const RefusalRefusal Refusal = "refusal"`
337
338 - `Role Assistant`
339
340 The role of the output message. Always `assistant`.
341
342 - `const AssistantAssistant Assistant = "assistant"`
343
344 - `Status ResponseOutputMessageStatus`
345
346 The status of the message input. One of `in_progress`, `completed`, or
347 `incomplete`. Populated when input items are returned via API.
348
349 - `const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress"`
350
351 - `const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed"`
352
353 - `const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"`
354
355 - `Type Message`
356
357 The type of the output message. Always `message`.
358
359 - `const MessageMessage Message = "message"`
360
361 - `Phase ResponseOutputMessagePhase`
362
363 Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
364 For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
365 phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
366
367 - `const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary"`
368
369 - `const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"`
370
371 - `type ResponseFileSearchToolCall struct{…}`
372
373 The results of a file search tool call. See the
374 [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.
375
376 - `ID string`
377
378 The unique ID of the file search tool call.
379
380 - `Queries []string`
381
382 The queries used to search for files.
383
384 - `Status ResponseFileSearchToolCallStatus`
385
386 The status of the file search tool call. One of `in_progress`,
387 `searching`, `incomplete` or `failed`,
388
389 - `const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress"`
390
391 - `const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching"`
392
393 - `const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed"`
394
395 - `const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete"`
396
397 - `const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"`
398
399 - `Type FileSearchCall`
400
401 The type of the file search tool call. Always `file_search_call`.
402
403 - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"`
404
405 - `Results []ResponseFileSearchToolCallResult`
406
407 The results of the file search tool call.
408
409 - `Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]`
410
411 Set of 16 key-value pairs that can be attached to an object. This can be
412 useful for storing additional information about the object in a structured
413 format, and querying for objects via API or the dashboard. Keys are strings
414 with a maximum length of 64 characters. Values are strings with a maximum
415 length of 512 characters, booleans, or numbers.
416
417 - `string`
418
419 - `float64`
420
421 - `bool`
422
423 - `FileID string`
424
425 The unique ID of the file.
426
427 - `Filename string`
428
429 The name of the file.
430
431 - `Score float64`
432
433 The relevance score of the file - a value between 0 and 1.
434
435 - `Text string`
436
437 The text that was retrieved from the file.
438
439 - `type ResponseComputerToolCall struct{…}`
440
441 A tool call to a computer use tool. See the
442 [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.
443
444 - `ID string`
445
446 The unique ID of the computer call.
447
448 - `CallID string`
449
450 An identifier used when responding to the tool call with output.
451
452 - `PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheck`
453
454 The pending safety checks for the computer call.
455
456 - `ID string`
457
458 The ID of the pending safety check.
459
460 - `Code string`
461
462 The type of the pending safety check.
463
464 - `Message string`
465
466 Details about the pending safety check.
467
468 - `Status ResponseComputerToolCallStatus`
469
470 The status of the item. One of `in_progress`, `completed`, or
471 `incomplete`. Populated when items are returned via API.
472
473 - `const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress"`
474
475 - `const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed"`
476
477 - `const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"`
478
479 - `Type ResponseComputerToolCallType`
480
481 The type of the computer call. Always `computer_call`.
482
483 - `const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"`
484
485 - `Action ResponseComputerToolCallActionUnion`
486
487 A click action.
488
489 - `type ResponseComputerToolCallActionClick struct{…}`
490
491 A click action.
492
493 - `Button string`
494
495 Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
496
497 - `const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left"`
498
499 - `const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right"`
500
501 - `const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel"`
502
503 - `const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back"`
504
505 - `const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"`
506
507 - `Type Click`
508
509 Specifies the event type. For a click action, this property is always `click`.
510
511 - `const ClickClick Click = "click"`
512
513 - `X int64`
514
515 The x-coordinate where the click occurred.
516
517 - `Y int64`
518
519 The y-coordinate where the click occurred.
520
521 - `Keys []string`
522
523 The keys being held while clicking.
524
525 - `type ResponseComputerToolCallActionDoubleClick struct{…}`
526
527 A double click action.
528
529 - `Keys []string`
530
531 The keys being held while double-clicking.
532
533 - `Type DoubleClick`
534
535 Specifies the event type. For a double click action, this property is always set to `double_click`.
536
537 - `const DoubleClickDoubleClick DoubleClick = "double_click"`
538
539 - `X int64`
540
541 The x-coordinate where the double click occurred.
542
543 - `Y int64`
544
545 The y-coordinate where the double click occurred.
546
547 - `type ResponseComputerToolCallActionDrag struct{…}`
548
549 A drag action.
550
551 - `Path []ResponseComputerToolCallActionDragPath`
552
553 An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
554
555 ```
556 [
557 { x: 100, y: 200 },
558 { x: 200, y: 300 }
559 ]
560 ```
561
562 - `X int64`
563
564 The x-coordinate.
565
566 - `Y int64`
567
568 The y-coordinate.
569
570 - `Type Drag`
571
572 Specifies the event type. For a drag action, this property is always set to `drag`.
573
574 - `const DragDrag Drag = "drag"`
575
576 - `Keys []string`
577
578 The keys being held while dragging the mouse.
579
580 - `type ResponseComputerToolCallActionKeypress struct{…}`
581
582 A collection of keypresses the model would like to perform.
583
584 - `Keys []string`
585
586 The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
587
588 - `Type Keypress`
589
590 Specifies the event type. For a keypress action, this property is always set to `keypress`.
591
592 - `const KeypressKeypress Keypress = "keypress"`
593
594 - `type ResponseComputerToolCallActionMove struct{…}`
595
596 A mouse move action.
597
598 - `Type Move`
599
600 Specifies the event type. For a move action, this property is always set to `move`.
601
602 - `const MoveMove Move = "move"`
603
604 - `X int64`
605
606 The x-coordinate to move to.
607
608 - `Y int64`
609
610 The y-coordinate to move to.
611
612 - `Keys []string`
613
614 The keys being held while moving the mouse.
615
616 - `type ResponseComputerToolCallActionScreenshot struct{…}`
617
618 A screenshot action.
619
620 - `Type Screenshot`
621
622 Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
623
624 - `const ScreenshotScreenshot Screenshot = "screenshot"`
625
626 - `type ResponseComputerToolCallActionScroll struct{…}`
627
628 A scroll action.
629
630 - `ScrollX int64`
631
632 The horizontal scroll distance.
633
634 - `ScrollY int64`
635
636 The vertical scroll distance.
637
638 - `Type Scroll`
639
640 Specifies the event type. For a scroll action, this property is always set to `scroll`.
641
642 - `const ScrollScroll Scroll = "scroll"`
643
644 - `X int64`
645
646 The x-coordinate where the scroll occurred.
647
648 - `Y int64`
649
650 The y-coordinate where the scroll occurred.
651
652 - `Keys []string`
653
654 The keys being held while scrolling.
655
656 - `type ResponseComputerToolCallActionType struct{…}`
657
658 An action to type in text.
659
660 - `Text string`
661
662 The text to type.
663
664 - `Type Type`
665
666 Specifies the event type. For a type action, this property is always set to `type`.
667
668 - `const TypeType Type = "type"`
669
670 - `type ResponseComputerToolCallActionWait struct{…}`
671
672 A wait action.
673
674 - `Type Wait`
675
676 Specifies the event type. For a wait action, this property is always set to `wait`.
677
678 - `const WaitWait Wait = "wait"`
679
680 - `Actions ComputerActionList`
681
682 Flattened batched actions for `computer_use`. Each action includes an
683 `type` discriminator and action-specific fields.
684
685 - `type ComputerActionClick struct{…}`
686
687 A click action.
688
689 - `Button string`
690
691 Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
692
693 - `const ComputerActionClickButtonLeft ComputerActionClickButton = "left"`
694
695 - `const ComputerActionClickButtonRight ComputerActionClickButton = "right"`
696
697 - `const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel"`
698
699 - `const ComputerActionClickButtonBack ComputerActionClickButton = "back"`
700
701 - `const ComputerActionClickButtonForward ComputerActionClickButton = "forward"`
702
703 - `Type Click`
704
705 Specifies the event type. For a click action, this property is always `click`.
706
707 - `const ClickClick Click = "click"`
708
709 - `X int64`
710
711 The x-coordinate where the click occurred.
712
713 - `Y int64`
714
715 The y-coordinate where the click occurred.
716
717 - `Keys []string`
718
719 The keys being held while clicking.
720
721 - `type ComputerActionDoubleClick struct{…}`
722
723 A double click action.
724
725 - `Keys []string`
726
727 The keys being held while double-clicking.
728
729 - `Type DoubleClick`
730
731 Specifies the event type. For a double click action, this property is always set to `double_click`.
732
733 - `const DoubleClickDoubleClick DoubleClick = "double_click"`
734
735 - `X int64`
736
737 The x-coordinate where the double click occurred.
738
739 - `Y int64`
740
741 The y-coordinate where the double click occurred.
742
743 - `type ComputerActionDrag struct{…}`
744
745 A drag action.
746
747 - `Path []ComputerActionDragPath`
748
749 An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
750
751 ```
752 [
753 { x: 100, y: 200 },
754 { x: 200, y: 300 }
755 ]
756 ```
757
758 - `X int64`
759
760 The x-coordinate.
761
762 - `Y int64`
763
764 The y-coordinate.
765
766 - `Type Drag`
767
768 Specifies the event type. For a drag action, this property is always set to `drag`.
769
770 - `const DragDrag Drag = "drag"`
771
772 - `Keys []string`
773
774 The keys being held while dragging the mouse.
775
776 - `type ComputerActionKeypress struct{…}`
777
778 A collection of keypresses the model would like to perform.
779
780 - `Keys []string`
781
782 The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
783
784 - `Type Keypress`
785
786 Specifies the event type. For a keypress action, this property is always set to `keypress`.
787
788 - `const KeypressKeypress Keypress = "keypress"`
789
790 - `type ComputerActionMove struct{…}`
791
792 A mouse move action.
793
794 - `Type Move`
795
796 Specifies the event type. For a move action, this property is always set to `move`.
797
798 - `const MoveMove Move = "move"`
799
800 - `X int64`
801
802 The x-coordinate to move to.
803
804 - `Y int64`
805
806 The y-coordinate to move to.
807
808 - `Keys []string`
809
810 The keys being held while moving the mouse.
811
812 - `type ComputerActionScreenshot struct{…}`
813
814 A screenshot action.
815
816 - `Type Screenshot`
817
818 Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
819
820 - `const ScreenshotScreenshot Screenshot = "screenshot"`
821
822 - `type ComputerActionScroll struct{…}`
823
824 A scroll action.
825
826 - `ScrollX int64`
827
828 The horizontal scroll distance.
829
830 - `ScrollY int64`
831
832 The vertical scroll distance.
833
834 - `Type Scroll`
835
836 Specifies the event type. For a scroll action, this property is always set to `scroll`.
837
838 - `const ScrollScroll Scroll = "scroll"`
839
840 - `X int64`
841
842 The x-coordinate where the scroll occurred.
843
844 - `Y int64`
845
846 The y-coordinate where the scroll occurred.
847
848 - `Keys []string`
849
850 The keys being held while scrolling.
851
852 - `type ComputerActionType struct{…}`
853
854 An action to type in text.
855
856 - `Text string`
857
858 The text to type.
859
860 - `Type Type`
861
862 Specifies the event type. For a type action, this property is always set to `type`.
863
864 - `const TypeType Type = "type"`
865
866 - `type ComputerActionWait struct{…}`
867
868 A wait action.
869
870 - `Type Wait`
871
872 Specifies the event type. For a wait action, this property is always set to `wait`.
873
874 - `const WaitWait Wait = "wait"`
875
876 - `type ResponseInputItemComputerCallOutput struct{…}`
877
878 The output of a computer tool call.
879
880 - `CallID string`
881
882 The ID of the computer tool call that produced the output.
883
884 - `Output ResponseComputerToolCallOutputScreenshot`
885
886 A computer screenshot image used with the computer use tool.
887
888 - `Type ComputerScreenshot`
889
890 Specifies the event type. For a computer screenshot, this property is
891 always set to `computer_screenshot`.
892
893 - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"`
894
895 - `FileID string`
896
897 The identifier of an uploaded file that contains the screenshot.
898
899 - `ImageURL string`
900
901 The URL of the screenshot image.
902
903 - `Type ComputerCallOutput`
904
905 The type of the computer tool call output. Always `computer_call_output`.
906
907 - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"`
908
909 - `ID string`
910
911 The ID of the computer tool call output.
912
913 - `AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheck`
914
915 The safety checks reported by the API that have been acknowledged by the developer.
916
917 - `ID string`
918
919 The ID of the pending safety check.
920
921 - `Code string`
922
923 The type of the pending safety check.
924
925 - `Message string`
926
927 Details about the pending safety check.
928
929 - `Status string`
930
931 The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.
932
933 - `const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress"`
934
935 - `const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed"`
936
937 - `const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"`
938
939 - `type ResponseFunctionWebSearch struct{…}`
940
941 The results of a web search tool call. See the
942 [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.
943
944 - `ID string`
945
946 The unique ID of the web search tool call.
947
948 - `Action ResponseFunctionWebSearchActionUnion`
949
950 An object describing the specific action taken in this web search call.
951 Includes details on how the model used the web (search, open_page, find_in_page).
952
953 - `type ResponseFunctionWebSearchActionSearch struct{…}`
954
955 Action type "search" - Performs a web search query.
956
957 - `Query string`
958
959 [DEPRECATED] The search query.
960
961 - `Type Search`
962
963 The action type.
964
965 - `const SearchSearch Search = "search"`
966
967 - `Queries []string`
968
969 The search queries.
970
971 - `Sources []ResponseFunctionWebSearchActionSearchSource`
972
973 The sources used in the search.
974
975 - `Type URL`
976
977 The type of source. Always `url`.
978
979 - `const URLURL URL = "url"`
980
981 - `URL string`
982
983 The URL of the source.
984
985 - `type ResponseFunctionWebSearchActionOpenPage struct{…}`
986
987 Action type "open_page" - Opens a specific URL from search results.
988
989 - `Type OpenPage`
990
991 The action type.
992
993 - `const OpenPageOpenPage OpenPage = "open_page"`
994
995 - `URL string`
996
997 The URL opened by the model.
998
999 - `type ResponseFunctionWebSearchActionFindInPage struct{…}`
1000
1001 Action type "find_in_page": Searches for a pattern within a loaded page.
1002
1003 - `Pattern string`
1004
1005 The pattern or text to search for within the page.
1006
1007 - `Type FindInPage`
1008
1009 The action type.
1010
1011 - `const FindInPageFindInPage FindInPage = "find_in_page"`
1012
1013 - `URL string`
1014
1015 The URL of the page searched for the pattern.
1016
1017 - `Status ResponseFunctionWebSearchStatus`
1018
1019 The status of the web search tool call.
1020
1021 - `const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress"`
1022
1023 - `const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching"`
1024
1025 - `const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed"`
1026
1027 - `const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"`
1028
1029 - `Type WebSearchCall`
1030
1031 The type of the web search tool call. Always `web_search_call`.
1032
1033 - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"`
1034
1035 - `type ResponseFunctionToolCall struct{…}`
1036
1037 A tool call to run a function. See the
1038 [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.
1039
1040 - `Arguments string`
1041
1042 A JSON string of the arguments to pass to the function.
1043
1044 - `CallID string`
1045
1046 The unique ID of the function tool call generated by the model.
1047
1048 - `Name string`
1049
1050 The name of the function to run.
1051
1052 - `Type FunctionCall`
1053
1054 The type of the function tool call. Always `function_call`.
1055
1056 - `const FunctionCallFunctionCall FunctionCall = "function_call"`
1057
1058 - `ID string`
1059
1060 The unique ID of the function tool call.
1061
1062 - `Namespace string`
1063
1064 The namespace of the function to run.
1065
1066 - `Status ResponseFunctionToolCallStatus`
1067
1068 The status of the item. One of `in_progress`, `completed`, or
1069 `incomplete`. Populated when items are returned via API.
1070
1071 - `const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress"`
1072
1073 - `const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed"`
1074
1075 - `const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"`
1076
1077 - `type ResponseInputItemFunctionCallOutput struct{…}`
1078
1079 The output of a function tool call.
1080
1081 - `CallID string`
1082
1083 The unique ID of the function tool call generated by the model.
1084
1085 - `Output ResponseInputItemFunctionCallOutputOutputUnion`
1086
1087 Text, image, or file output of the function tool call.
1088
1089 - `string`
1090
1091 - `type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnion`
1092
1093 An array of content outputs (text, image, file) for the function tool call.
1094
1095 - `type ResponseInputTextContent struct{…}`
1096
1097 A text input to the model.
1098
1099 - `Text string`
1100
1101 The text input to the model.
1102
1103 - `Type InputText`
1104
1105 The type of the input item. Always `input_text`.
1106
1107 - `const InputTextInputText InputText = "input_text"`
1108
1109 - `type ResponseInputImageContent struct{…}`
1110
1111 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)
1112
1113 - `Type InputImage`
1114
1115 The type of the input item. Always `input_image`.
1116
1117 - `const InputImageInputImage InputImage = "input_image"`
1118
1119 - `Detail ResponseInputImageContentDetail`
1120
1121 The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
1122
1123 - `const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low"`
1124
1125 - `const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high"`
1126
1127 - `const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto"`
1128
1129 - `const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"`
1130
1131 - `FileID string`
1132
1133 The ID of the file to be sent to the model.
1134
1135 - `ImageURL string`
1136
1137 The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
1138
1139 - `type ResponseInputFileContent struct{…}`
1140
1141 A file input to the model.
1142
1143 - `Type InputFile`
1144
1145 The type of the input item. Always `input_file`.
1146
1147 - `const InputFileInputFile InputFile = "input_file"`
1148
1149 - `Detail ResponseInputFileContentDetail`
1150
1151 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`.
1152
1153 - `const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low"`
1154
1155 - `const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"`
1156
1157 - `FileData string`
1158
1159 The base64-encoded data of the file to be sent to the model.
1160
1161 - `FileID string`
1162
1163 The ID of the file to be sent to the model.
1164
1165 - `FileURL string`
1166
1167 The URL of the file to be sent to the model.
1168
1169 - `Filename string`
1170
1171 The name of the file to be sent to the model.
1172
1173 - `Type FunctionCallOutput`
1174
1175 The type of the function tool call output. Always `function_call_output`.
1176
1177 - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"`
1178
1179 - `ID string`
1180
1181 The unique ID of the function tool call output. Populated when this item is returned via API.
1182
1183 - `Status string`
1184
1185 The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
1186
1187 - `const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress"`
1188
1189 - `const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed"`
1190
1191 - `const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"`
1192
1193 - `type ResponseInputItemToolSearchCall struct{…}`
1194
1195 - `Arguments any`
1196
1197 The arguments supplied to the tool search call.
1198
1199 - `Type ToolSearchCall`
1200
1201 The item type. Always `tool_search_call`.
1202
1203 - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"`
1204
1205 - `ID string`
1206
1207 The unique ID of this tool search call.
1208
1209 - `CallID string`
1210
1211 The unique ID of the tool search call generated by the model.
1212
1213 - `Execution string`
1214
1215 Whether tool search was executed by the server or by the client.
1216
1217 - `const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server"`
1218
1219 - `const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"`
1220
1221 - `Status string`
1222
1223 The status of the tool search call.
1224
1225 - `const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress"`
1226
1227 - `const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed"`
1228
1229 - `const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"`
1230
1231 - `type ResponseToolSearchOutputItemParamResp struct{…}`
1232
1233 - `Tools []ToolUnion`
1234
1235 The loaded tool definitions returned by the tool search output.
1236
1237 - `type FunctionTool struct{…}`
1238
1239 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).
1240
1241 - `Name string`
1242
1243 The name of the function to call.
1244
1245 - `Parameters map[string, any]`
1246
1247 A JSON schema object describing the parameters of the function.
1248
1249 - `Strict bool`
1250
1251 Whether to enforce strict parameter validation. Default `true`.
1252
1253 - `Type Function`
1254
1255 The type of the function tool. Always `function`.
1256
1257 - `const FunctionFunction Function = "function"`
1258
1259 - `DeferLoading bool`
1260
1261 Whether this function is deferred and loaded via tool search.
1262
1263 - `Description string`
1264
1265 A description of the function. Used by the model to determine whether or not to call the function.
1266
1267 - `type FileSearchTool struct{…}`
1268
1269 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).
1270
1271 - `Type FileSearch`
1272
1273 The type of the file search tool. Always `file_search`.
1274
1275 - `const FileSearchFileSearch FileSearch = "file_search"`
1276
1277 - `VectorStoreIDs []string`
1278
1279 The IDs of the vector stores to search.
1280
1281 - `Filters FileSearchToolFiltersUnion`
1282
1283 A filter to apply.
1284
1285 - `type ComparisonFilter struct{…}`
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 ComparisonFilterType`
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 - `const ComparisonFilterTypeEq ComparisonFilterType = "eq"`
1307
1308 - `const ComparisonFilterTypeNe ComparisonFilterType = "ne"`
1309
1310 - `const ComparisonFilterTypeGt ComparisonFilterType = "gt"`
1311
1312 - `const ComparisonFilterTypeGte ComparisonFilterType = "gte"`
1313
1314 - `const ComparisonFilterTypeLt ComparisonFilterType = "lt"`
1315
1316 - `const ComparisonFilterTypeLte ComparisonFilterType = "lte"`
1317
1318 - `const ComparisonFilterTypeIn ComparisonFilterType = "in"`
1319
1320 - `const ComparisonFilterTypeNin ComparisonFilterType = "nin"`
1321
1322 - `Value ComparisonFilterValueUnion`
1323
1324 The value to compare against the attribute key; supports string, number, or boolean types.
1325
1326 - `string`
1327
1328 - `float64`
1329
1330 - `bool`
1331
1332 - `type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion`
1333
1334 - `string`
1335
1336 - `float64`
1337
1338 - `type CompoundFilter struct{…}`
1339
1340 Combine multiple filters using `and` or `or`.
1341
1342 - `Filters []ComparisonFilter`
1343
1344 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
1345
1346 - `type ComparisonFilter struct{…}`
1347
1348 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
1349
1350 - `Type CompoundFilterType`
1351
1352 Type of operation: `and` or `or`.
1353
1354 - `const CompoundFilterTypeAnd CompoundFilterType = "and"`
1355
1356 - `const CompoundFilterTypeOr CompoundFilterType = "or"`
1357
1358 - `MaxNumResults int64`
1359
1360 The maximum number of results to return. This number should be between 1 and 50 inclusive.
1361
1362 - `RankingOptions FileSearchToolRankingOptions`
1363
1364 Ranking options for search.
1365
1366 - `HybridSearch FileSearchToolRankingOptionsHybridSearch`
1367
1368 Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
1369
1370 - `EmbeddingWeight float64`
1371
1372 The weight of the embedding in the reciprocal ranking fusion.
1373
1374 - `TextWeight float64`
1375
1376 The weight of the text in the reciprocal ranking fusion.
1377
1378 - `Ranker string`
1379
1380 The ranker to use for the file search.
1381
1382 - `const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto"`
1383
1384 - `const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"`
1385
1386 - `ScoreThreshold float64`
1387
1388 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.
1389
1390 - `type ComputerTool struct{…}`
1391
1392 A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
1393
1394 - `Type Computer`
1395
1396 The type of the computer tool. Always `computer`.
1397
1398 - `const ComputerComputer Computer = "computer"`
1399
1400 - `type ComputerUsePreviewTool struct{…}`
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 - `DisplayHeight int64`
1405
1406 The height of the computer display.
1407
1408 - `DisplayWidth int64`
1409
1410 The width of the computer display.
1411
1412 - `Environment ComputerUsePreviewToolEnvironment`
1413
1414 The type of computer environment to control.
1415
1416 - `const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows"`
1417
1418 - `const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac"`
1419
1420 - `const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux"`
1421
1422 - `const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu"`
1423
1424 - `const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"`
1425
1426 - `Type ComputerUsePreview`
1427
1428 The type of the computer use tool. Always `computer_use_preview`.
1429
1430 - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"`
1431
1432 - `type WebSearchTool struct{…}`
1433
1434 Search the Internet for sources related to the prompt. Learn more about the
1435 [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
1436
1437 - `Type WebSearchToolType`
1438
1439 The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
1440
1441 - `const WebSearchToolTypeWebSearch WebSearchToolType = "web_search"`
1442
1443 - `const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"`
1444
1445 - `Filters WebSearchToolFilters`
1446
1447 Filters for the search.
1448
1449 - `AllowedDomains []string`
1450
1451 Allowed domains for the search. If not provided, all domains are allowed.
1452 Subdomains of the provided domains are allowed as well.
1453
1454 Example: `["pubmed.ncbi.nlm.nih.gov"]`
1455
1456 - `SearchContextSize WebSearchToolSearchContextSize`
1457
1458 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.
1459
1460 - `const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low"`
1461
1462 - `const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium"`
1463
1464 - `const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"`
1465
1466 - `UserLocation WebSearchToolUserLocation`
1467
1468 The approximate location of the user.
1469
1470 - `City string`
1471
1472 Free text input for the city of the user, e.g. `San Francisco`.
1473
1474 - `Country string`
1475
1476 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
1477
1478 - `Region string`
1479
1480 Free text input for the region of the user, e.g. `California`.
1481
1482 - `Timezone string`
1483
1484 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
1485
1486 - `Type string`
1487
1488 The type of location approximation. Always `approximate`.
1489
1490 - `const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"`
1491
1492 - `type ToolMcp struct{…}`
1493
1494 Give the model access to additional tools via remote Model Context Protocol
1495 (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
1496
1497 - `ServerLabel string`
1498
1499 A label for this MCP server, used to identify it in tool calls.
1500
1501 - `Type Mcp`
1502
1503 The type of the MCP tool. Always `mcp`.
1504
1505 - `const McpMcp Mcp = "mcp"`
1506
1507 - `AllowedTools ToolMcpAllowedToolsUnion`
1508
1509 List of allowed tool names or a filter object.
1510
1511 - `type ToolMcpAllowedToolsMcpAllowedTools []string`
1512
1513 A string array of allowed tool names
1514
1515 - `type ToolMcpAllowedToolsMcpToolFilter struct{…}`
1516
1517 A filter object to specify which tools are allowed.
1518
1519 - `ReadOnly bool`
1520
1521 Indicates whether or not a tool modifies data or is read-only. If an
1522 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1523 it will match this filter.
1524
1525 - `ToolNames []string`
1526
1527 List of allowed tool names.
1528
1529 - `Authorization string`
1530
1531 An OAuth access token that can be used with a remote MCP server, either
1532 with a custom MCP server URL or a service connector. Your application
1533 must handle the OAuth authorization flow and provide the token here.
1534
1535 - `ConnectorID string`
1536
1537 Identifier for service connectors, like those available in ChatGPT. One of
1538 `server_url` or `connector_id` must be provided. Learn more about service
1539 connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
1540
1541 Currently supported `connector_id` values are:
1542
1543 - Dropbox: `connector_dropbox`
1544 - Gmail: `connector_gmail`
1545 - Google Calendar: `connector_googlecalendar`
1546 - Google Drive: `connector_googledrive`
1547 - Microsoft Teams: `connector_microsoftteams`
1548 - Outlook Calendar: `connector_outlookcalendar`
1549 - Outlook Email: `connector_outlookemail`
1550 - SharePoint: `connector_sharepoint`
1551
1552 - `const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox"`
1553
1554 - `const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail"`
1555
1556 - `const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar"`
1557
1558 - `const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive"`
1559
1560 - `const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams"`
1561
1562 - `const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar"`
1563
1564 - `const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail"`
1565
1566 - `const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"`
1567
1568 - `DeferLoading bool`
1569
1570 Whether this MCP tool is deferred and discovered via tool search.
1571
1572 - `Headers map[string, string]`
1573
1574 Optional HTTP headers to send to the MCP server. Use for authentication
1575 or other purposes.
1576
1577 - `RequireApproval ToolMcpRequireApprovalUnion`
1578
1579 Specify which of the MCP server's tools require approval.
1580
1581 - `type ToolMcpRequireApprovalMcpToolApprovalFilter struct{…}`
1582
1583 Specify which of the MCP server's tools require approval. Can be
1584 `always`, `never`, or a filter object associated with tools
1585 that require approval.
1586
1587 - `Always ToolMcpRequireApprovalMcpToolApprovalFilterAlways`
1588
1589 A filter object to specify which tools are allowed.
1590
1591 - `ReadOnly bool`
1592
1593 Indicates whether or not a tool modifies data or is read-only. If an
1594 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1595 it will match this filter.
1596
1597 - `ToolNames []string`
1598
1599 List of allowed tool names.
1600
1601 - `Never ToolMcpRequireApprovalMcpToolApprovalFilterNever`
1602
1603 A filter object to specify which tools are allowed.
1604
1605 - `ReadOnly bool`
1606
1607 Indicates whether or not a tool modifies data or is read-only. If an
1608 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1609 it will match this filter.
1610
1611 - `ToolNames []string`
1612
1613 List of allowed tool names.
1614
1615 - `type ToolMcpRequireApprovalMcpToolApprovalSetting string`
1616
1617 Specify a single approval policy for all tools. One of `always` or
1618 `never`. When set to `always`, all tools will require approval. When
1619 set to `never`, all tools will not require approval.
1620
1621 - `const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always"`
1622
1623 - `const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"`
1624
1625 - `ServerDescription string`
1626
1627 Optional description of the MCP server, used to provide more context.
1628
1629 - `ServerURL string`
1630
1631 The URL for the MCP server. One of `server_url` or `connector_id` must be
1632 provided.
1633
1634 - `type ToolCodeInterpreter struct{…}`
1635
1636 A tool that runs Python code to help generate a response to a prompt.
1637
1638 - `Container ToolCodeInterpreterContainerUnion`
1639
1640 The code interpreter container. Can be a container ID or an object that
1641 specifies uploaded file IDs to make available to your code, along with an
1642 optional `memory_limit` setting.
1643
1644 - `string`
1645
1646 - `type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}`
1647
1648 Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
1649
1650 - `Type Auto`
1651
1652 Always `auto`.
1653
1654 - `const AutoAuto Auto = "auto"`
1655
1656 - `FileIDs []string`
1657
1658 An optional list of uploaded files to make available to your code.
1659
1660 - `MemoryLimit string`
1661
1662 The memory limit for the code interpreter container.
1663
1664 - `const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"`
1665
1666 - `const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"`
1667
1668 - `const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"`
1669
1670 - `const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"`
1671
1672 - `NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion`
1673
1674 Network access policy for the container.
1675
1676 - `type ContainerNetworkPolicyDisabled struct{…}`
1677
1678 - `Type Disabled`
1679
1680 Disable outbound network access. Always `disabled`.
1681
1682 - `const DisabledDisabled Disabled = "disabled"`
1683
1684 - `type ContainerNetworkPolicyAllowlist struct{…}`
1685
1686 - `AllowedDomains []string`
1687
1688 A list of allowed domains when type is `allowlist`.
1689
1690 - `Type Allowlist`
1691
1692 Allow outbound network access only to specified domains. Always `allowlist`.
1693
1694 - `const AllowlistAllowlist Allowlist = "allowlist"`
1695
1696 - `DomainSecrets []ContainerNetworkPolicyDomainSecret`
1697
1698 Optional domain-scoped secrets for allowlisted domains.
1699
1700 - `Domain string`
1701
1702 The domain associated with the secret.
1703
1704 - `Name string`
1705
1706 The name of the secret to inject for the domain.
1707
1708 - `Value string`
1709
1710 The secret value to inject for the domain.
1711
1712 - `Type CodeInterpreter`
1713
1714 The type of the code interpreter tool. Always `code_interpreter`.
1715
1716 - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"`
1717
1718 - `type ToolImageGeneration struct{…}`
1719
1720 A tool that generates images using the GPT image models.
1721
1722 - `Type ImageGeneration`
1723
1724 The type of the image generation tool. Always `image_generation`.
1725
1726 - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"`
1727
1728 - `Action string`
1729
1730 Whether to generate a new image or edit an existing image. Default: `auto`.
1731
1732 - `const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate"`
1733
1734 - `const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit"`
1735
1736 - `const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"`
1737
1738 - `Background string`
1739
1740 Allows to set transparency for the background of the generated image(s).
1741 This parameter is only supported for GPT image models that support
1742 transparent backgrounds. Must be one of `transparent`, `opaque`, or
1743 `auto` (default value). When `auto` is used, the model will
1744 automatically determine the best background for the image.
1745
1746 `gpt-image-2` and `gpt-image-2-2026-04-21` do not support
1747 transparent backgrounds. Requests with `background` set to
1748 `transparent` will return an error for these models; use `opaque` or
1749 `auto` instead.
1750
1751 If `transparent`, the output format needs to support transparency,
1752 so it should be set to either `png` (default value) or `webp`.
1753
1754 - `const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent"`
1755
1756 - `const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque"`
1757
1758 - `const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"`
1759
1760 - `InputFidelity string`
1761
1762 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`.
1763
1764 - `const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high"`
1765
1766 - `const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"`
1767
1768 - `InputImageMask ToolImageGenerationInputImageMask`
1769
1770 Optional mask for inpainting. Contains `image_url`
1771 (string, optional) and `file_id` (string, optional).
1772
1773 - `FileID string`
1774
1775 File ID for the mask image.
1776
1777 - `ImageURL string`
1778
1779 Base64-encoded mask image.
1780
1781 - `Model string`
1782
1783 The image generation model to use. Default: `gpt-image-1`.
1784
1785 - `string`
1786
1787 - `string`
1788
1789 - `const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1"`
1790
1791 - `const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini"`
1792
1793 - `const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2"`
1794
1795 - `const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21"`
1796
1797 - `const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5"`
1798
1799 - `const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"`
1800
1801 - `Moderation string`
1802
1803 Moderation level for the generated image. Default: `auto`.
1804
1805 - `const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto"`
1806
1807 - `const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"`
1808
1809 - `OutputCompression int64`
1810
1811 Compression level for the output image. Default: 100.
1812
1813 - `OutputFormat string`
1814
1815 The output format of the generated image. One of `png`, `webp`, or
1816 `jpeg`. Default: `png`.
1817
1818 - `const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png"`
1819
1820 - `const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp"`
1821
1822 - `const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"`
1823
1824 - `PartialImages int64`
1825
1826 Number of partial images to generate in streaming mode, from 0 (default value) to 3.
1827
1828 - `Quality string`
1829
1830 The quality of the generated image. One of `low`, `medium`, `high`,
1831 or `auto`. Default: `auto`.
1832
1833 - `const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low"`
1834
1835 - `const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium"`
1836
1837 - `const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high"`
1838
1839 - `const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"`
1840
1841 - `Size string`
1842
1843 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`.
1844
1845 - `string`
1846
1847 - `string`
1848
1849 - `const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024"`
1850
1851 - `const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536"`
1852
1853 - `const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024"`
1854
1855 - `const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"`
1856
1857 - `type ToolLocalShell struct{…}`
1858
1859 A tool that allows the model to execute shell commands in a local environment.
1860
1861 - `Type LocalShell`
1862
1863 The type of the local shell tool. Always `local_shell`.
1864
1865 - `const LocalShellLocalShell LocalShell = "local_shell"`
1866
1867 - `type FunctionShellTool struct{…}`
1868
1869 A tool that allows the model to execute shell commands.
1870
1871 - `Type Shell`
1872
1873 The type of the shell tool. Always `shell`.
1874
1875 - `const ShellShell Shell = "shell"`
1876
1877 - `Environment FunctionShellToolEnvironmentUnion`
1878
1879 - `type ContainerAuto struct{…}`
1880
1881 - `Type ContainerAuto`
1882
1883 Automatically creates a container for this request
1884
1885 - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"`
1886
1887 - `FileIDs []string`
1888
1889 An optional list of uploaded files to make available to your code.
1890
1891 - `MemoryLimit ContainerAutoMemoryLimit`
1892
1893 The memory limit for the container.
1894
1895 - `const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g"`
1896
1897 - `const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g"`
1898
1899 - `const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g"`
1900
1901 - `const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"`
1902
1903 - `NetworkPolicy ContainerAutoNetworkPolicyUnion`
1904
1905 Network access policy for the container.
1906
1907 - `type ContainerNetworkPolicyDisabled struct{…}`
1908
1909 - `type ContainerNetworkPolicyAllowlist struct{…}`
1910
1911 - `Skills []ContainerAutoSkillUnion`
1912
1913 An optional list of skills referenced by id or inline data.
1914
1915 - `type SkillReference struct{…}`
1916
1917 - `SkillID string`
1918
1919 The ID of the referenced skill.
1920
1921 - `Type SkillReference`
1922
1923 References a skill created with the /v1/skills endpoint.
1924
1925 - `const SkillReferenceSkillReference SkillReference = "skill_reference"`
1926
1927 - `Version string`
1928
1929 Optional skill version. Use a positive integer or 'latest'. Omit for default.
1930
1931 - `type InlineSkill struct{…}`
1932
1933 - `Description string`
1934
1935 The description of the skill.
1936
1937 - `Name string`
1938
1939 The name of the skill.
1940
1941 - `Source InlineSkillSource`
1942
1943 Inline skill payload
1944
1945 - `Data string`
1946
1947 Base64-encoded skill zip bundle.
1948
1949 - `MediaType ApplicationZip`
1950
1951 The media type of the inline skill payload. Must be `application/zip`.
1952
1953 - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"`
1954
1955 - `Type Base64`
1956
1957 The type of the inline skill source. Must be `base64`.
1958
1959 - `const Base64Base64 Base64 = "base64"`
1960
1961 - `Type Inline`
1962
1963 Defines an inline skill for this request.
1964
1965 - `const InlineInline Inline = "inline"`
1966
1967 - `type LocalEnvironment struct{…}`
1968
1969 - `Type Local`
1970
1971 Use a local computer environment.
1972
1973 - `const LocalLocal Local = "local"`
1974
1975 - `Skills []LocalSkill`
1976
1977 An optional list of skills.
1978
1979 - `Description string`
1980
1981 The description of the skill.
1982
1983 - `Name string`
1984
1985 The name of the skill.
1986
1987 - `Path string`
1988
1989 The path to the directory containing the skill.
1990
1991 - `type ContainerReference struct{…}`
1992
1993 - `ContainerID string`
1994
1995 The ID of the referenced container.
1996
1997 - `Type ContainerReference`
1998
1999 References a container created with the /v1/containers endpoint
2000
2001 - `const ContainerReferenceContainerReference ContainerReference = "container_reference"`
2002
2003 - `type CustomTool struct{…}`
2004
2005 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)
2006
2007 - `Name string`
2008
2009 The name of the custom tool, used to identify it in tool calls.
2010
2011 - `Type Custom`
2012
2013 The type of the custom tool. Always `custom`.
2014
2015 - `const CustomCustom Custom = "custom"`
2016
2017 - `DeferLoading bool`
2018
2019 Whether this tool should be deferred and discovered via tool search.
2020
2021 - `Description string`
2022
2023 Optional description of the custom tool, used to provide more context.
2024
2025 - `Format CustomToolInputFormatUnion`
2026
2027 The input format for the custom tool. Default is unconstrained text.
2028
2029 - `type CustomToolInputFormatText struct{…}`
2030
2031 Unconstrained free-form text.
2032
2033 - `Type Text`
2034
2035 Unconstrained text format. Always `text`.
2036
2037 - `const TextText Text = "text"`
2038
2039 - `type CustomToolInputFormatGrammar struct{…}`
2040
2041 A grammar defined by the user.
2042
2043 - `Definition string`
2044
2045 The grammar definition.
2046
2047 - `Syntax string`
2048
2049 The syntax of the grammar definition. One of `lark` or `regex`.
2050
2051 - `const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark"`
2052
2053 - `const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"`
2054
2055 - `Type Grammar`
2056
2057 Grammar format. Always `grammar`.
2058
2059 - `const GrammarGrammar Grammar = "grammar"`
2060
2061 - `type NamespaceTool struct{…}`
2062
2063 Groups function/custom tools under a shared namespace.
2064
2065 - `Description string`
2066
2067 A description of the namespace shown to the model.
2068
2069 - `Name string`
2070
2071 The namespace name used in tool calls (for example, `crm`).
2072
2073 - `Tools []NamespaceToolToolUnion`
2074
2075 The function/custom tools available inside this namespace.
2076
2077 - `type NamespaceToolToolFunction struct{…}`
2078
2079 - `Name string`
2080
2081 - `Type Function`
2082
2083 - `const FunctionFunction Function = "function"`
2084
2085 - `DeferLoading bool`
2086
2087 Whether this function should be deferred and discovered via tool search.
2088
2089 - `Description string`
2090
2091 - `Parameters any`
2092
2093 - `Strict bool`
2094
2095 - `type CustomTool struct{…}`
2096
2097 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)
2098
2099 - `Type Namespace`
2100
2101 The type of the tool. Always `namespace`.
2102
2103 - `const NamespaceNamespace Namespace = "namespace"`
2104
2105 - `type ToolSearchTool struct{…}`
2106
2107 Hosted or BYOT tool search configuration for deferred tools.
2108
2109 - `Type ToolSearch`
2110
2111 The type of the tool. Always `tool_search`.
2112
2113 - `const ToolSearchToolSearch ToolSearch = "tool_search"`
2114
2115 - `Description string`
2116
2117 Description shown to the model for a client-executed tool search tool.
2118
2119 - `Execution ToolSearchToolExecution`
2120
2121 Whether tool search is executed by the server or by the client.
2122
2123 - `const ToolSearchToolExecutionServer ToolSearchToolExecution = "server"`
2124
2125 - `const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"`
2126
2127 - `Parameters any`
2128
2129 Parameter schema for a client-executed tool search tool.
2130
2131 - `type WebSearchPreviewTool struct{…}`
2132
2133 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).
2134
2135 - `Type WebSearchPreviewToolType`
2136
2137 The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.
2138
2139 - `const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview"`
2140
2141 - `const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"`
2142
2143 - `SearchContentTypes []string`
2144
2145 - `const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text"`
2146
2147 - `const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"`
2148
2149 - `SearchContextSize WebSearchPreviewToolSearchContextSize`
2150
2151 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.
2152
2153 - `const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low"`
2154
2155 - `const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium"`
2156
2157 - `const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"`
2158
2159 - `UserLocation WebSearchPreviewToolUserLocation`
2160
2161 The user's location.
2162
2163 - `Type Approximate`
2164
2165 The type of location approximation. Always `approximate`.
2166
2167 - `const ApproximateApproximate Approximate = "approximate"`
2168
2169 - `City string`
2170
2171 Free text input for the city of the user, e.g. `San Francisco`.
2172
2173 - `Country string`
2174
2175 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
2176
2177 - `Region string`
2178
2179 Free text input for the region of the user, e.g. `California`.
2180
2181 - `Timezone string`
2182
2183 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
2184
2185 - `type ApplyPatchTool struct{…}`
2186
2187 Allows the assistant to create, delete, or update files using unified diffs.
2188
2189 - `Type ApplyPatch`
2190
2191 The type of the tool. Always `apply_patch`.
2192
2193 - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"`
2194
2195 - `Type ToolSearchOutput`
2196
2197 The item type. Always `tool_search_output`.
2198
2199 - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"`
2200
2201 - `ID string`
2202
2203 The unique ID of this tool search output.
2204
2205 - `CallID string`
2206
2207 The unique ID of the tool search call generated by the model.
2208
2209 - `Execution ResponseToolSearchOutputItemParamExecution`
2210
2211 Whether tool search was executed by the server or by the client.
2212
2213 - `const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server"`
2214
2215 - `const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"`
2216
2217 - `Status ResponseToolSearchOutputItemParamStatus`
2218
2219 The status of the tool search output.
2220
2221 - `const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress"`
2222
2223 - `const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed"`
2224
2225 - `const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"`
2226
2227 - `type ResponseReasoningItem struct{…}`
2228
2229 A description of the chain of thought used by a reasoning model while generating
2230 a response. Be sure to include these items in your `input` to the Responses API
2231 for subsequent turns of a conversation if you are manually
2232 [managing context](https://platform.openai.com/docs/guides/conversation-state).
2233
2234 - `ID string`
2235
2236 The unique identifier of the reasoning content.
2237
2238 - `Summary []ResponseReasoningItemSummary`
2239
2240 Reasoning summary content.
2241
2242 - `Text string`
2243
2244 A summary of the reasoning output from the model so far.
2245
2246 - `Type SummaryText`
2247
2248 The type of the object. Always `summary_text`.
2249
2250 - `const SummaryTextSummaryText SummaryText = "summary_text"`
2251
2252 - `Type Reasoning`
2253
2254 The type of the object. Always `reasoning`.
2255
2256 - `const ReasoningReasoning Reasoning = "reasoning"`
2257
2258 - `Content []ResponseReasoningItemContent`
2259
2260 Reasoning text content.
2261
2262 - `Text string`
2263
2264 The reasoning text from the model.
2265
2266 - `Type ReasoningText`
2267
2268 The type of the reasoning text. Always `reasoning_text`.
2269
2270 - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"`
2271
2272 - `EncryptedContent string`
2273
2274 The encrypted content of the reasoning item - populated when a response is
2275 generated with `reasoning.encrypted_content` in the `include` parameter.
2276
2277 - `Status ResponseReasoningItemStatus`
2278
2279 The status of the item. One of `in_progress`, `completed`, or
2280 `incomplete`. Populated when items are returned via API.
2281
2282 - `const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress"`
2283
2284 - `const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed"`
2285
2286 - `const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"`
2287
2288 - `type ResponseCompactionItemParamResp struct{…}`
2289
2290 A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
2291
2292 - `EncryptedContent string`
2293
2294 The encrypted content of the compaction summary.
2295
2296 - `Type Compaction`
2297
2298 The type of the item. Always `compaction`.
2299
2300 - `const CompactionCompaction Compaction = "compaction"`
2301
2302 - `ID string`
2303
2304 The ID of the compaction item.
2305
2306 - `type ResponseInputItemImageGenerationCall struct{…}`
2307
2308 An image generation request made by the model.
2309
2310 - `ID string`
2311
2312 The unique ID of the image generation call.
2313
2314 - `Result string`
2315
2316 The generated image encoded in base64.
2317
2318 - `Status string`
2319
2320 The status of the image generation call.
2321
2322 - `const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress"`
2323
2324 - `const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed"`
2325
2326 - `const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating"`
2327
2328 - `const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"`
2329
2330 - `Type ImageGenerationCall`
2331
2332 The type of the image generation call. Always `image_generation_call`.
2333
2334 - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"`
2335
2336 - `type ResponseCodeInterpreterToolCall struct{…}`
2337
2338 A tool call to run code.
2339
2340 - `ID string`
2341
2342 The unique ID of the code interpreter tool call.
2343
2344 - `Code string`
2345
2346 The code to run, or null if not available.
2347
2348 - `ContainerID string`
2349
2350 The ID of the container used to run the code.
2351
2352 - `Outputs []ResponseCodeInterpreterToolCallOutputUnion`
2353
2354 The outputs generated by the code interpreter, such as logs or images.
2355 Can be null if no outputs are available.
2356
2357 - `type ResponseCodeInterpreterToolCallOutputLogs struct{…}`
2358
2359 The logs output from the code interpreter.
2360
2361 - `Logs string`
2362
2363 The logs output from the code interpreter.
2364
2365 - `Type Logs`
2366
2367 The type of the output. Always `logs`.
2368
2369 - `const LogsLogs Logs = "logs"`
2370
2371 - `type ResponseCodeInterpreterToolCallOutputImage struct{…}`
2372
2373 The image output from the code interpreter.
2374
2375 - `Type Image`
2376
2377 The type of the output. Always `image`.
2378
2379 - `const ImageImage Image = "image"`
2380
2381 - `URL string`
2382
2383 The URL of the image output from the code interpreter.
2384
2385 - `Status ResponseCodeInterpreterToolCallStatus`
2386
2387 The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
2388
2389 - `const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress"`
2390
2391 - `const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed"`
2392
2393 - `const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete"`
2394
2395 - `const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting"`
2396
2397 - `const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"`
2398
2399 - `Type CodeInterpreterCall`
2400
2401 The type of the code interpreter tool call. Always `code_interpreter_call`.
2402
2403 - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"`
2404
2405 - `type ResponseInputItemLocalShellCall struct{…}`
2406
2407 A tool call to run a command on the local shell.
2408
2409 - `ID string`
2410
2411 The unique ID of the local shell call.
2412
2413 - `Action ResponseInputItemLocalShellCallAction`
2414
2415 Execute a shell command on the server.
2416
2417 - `Command []string`
2418
2419 The command to run.
2420
2421 - `Env map[string, string]`
2422
2423 Environment variables to set for the command.
2424
2425 - `Type Exec`
2426
2427 The type of the local shell action. Always `exec`.
2428
2429 - `const ExecExec Exec = "exec"`
2430
2431 - `TimeoutMs int64`
2432
2433 Optional timeout in milliseconds for the command.
2434
2435 - `User string`
2436
2437 Optional user to run the command as.
2438
2439 - `WorkingDirectory string`
2440
2441 Optional working directory to run the command in.
2442
2443 - `CallID string`
2444
2445 The unique ID of the local shell tool call generated by the model.
2446
2447 - `Status string`
2448
2449 The status of the local shell call.
2450
2451 - `const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress"`
2452
2453 - `const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed"`
2454
2455 - `const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"`
2456
2457 - `Type LocalShellCall`
2458
2459 The type of the local shell call. Always `local_shell_call`.
2460
2461 - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"`
2462
2463 - `type ResponseInputItemLocalShellCallOutput struct{…}`
2464
2465 The output of a local shell tool call.
2466
2467 - `ID string`
2468
2469 The unique ID of the local shell tool call generated by the model.
2470
2471 - `Output string`
2472
2473 A JSON string of the output of the local shell tool call.
2474
2475 - `Type LocalShellCallOutput`
2476
2477 The type of the local shell tool call output. Always `local_shell_call_output`.
2478
2479 - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"`
2480
2481 - `Status string`
2482
2483 The status of the item. One of `in_progress`, `completed`, or `incomplete`.
2484
2485 - `const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress"`
2486
2487 - `const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed"`
2488
2489 - `const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"`
2490
2491 - `type ResponseInputItemShellCall struct{…}`
2492
2493 A tool representing a request to execute one or more shell commands.
2494
2495 - `Action ResponseInputItemShellCallAction`
2496
2497 The shell commands and limits that describe how to run the tool call.
2498
2499 - `Commands []string`
2500
2501 Ordered shell commands for the execution environment to run.
2502
2503 - `MaxOutputLength int64`
2504
2505 Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
2506
2507 - `TimeoutMs int64`
2508
2509 Maximum wall-clock time in milliseconds to allow the shell commands to run.
2510
2511 - `CallID string`
2512
2513 The unique ID of the shell tool call generated by the model.
2514
2515 - `Type ShellCall`
2516
2517 The type of the item. Always `shell_call`.
2518
2519 - `const ShellCallShellCall ShellCall = "shell_call"`
2520
2521 - `ID string`
2522
2523 The unique ID of the shell tool call. Populated when this item is returned via API.
2524
2525 - `Environment ResponseInputItemShellCallEnvironmentUnion`
2526
2527 The environment to execute the shell commands in.
2528
2529 - `type LocalEnvironment struct{…}`
2530
2531 - `type ContainerReference struct{…}`
2532
2533 - `Status string`
2534
2535 The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
2536
2537 - `const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress"`
2538
2539 - `const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed"`
2540
2541 - `const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"`
2542
2543 - `type ResponseInputItemShellCallOutput struct{…}`
2544
2545 The streamed output items emitted by a shell tool call.
2546
2547 - `CallID string`
2548
2549 The unique ID of the shell tool call generated by the model.
2550
2551 - `Output []ResponseFunctionShellCallOutputContent`
2552
2553 Captured chunks of stdout and stderr output, along with their associated outcomes.
2554
2555 - `Outcome ResponseFunctionShellCallOutputContentOutcomeUnion`
2556
2557 The exit or timeout outcome associated with this shell call.
2558
2559 - `type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}`
2560
2561 Indicates that the shell call exceeded its configured time limit.
2562
2563 - `Type Timeout`
2564
2565 The outcome type. Always `timeout`.
2566
2567 - `const TimeoutTimeout Timeout = "timeout"`
2568
2569 - `type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}`
2570
2571 Indicates that the shell commands finished and returned an exit code.
2572
2573 - `ExitCode int64`
2574
2575 The exit code returned by the shell process.
2576
2577 - `Type Exit`
2578
2579 The outcome type. Always `exit`.
2580
2581 - `const ExitExit Exit = "exit"`
2582
2583 - `Stderr string`
2584
2585 Captured stderr output for the shell call.
2586
2587 - `Stdout string`
2588
2589 Captured stdout output for the shell call.
2590
2591 - `Type ShellCallOutput`
2592
2593 The type of the item. Always `shell_call_output`.
2594
2595 - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"`
2596
2597 - `ID string`
2598
2599 The unique ID of the shell tool call output. Populated when this item is returned via API.
2600
2601 - `MaxOutputLength int64`
2602
2603 The maximum number of UTF-8 characters captured for this shell call's combined output.
2604
2605 - `Status string`
2606
2607 The status of the shell call output.
2608
2609 - `const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress"`
2610
2611 - `const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed"`
2612
2613 - `const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"`
2614
2615 - `type ResponseInputItemApplyPatchCall struct{…}`
2616
2617 A tool call representing a request to create, delete, or update files using diff patches.
2618
2619 - `CallID string`
2620
2621 The unique ID of the apply patch tool call generated by the model.
2622
2623 - `Operation ResponseInputItemApplyPatchCallOperationUnion`
2624
2625 The specific create, delete, or update instruction for the apply_patch tool call.
2626
2627 - `type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}`
2628
2629 Instruction for creating a new file via the apply_patch tool.
2630
2631 - `Diff string`
2632
2633 Unified diff content to apply when creating the file.
2634
2635 - `Path string`
2636
2637 Path of the file to create relative to the workspace root.
2638
2639 - `Type CreateFile`
2640
2641 The operation type. Always `create_file`.
2642
2643 - `const CreateFileCreateFile CreateFile = "create_file"`
2644
2645 - `type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}`
2646
2647 Instruction for deleting an existing file via the apply_patch tool.
2648
2649 - `Path string`
2650
2651 Path of the file to delete relative to the workspace root.
2652
2653 - `Type DeleteFile`
2654
2655 The operation type. Always `delete_file`.
2656
2657 - `const DeleteFileDeleteFile DeleteFile = "delete_file"`
2658
2659 - `type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}`
2660
2661 Instruction for updating an existing file via the apply_patch tool.
2662
2663 - `Diff string`
2664
2665 Unified diff content to apply to the existing file.
2666
2667 - `Path string`
2668
2669 Path of the file to update relative to the workspace root.
2670
2671 - `Type UpdateFile`
2672
2673 The operation type. Always `update_file`.
2674
2675 - `const UpdateFileUpdateFile UpdateFile = "update_file"`
2676
2677 - `Status string`
2678
2679 The status of the apply patch tool call. One of `in_progress` or `completed`.
2680
2681 - `const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress"`
2682
2683 - `const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"`
2684
2685 - `Type ApplyPatchCall`
2686
2687 The type of the item. Always `apply_patch_call`.
2688
2689 - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"`
2690
2691 - `ID string`
2692
2693 The unique ID of the apply patch tool call. Populated when this item is returned via API.
2694
2695 - `type ResponseInputItemApplyPatchCallOutput struct{…}`
2696
2697 The streamed output emitted by an apply patch tool call.
2698
2699 - `CallID string`
2700
2701 The unique ID of the apply patch tool call generated by the model.
2702
2703 - `Status string`
2704
2705 The status of the apply patch tool call output. One of `completed` or `failed`.
2706
2707 - `const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed"`
2708
2709 - `const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"`
2710
2711 - `Type ApplyPatchCallOutput`
2712
2713 The type of the item. Always `apply_patch_call_output`.
2714
2715 - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"`
2716
2717 - `ID string`
2718
2719 The unique ID of the apply patch tool call output. Populated when this item is returned via API.
2720
2721 - `Output string`
2722
2723 Optional human-readable log text from the apply patch tool (e.g., patch results or errors).
2724
2725 - `type ResponseInputItemMcpListTools struct{…}`
2726
2727 A list of tools available on an MCP server.
2728
2729 - `ID string`
2730
2731 The unique ID of the list.
2732
2733 - `ServerLabel string`
2734
2735 The label of the MCP server.
2736
2737 - `Tools []ResponseInputItemMcpListToolsTool`
2738
2739 The tools available on the server.
2740
2741 - `InputSchema any`
2742
2743 The JSON schema describing the tool's input.
2744
2745 - `Name string`
2746
2747 The name of the tool.
2748
2749 - `Annotations any`
2750
2751 Additional annotations about the tool.
2752
2753 - `Description string`
2754
2755 The description of the tool.
2756
2757 - `Type McpListTools`
2758
2759 The type of the item. Always `mcp_list_tools`.
2760
2761 - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"`
2762
2763 - `Error string`
2764
2765 Error message if the server could not list tools.
2766
2767 - `type ResponseInputItemMcpApprovalRequest struct{…}`
2768
2769 A request for human approval of a tool invocation.
2770
2771 - `ID string`
2772
2773 The unique ID of the approval request.
2774
2775 - `Arguments string`
2776
2777 A JSON string of arguments for the tool.
2778
2779 - `Name string`
2780
2781 The name of the tool to run.
2782
2783 - `ServerLabel string`
2784
2785 The label of the MCP server making the request.
2786
2787 - `Type McpApprovalRequest`
2788
2789 The type of the item. Always `mcp_approval_request`.
2790
2791 - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"`
2792
2793 - `type ResponseInputItemMcpApprovalResponse struct{…}`
2794
2795 A response to an MCP approval request.
2796
2797 - `ApprovalRequestID string`
2798
2799 The ID of the approval request being answered.
2800
2801 - `Approve bool`
2802
2803 Whether the request was approved.
2804
2805 - `Type McpApprovalResponse`
2806
2807 The type of the item. Always `mcp_approval_response`.
2808
2809 - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"`
2810
2811 - `ID string`
2812
2813 The unique ID of the approval response
2814
2815 - `Reason string`
2816
2817 Optional reason for the decision.
2818
2819 - `type ResponseInputItemMcpCall struct{…}`
2820
2821 An invocation of a tool on an MCP server.
2822
2823 - `ID string`
2824
2825 The unique ID of the tool call.
2826
2827 - `Arguments string`
2828
2829 A JSON string of the arguments passed to the tool.
2830
2831 - `Name string`
2832
2833 The name of the tool that was run.
2834
2835 - `ServerLabel string`
2836
2837 The label of the MCP server running the tool.
2838
2839 - `Type McpCall`
2840
2841 The type of the item. Always `mcp_call`.
2842
2843 - `const McpCallMcpCall McpCall = "mcp_call"`
2844
2845 - `ApprovalRequestID string`
2846
2847 Unique identifier for the MCP tool call approval request.
2848 Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.
2849
2850 - `Error string`
2851
2852 The error from the tool call, if any.
2853
2854 - `Output string`
2855
2856 The output from the tool call.
2857
2858 - `Status string`
2859
2860 The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
2861
2862 - `const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress"`
2863
2864 - `const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed"`
2865
2866 - `const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete"`
2867
2868 - `const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling"`
2869
2870 - `const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"`
2871
2872 - `type ResponseCustomToolCallOutput struct{…}`
2873
2874 The output of a custom tool call from your code, being sent back to the model.
2875
2876 - `CallID string`
2877
2878 The call ID, used to map this custom tool call output to a custom tool call.
2879
2880 - `Output ResponseCustomToolCallOutputOutputUnion`
2881
2882 The output from the custom tool call generated by your code.
2883 Can be a string or an list of output content.
2884
2885 - `string`
2886
2887 - `type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnion`
2888
2889 Text, image, or file output of the custom tool call.
2890
2891 - `type ResponseInputText struct{…}`
2892
2893 A text input to the model.
2894
2895 - `type ResponseInputImage struct{…}`
2896
2897 An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
2898
2899 - `type ResponseInputFile struct{…}`
2900
2901 A file input to the model.
2902
2903 - `Type CustomToolCallOutput`
2904
2905 The type of the custom tool call output. Always `custom_tool_call_output`.
2906
2907 - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"`
2908
2909 - `ID string`
2910
2911 The unique ID of the custom tool call output in the OpenAI platform.
2912
2913 - `type ResponseCustomToolCall struct{…}`
2914
2915 A call to a custom tool created by the model.
2916
2917 - `CallID string`
2918
2919 An identifier used to map this custom tool call to a tool call output.
2920
2921 - `Input string`
2922
2923 The input for the custom tool call generated by the model.
2924
2925 - `Name string`
2926
2927 The name of the custom tool being called.
2928
2929 - `Type CustomToolCall`
2930
2931 The type of the custom tool call. Always `custom_tool_call`.
2932
2933 - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"`
2934
2935 - `ID string`
2936
2937 The unique ID of the custom tool call in the OpenAI platform.
2938
2939 - `Namespace string`
2940
2941 The namespace of the custom tool being called.
2942
2943 - `type ResponseInputItemCompactionTrigger struct{…}`
2944
2945 Compacts the current context. Must be the final input item.
2946
2947 - `Type CompactionTrigger`
2948
2949 The type of the item. Always `compaction_trigger`.
2950
2951 - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"`
2952
2953 - `type ResponseInputItemItemReference struct{…}`
2954
2955 An internal identifier for an item to reference.
2956
2957 - `ID string`
2958
2959 The ID of the item to reference.
2960
2961 - `Type string`
2962
2963 The type of item to reference. Always `item_reference`.
2964
2965 - `const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"`
2966
2967 - `Metadata param.Field[Metadata]`
2968
2969 Set of 16 key-value pairs that can be attached to an object. This can be
2970 useful for storing additional information about the object in a structured
2971 format, and querying for objects via API or the dashboard.
2972
2973 Keys are strings with a maximum length of 64 characters. Values are strings
2974 with a maximum length of 512 characters.
2975
2976### Returns
2977
2978- `type Conversation struct{…}`
2979
2980 - `ID string`
2981
2982 The unique ID of the conversation.
2983
2984 - `CreatedAt int64`
2985
2986 The time at which the conversation was created, measured in seconds since the Unix epoch.
2987
2988 - `Metadata any`
2989
2990 Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
2991 Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
2992
2993 - `Object Conversation`
2994
2995 The object type, which is always `conversation`.
2996
2997 - `const ConversationConversation Conversation = "conversation"`
2998
2999### Example
3000
3001```go
3002package main
3003
3004import (
3005 "context"
3006 "fmt"
3007
3008 "github.com/openai/openai-go"
3009 "github.com/openai/openai-go/conversations"
3010 "github.com/openai/openai-go/option"
3011)
3012
3013func main() {
3014 client := openai.NewClient(
3015 option.WithAPIKey("My API Key"),
3016 )
3017 conversation, err := client.Conversations.New(context.TODO(), conversations.ConversationNewParams{
3018
3019 })
3020 if err != nil {
3021 panic(err.Error())
3022 }
3023 fmt.Printf("%+v\n", conversation.ID)
3024}
3025```
3026
3027#### Response
3028
3029```json
3030{
3031 "id": "id",
3032 "created_at": 0,
3033 "metadata": {},
3034 "object": "conversation"
3035}
3036```