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