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