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