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