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