openai 0.99.0 → 0.100.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +1 -1
  4. data/bedrock.md +17 -1
  5. data/lib/openai/client.rb +9 -0
  6. data/lib/openai/helpers/agents/session_stream.rb +11 -36
  7. data/lib/openai/helpers/agents/tools.rb +34 -4
  8. data/lib/openai/helpers/beta/agents/creation_stream.rb +26 -0
  9. data/lib/openai/helpers/beta/agents/function_tool.rb +11 -4
  10. data/lib/openai/helpers/beta/agents/tool_dispatcher.rb +74 -0
  11. data/lib/openai/helpers/beta/agents/tool_error.rb +28 -0
  12. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +125 -3
  13. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +125 -3
  14. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +125 -3
  15. data/lib/openai/models/admin/organization/usage_completions_params.rb +9 -4
  16. data/lib/openai/models/admin/organization/usage_completions_response.rb +125 -3
  17. data/lib/openai/models/admin/organization/usage_costs_params.rb +16 -4
  18. data/lib/openai/models/admin/organization/usage_costs_response.rb +125 -3
  19. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +125 -3
  20. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +125 -3
  21. data/lib/openai/models/admin/organization/usage_images_response.rb +125 -3
  22. data/lib/openai/models/admin/organization/usage_moderations_response.rb +125 -3
  23. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +125 -3
  24. data/lib/openai/models/admin/organization/usage_web_search_calls_params.rb +9 -4
  25. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +125 -3
  26. data/lib/openai/models/beta/agents/environments/template_create_params.rb +6 -6
  27. data/lib/openai/models/beta/agents/environments/template_update_params.rb +3 -6
  28. data/lib/openai/models/beta/agents/sessions/turns/item_list_params.rb +79 -0
  29. data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +2 -2
  30. data/lib/openai/models/beta/beta_response_error.rb +12 -1
  31. data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
  32. data/lib/openai/models/beta/beta_tool.rb +12 -9
  33. data/lib/openai/models/beta/environment_param.rb +6 -6
  34. data/lib/openai/models/beta/session_turn_error.rb +9 -0
  35. data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
  36. data/lib/openai/models/error_object.rb +12 -1
  37. data/lib/openai/models/eval_create_params.rb +1 -1
  38. data/lib/openai/models/eval_create_response.rb +1 -1
  39. data/lib/openai/models/eval_list_response.rb +1 -1
  40. data/lib/openai/models/eval_retrieve_response.rb +1 -1
  41. data/lib/openai/models/eval_update_response.rb +1 -1
  42. data/lib/openai/models/fine_tuning/job_list_params.rb +14 -4
  43. data/lib/openai/models/graders/score_model_grader.rb +2 -2
  44. data/lib/openai/models/image_edit_params.rb +12 -9
  45. data/lib/openai/models/realtime/realtime_client_event.rb +9 -0
  46. data/lib/openai/models/realtime/session_update_event.rb +16 -0
  47. data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +2 -2
  48. data/lib/openai/models/responses/response_error.rb +12 -1
  49. data/lib/openai/models/responses/responses_server_event.rb +12 -1
  50. data/lib/openai/models/responses/tool.rb +12 -9
  51. data/lib/openai/models/video_create_error.rb +12 -1
  52. data/lib/openai/providers/bedrock.rb +20 -1
  53. data/lib/openai/resources/admin/organization/usage.rb +15 -6
  54. data/lib/openai/resources/beta/agents/environments/templates.rb +3 -4
  55. data/lib/openai/resources/beta/agents/sessions/turns/items.rb +68 -0
  56. data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -0
  57. data/lib/openai/resources/beta/agents/sessions.rb +22 -2
  58. data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
  59. data/lib/openai/resources/images.rb +8 -6
  60. data/lib/openai/version.rb +1 -1
  61. data/lib/openai.rb +2 -0
  62. data/rbi/openai/helpers/agents.rbi +2 -0
  63. data/rbi/openai/helpers/beta/agents/function_tool.rbi +8 -3
  64. data/rbi/openai/helpers/beta/agents/tool_error.rbi +19 -0
  65. data/rbi/openai/helpers/beta/agents.rbi +12 -0
  66. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +194 -1
  67. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +194 -1
  68. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +194 -1
  69. data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
  70. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +194 -1
  71. data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
  72. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +194 -1
  73. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +194 -1
  74. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +194 -1
  75. data/rbi/openai/models/admin/organization/usage_images_response.rbi +194 -1
  76. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +194 -1
  77. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +194 -1
  78. data/rbi/openai/models/admin/organization/usage_web_search_calls_params.rbi +12 -4
  79. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +194 -1
  80. data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +6 -6
  81. data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +3 -6
  82. data/rbi/openai/models/beta/agents/sessions/turns/item_list_params.rbi +139 -0
  83. data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +2 -2
  84. data/rbi/openai/models/beta/beta_response_error.rbi +12 -0
  85. data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
  86. data/rbi/openai/models/beta/beta_tool.rbi +12 -9
  87. data/rbi/openai/models/beta/environment_param.rbi +6 -6
  88. data/rbi/openai/models/beta/session_turn_error.rbi +18 -0
  89. data/rbi/openai/models/chat/chat_completion_chunk.rbi +123 -17
  90. data/rbi/openai/models/error_object.rbi +12 -0
  91. data/rbi/openai/models/eval_create_params.rbi +1 -1
  92. data/rbi/openai/models/eval_create_response.rbi +1 -1
  93. data/rbi/openai/models/eval_list_response.rbi +1 -1
  94. data/rbi/openai/models/eval_retrieve_response.rbi +1 -1
  95. data/rbi/openai/models/eval_update_response.rbi +1 -1
  96. data/rbi/openai/models/fine_tuning/job_list_params.rbi +14 -4
  97. data/rbi/openai/models/graders/score_model_grader.rbi +2 -2
  98. data/rbi/openai/models/image_edit_params.rbi +12 -9
  99. data/rbi/openai/models/realtime/session_update_event.rbi +16 -0
  100. data/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi +2 -2
  101. data/rbi/openai/models/responses/response_error.rbi +12 -0
  102. data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
  103. data/rbi/openai/models/responses/tool.rbi +12 -9
  104. data/rbi/openai/models/video_create_error.rbi +12 -0
  105. data/rbi/openai/resources/admin/organization/usage.rbi +15 -6
  106. data/rbi/openai/resources/beta/agents/environments/templates.rbi +3 -4
  107. data/rbi/openai/resources/beta/agents/sessions/turns/items.rbi +62 -0
  108. data/rbi/openai/resources/beta/agents/sessions/turns.rbi +3 -0
  109. data/rbi/openai/resources/beta/agents/sessions.rbi +2 -0
  110. data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
  111. data/rbi/openai/resources/images.rbi +8 -6
  112. data/sig/openai/helpers/agents.rbs +3 -0
  113. data/sig/openai/helpers/beta/agents/function_tool.rbs +5 -2
  114. data/sig/openai/helpers/beta/agents/tool_error.rbs +17 -0
  115. data/sig/openai/helpers/beta/agents.rbs +5 -0
  116. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +87 -2
  117. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +87 -2
  118. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +87 -2
  119. data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
  120. data/sig/openai/models/admin/organization/usage_completions_response.rbs +87 -2
  121. data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
  122. data/sig/openai/models/admin/organization/usage_costs_response.rbs +87 -2
  123. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +87 -2
  124. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +87 -2
  125. data/sig/openai/models/admin/organization/usage_images_response.rbs +87 -2
  126. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +87 -2
  127. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +87 -2
  128. data/sig/openai/models/admin/organization/usage_web_search_calls_params.rbs +19 -7
  129. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +87 -2
  130. data/sig/openai/models/beta/agents/environments/template_create_params.rbs +4 -4
  131. data/sig/openai/models/beta/agents/environments/template_update_params.rbs +2 -4
  132. data/sig/openai/models/beta/agents/sessions/turns/item_list_params.rbs +91 -0
  133. data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +2 -2
  134. data/sig/openai/models/beta/beta_response_error.rbs +10 -0
  135. data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
  136. data/sig/openai/models/beta/beta_tool.rbs +8 -6
  137. data/sig/openai/models/beta/environment_param.rbs +4 -4
  138. data/sig/openai/models/beta/session_turn_error.rbs +12 -0
  139. data/sig/openai/models/chat/chat_completion_chunk.rbs +96 -12
  140. data/sig/openai/models/error_object.rbs +10 -0
  141. data/sig/openai/models/eval_create_params.rbs +1 -1
  142. data/sig/openai/models/eval_create_response.rbs +1 -1
  143. data/sig/openai/models/eval_list_response.rbs +1 -1
  144. data/sig/openai/models/eval_retrieve_response.rbs +1 -1
  145. data/sig/openai/models/eval_update_response.rbs +1 -1
  146. data/sig/openai/models/fine_tuning/job_list_params.rbs +14 -4
  147. data/sig/openai/models/graders/score_model_grader.rbs +3 -3
  148. data/sig/openai/models/image_edit_params.rbs +8 -6
  149. data/sig/openai/models/responses/response_computer_tool_call_output_item.rbs +2 -2
  150. data/sig/openai/models/responses/response_error.rbs +10 -0
  151. data/sig/openai/models/responses/responses_server_event.rbs +10 -0
  152. data/sig/openai/models/responses/tool.rbs +8 -6
  153. data/sig/openai/models/video_create_error.rbs +10 -0
  154. data/sig/openai/resources/beta/agents/sessions/turns/items.rbs +24 -0
  155. data/sig/openai/resources/beta/agents/sessions/turns.rbs +2 -0
  156. data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
  157. metadata +11 -1
@@ -59,8 +59,8 @@ module OpenAI
59
59
  sig { returns(T.nilable(String)) }
60
60
  attr_accessor :name
61
61
 
62
- # Network access policy for the environment. Defaults to disabled for GA requests
63
- # and enabled for beta requests.
62
+ # Network access policy for the environment. If omitted, the API version
63
+ # determines whether network access is enabled or disabled.
64
64
  sig { returns(T.nilable(OpenAI::Beta::Agents::Environments::TemplateCreateParams::Network)) }
65
65
  attr_reader :network
66
66
 
@@ -160,8 +160,8 @@ module OpenAI
160
160
  # An optional human-readable display name for the template.
161
161
  name: nil,
162
162
 
163
- # Network access policy for the environment. Defaults to disabled for GA requests
164
- # and enabled for beta requests.
163
+ # Network access policy for the environment. If omitted, the API version
164
+ # determines whether network access is enabled or disabled.
165
165
  network: nil,
166
166
 
167
167
  # Packages to install in the environment. Defaults to empty package lists.
@@ -273,8 +273,8 @@ module OpenAI
273
273
  sig { returns(T.nilable(T::Array[String])) }
274
274
  attr_accessor :blocked_domains
275
275
 
276
- # Network access policy for the environment. Defaults to disabled for GA requests
277
- # and enabled for beta requests.
276
+ # Network access policy for the environment. If omitted, the API version
277
+ # determines whether network access is enabled or disabled.
278
278
  sig do
279
279
  params(
280
280
 
@@ -61,8 +61,7 @@ module OpenAI
61
61
  attr_accessor :name
62
62
 
63
63
  # Network access available after setup completes. Omit to preserve the current
64
- # policy, or pass `null` to reset to disabled for GA requests or enabled for beta
65
- # requests.
64
+ # policy, or pass `null` to reset to the default policy.
66
65
  sig { returns(T.nilable(OpenAI::Beta::Agents::Environments::TemplateUpdateParams::Network)) }
67
66
  attr_reader :network
68
67
 
@@ -164,8 +163,7 @@ module OpenAI
164
163
  name: nil,
165
164
 
166
165
  # Network access available after setup completes. Omit to preserve the current
167
- # policy, or pass `null` to reset to disabled for GA requests or enabled for beta
168
- # requests.
166
+ # policy, or pass `null` to reset to the default policy.
169
167
  network: nil,
170
168
 
171
169
  # Packages installed before the runtime network policy applies.
@@ -277,8 +275,7 @@ module OpenAI
277
275
  attr_accessor :blocked_domains
278
276
 
279
277
  # Network access available after setup completes. Omit to preserve the current
280
- # policy, or pass `null` to reset to disabled for GA requests or enabled for beta
281
- # requests.
278
+ # policy, or pass `null` to reset to the default policy.
282
279
  sig do
283
280
  params(
284
281
 
@@ -0,0 +1,139 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Beta
7
+
8
+ module Agents
9
+
10
+ module Sessions
11
+
12
+ module Turns
13
+
14
+ class ItemListParams < OpenAI::Internal::Type::BaseModel
15
+
16
+ extend OpenAI::Internal::Type::RequestParameters::Converter
17
+ include OpenAI::Internal::Type::RequestParameters
18
+
19
+ OrHash = T.type_alias do
20
+ T.any(
21
+ OpenAI::Beta::Agents::Sessions::Turns::ItemListParams,
22
+ OpenAI::Internal::AnyHash
23
+ )
24
+ end
25
+
26
+ sig { returns(String) }
27
+ attr_accessor :session_id
28
+
29
+ sig { returns(String) }
30
+ attr_accessor :turn_id
31
+
32
+ # Return items after this cursor in the selected order. Pass the previous
33
+ # response's last_id, which can differ from the last item's ID.
34
+ sig { returns(T.nilable(String)) }
35
+ attr_reader :after
36
+
37
+ sig { params(after: String).void }
38
+ attr_writer :after
39
+
40
+ # The maximum number of resources to return, between 1 and 100. Defaults to 20.
41
+ sig { returns(T.nilable(Integer)) }
42
+ attr_reader :limit
43
+
44
+ sig { params(limit: Integer).void }
45
+ attr_writer :limit
46
+
47
+ # The order in which resources are returned. Defaults to `desc`.
48
+ sig { returns(T.nilable(OpenAI::Beta::Agents::Sessions::Turns::ItemListParams::Order::OrSymbol)) }
49
+ attr_reader :order
50
+
51
+ sig { params(order: OpenAI::Beta::Agents::Sessions::Turns::ItemListParams::Order::OrSymbol).void }
52
+ attr_writer :order
53
+
54
+ sig do
55
+ params(
56
+
57
+ session_id: String,
58
+
59
+ turn_id: String,
60
+
61
+ after: String,
62
+
63
+ limit: Integer,
64
+
65
+ order: OpenAI::Beta::Agents::Sessions::Turns::ItemListParams::Order::OrSymbol,
66
+
67
+ request_options: OpenAI::RequestOptions::OrHash
68
+ )
69
+ .returns(T.attached_class)
70
+ end
71
+ def self.new(
72
+
73
+ session_id:,
74
+
75
+ turn_id:,
76
+
77
+ # Return items after this cursor in the selected order. Pass the previous
78
+ # response's last_id, which can differ from the last item's ID.
79
+ after: nil,
80
+
81
+ # The maximum number of resources to return, between 1 and 100. Defaults to 20.
82
+ limit: nil,
83
+
84
+ # The order in which resources are returned. Defaults to `desc`.
85
+ order: nil,
86
+
87
+ request_options: {}
88
+ )
89
+ end
90
+
91
+ sig do
92
+ override.returns(
93
+ {
94
+ session_id: String,
95
+ turn_id: String,
96
+ after: String,
97
+ limit: Integer,
98
+ order: OpenAI::Beta::Agents::Sessions::Turns::ItemListParams::Order::OrSymbol,
99
+ request_options: OpenAI::RequestOptions
100
+ }
101
+ )
102
+ end
103
+ def to_hash
104
+ end
105
+
106
+ # The order in which resources are returned. Defaults to `desc`.
107
+ module Order
108
+ extend OpenAI::Internal::Type::Enum
109
+
110
+ TaggedSymbol = T.type_alias {
111
+ T.all(Symbol, OpenAI::Beta::Agents::Sessions::Turns::ItemListParams::Order)
112
+ }
113
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
114
+
115
+ # Returns resources in ascending order.
116
+ ASC = T.let(:asc, OpenAI::Beta::Agents::Sessions::Turns::ItemListParams::Order::TaggedSymbol)
117
+
118
+ # Returns resources in descending order.
119
+ DESC = T.let(:desc, OpenAI::Beta::Agents::Sessions::Turns::ItemListParams::Order::TaggedSymbol)
120
+
121
+ sig {
122
+ override.returns(T::Array[OpenAI::Beta::Agents::Sessions::Turns::ItemListParams::Order::TaggedSymbol])
123
+ }
124
+ def self.values
125
+ end
126
+ end
127
+
128
+ end
129
+
130
+ end
131
+
132
+ end
133
+
134
+ end
135
+
136
+ end
137
+
138
+ end
139
+ end
@@ -16,7 +16,7 @@ module OpenAI
16
16
  )
17
17
  end
18
18
 
19
- # The unique ID of the computer call tool output.
19
+ # The ID of the computer tool call output.
20
20
  sig { returns(String) }
21
21
  attr_accessor :id
22
22
 
@@ -96,7 +96,7 @@ module OpenAI
96
96
  end
97
97
  def self.new(
98
98
 
99
- # The unique ID of the computer call tool output.
99
+ # The ID of the computer tool call output.
100
100
  id:,
101
101
 
102
102
  # The ID of the computer tool call that produced the output.
@@ -136,6 +136,11 @@ module OpenAI
136
136
  }
137
137
  attr_writer :error_type
138
138
 
139
+ # An opaque target for explicitly continuing this review, or null when
140
+ # unavailable.
141
+ sig { returns(T.nilable(String)) }
142
+ attr_accessor :review_target
143
+
139
144
  # An optional public continuation instruction.
140
145
  sig { returns(T.nilable(OpenAI::Beta::BetaResponseError::Misalignment::Steer)) }
141
146
  attr_reader :steer
@@ -150,6 +155,8 @@ module OpenAI
150
155
 
151
156
  error_type: T.any(String, OpenAI::Beta::BetaResponseError::Misalignment::ErrorType::OrSymbol),
152
157
 
158
+ review_target: T.nilable(String),
159
+
153
160
  steer: OpenAI::Beta::BetaResponseError::Misalignment::Steer::OrHash
154
161
  )
155
162
  .returns(T.attached_class)
@@ -162,6 +169,10 @@ module OpenAI
162
169
  # An optional classification; clients must accept additional values.
163
170
  error_type: nil,
164
171
 
172
+ # An opaque target for explicitly continuing this review, or null when
173
+ # unavailable.
174
+ review_target: nil,
175
+
165
176
  # An optional public continuation instruction.
166
177
 
167
178
  steer: nil
@@ -173,6 +184,7 @@ module OpenAI
173
184
  {
174
185
  detailed_explanation: String,
175
186
  error_type: OpenAI::Beta::BetaResponseError::Misalignment::ErrorType::Variants,
187
+ review_target: T.nilable(String),
176
188
  steer: OpenAI::Beta::BetaResponseError::Misalignment::Steer
177
189
  }
178
190
  )
@@ -5009,6 +5009,11 @@ module OpenAI
5009
5009
  }
5010
5010
  attr_writer :error_type
5011
5011
 
5012
+ # An opaque target for explicitly continuing this review, or null when
5013
+ # unavailable.
5014
+ sig { returns(T.nilable(String)) }
5015
+ attr_accessor :review_target
5016
+
5012
5017
  # An optional public continuation instruction.
5013
5018
  sig {
5014
5019
  returns(
@@ -5035,6 +5040,8 @@ module OpenAI
5035
5040
  OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::ErrorType::OrSymbol
5036
5041
  ),
5037
5042
 
5043
+ review_target: T.nilable(String),
5044
+
5038
5045
  steer: OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::Steer::OrHash
5039
5046
  )
5040
5047
  .returns(T.attached_class)
@@ -5047,6 +5054,10 @@ module OpenAI
5047
5054
  # An optional classification; clients must accept additional values.
5048
5055
  error_type: nil,
5049
5056
 
5057
+ # An opaque target for explicitly continuing this review, or null when
5058
+ # unavailable.
5059
+ review_target: nil,
5060
+
5050
5061
  # An optional public continuation instruction.
5051
5062
 
5052
5063
  steer: nil
@@ -5060,6 +5071,7 @@ module OpenAI
5060
5071
  error_type: T.nilable(
5061
5072
  OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::ErrorType::Variants
5062
5073
  ),
5074
+ review_target: T.nilable(String),
5063
5075
  steer: T.nilable(
5064
5076
  OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::Steer
5065
5077
  )
@@ -976,9 +976,10 @@ module OpenAI
976
976
  sig { params(background: OpenAI::Beta::BetaTool::ImageGeneration::Background::OrSymbol).void }
977
977
  attr_writer :background
978
978
 
979
- # Controls fidelity to the original input image(s). This parameter is supported
980
- # for GPT image models that support input fidelity. `gpt-image-2` and
981
- # `gpt-image-2-2026-04-21` ignore this parameter.
979
+ # Control how much effort the model will exert to match the style and features,
980
+ # especially facial features, of input images. Supports `high` and `low` on
981
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
982
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
982
983
  sig { returns(T.nilable(OpenAI::Beta::BetaTool::ImageGeneration::InputFidelity::OrSymbol)) }
983
984
  attr_accessor :input_fidelity
984
985
 
@@ -1103,9 +1104,10 @@ module OpenAI
1103
1104
  # set the output format to `png` or `webp`.
1104
1105
  background: nil,
1105
1106
 
1106
- # Controls fidelity to the original input image(s). This parameter is supported
1107
- # for GPT image models that support input fidelity. `gpt-image-2` and
1108
- # `gpt-image-2-2026-04-21` ignore this parameter.
1107
+ # Control how much effort the model will exert to match the style and features,
1108
+ # especially facial features, of input images. Supports `high` and `low` on
1109
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
1110
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
1109
1111
  input_fidelity: nil,
1110
1112
 
1111
1113
  # Optional mask for inpainting. Contains `image_url` (string, optional) and
@@ -1218,9 +1220,10 @@ module OpenAI
1218
1220
  end
1219
1221
  end
1220
1222
 
1221
- # Controls fidelity to the original input image(s). This parameter is supported
1222
- # for GPT image models that support input fidelity. `gpt-image-2` and
1223
- # `gpt-image-2-2026-04-21` ignore this parameter.
1223
+ # Control how much effort the model will exert to match the style and features,
1224
+ # especially facial features, of input images. Supports `high` and `low` on
1225
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
1226
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
1224
1227
  module InputFidelity
1225
1228
  extend OpenAI::Internal::Type::Enum
1226
1229
 
@@ -114,8 +114,8 @@ module OpenAI
114
114
  }
115
115
  attr_accessor :files
116
116
 
117
- # Network access policy for the environment. Defaults to disabled for GA requests
118
- # and enabled for beta requests.
117
+ # Network access policy for the environment. If omitted, the API version
118
+ # determines whether network access is enabled or disabled.
119
119
  sig { returns(T.nilable(OpenAI::Beta::EnvironmentParam::OpenAIHosted::Network)) }
120
120
  attr_reader :network
121
121
 
@@ -216,8 +216,8 @@ module OpenAI
216
216
  # Files available before the agent starts. Defaults to an empty list.
217
217
  files: nil,
218
218
 
219
- # Network access policy for the environment. Defaults to disabled for GA requests
220
- # and enabled for beta requests.
219
+ # Network access policy for the environment. If omitted, the API version
220
+ # determines whether network access is enabled or disabled.
221
221
  network: nil,
222
222
 
223
223
  # Packages to install in the environment. Defaults to empty package lists.
@@ -350,8 +350,8 @@ module OpenAI
350
350
  sig { returns(T.nilable(T::Array[String])) }
351
351
  attr_accessor :blocked_domains
352
352
 
353
- # Network access policy for the environment. Defaults to disabled for GA requests
354
- # and enabled for beta requests.
353
+ # Network access policy for the environment. If omitted, the API version
354
+ # determines whether network access is enabled or disabled.
355
355
  sig do
356
356
  params(
357
357
 
@@ -67,6 +67,24 @@ module OpenAI
67
67
  # The organization has reached a usage, plan, or billing limit.
68
68
  USAGE_LIMIT_EXCEEDED = T.let(:usage_limit_exceeded, OpenAI::Beta::SessionTurnError::Code::TaggedSymbol)
69
69
 
70
+ # The project has reached its enforced spend limit.
71
+ PROJECT_SPEND_LIMIT_EXCEEDED = T.let(
72
+ :project_spend_limit_exceeded,
73
+ OpenAI::Beta::SessionTurnError::Code::TaggedSymbol
74
+ )
75
+
76
+ # The organization has reached its enforced spend limit.
77
+ ORGANIZATION_SPEND_LIMIT_EXCEEDED = T.let(
78
+ :organization_spend_limit_exceeded,
79
+ OpenAI::Beta::SessionTurnError::Code::TaggedSymbol
80
+ )
81
+
82
+ # The organization has reached its OpenAI-assigned usage limit.
83
+ ORGANIZATION_USAGE_LIMIT_EXCEEDED = T.let(
84
+ :organization_usage_limit_exceeded,
85
+ OpenAI::Beta::SessionTurnError::Code::TaggedSymbol
86
+ )
87
+
70
88
  # The organization has no API credits remaining.
71
89
  CREDIT_BALANCE_EXHAUSTED = T.let(
72
90
  :credit_balance_exhausted,
@@ -228,26 +228,29 @@ module OpenAI
228
228
  )
229
229
  end
230
230
 
231
- # A chat completion delta generated by streamed model responses.
231
+ # A chat completion delta generated by streamed model responses. Streamed audio
232
+ # can arrive in partial updates with an ID, base64 data, or transcript text. The
233
+ # final audio update contains only its expiry timestamp.
232
234
  sig { returns(OpenAI::Chat::ChatCompletionChunk::Choice::Delta) }
233
235
  attr_reader :delta
234
236
 
235
237
  sig { params(delta: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::OrHash).void }
236
238
  attr_writer :delta
237
239
 
240
+ # The index of the choice in the list of choices.
241
+ sig { returns(Integer) }
242
+ attr_accessor :index
243
+
238
244
  # The reason the model stopped generating tokens. This will be `stop` if the model
239
245
  # hit a natural stop point or a provided stop sequence, `length` if the maximum
240
246
  # number of tokens specified in the request was reached, `content_filter` if
241
247
  # content was omitted due to a flag from our content filters, `tool_calls` if the
242
248
  # model called a tool, or `function_call` (deprecated) if the model called a
243
- # function.
249
+ # function. Omitted from the final audio update containing only
250
+ # `delta.audio.expires_at`.
244
251
  sig { returns(T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason::TaggedSymbol)) }
245
252
  attr_accessor :finish_reason
246
253
 
247
- # The index of the choice in the list of choices.
248
- sig { returns(Integer) }
249
- attr_accessor :index
250
-
251
254
  # Log probability information for the choice.
252
255
  sig { returns(T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::Logprobs)) }
253
256
  attr_reader :logprobs
@@ -260,29 +263,32 @@ module OpenAI
260
263
 
261
264
  delta: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::OrHash,
262
265
 
263
- finish_reason: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason::OrSymbol),
264
-
265
266
  index: Integer,
266
267
 
268
+ finish_reason: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason::OrSymbol),
269
+
267
270
  logprobs: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::Logprobs::OrHash)
268
271
  )
269
272
  .returns(T.attached_class)
270
273
  end
271
274
  def self.new(
272
275
 
273
- # A chat completion delta generated by streamed model responses.
276
+ # A chat completion delta generated by streamed model responses. Streamed audio
277
+ # can arrive in partial updates with an ID, base64 data, or transcript text. The
278
+ # final audio update contains only its expiry timestamp.
274
279
  delta:,
275
280
 
281
+ # The index of the choice in the list of choices.
282
+ index:,
283
+
276
284
  # The reason the model stopped generating tokens. This will be `stop` if the model
277
285
  # hit a natural stop point or a provided stop sequence, `length` if the maximum
278
286
  # number of tokens specified in the request was reached, `content_filter` if
279
287
  # content was omitted due to a flag from our content filters, `tool_calls` if the
280
288
  # model called a tool, or `function_call` (deprecated) if the model called a
281
- # function.
282
- finish_reason:,
283
-
284
- # The index of the choice in the list of choices.
285
- index:,
289
+ # function. Omitted from the final audio update containing only
290
+ # `delta.audio.expires_at`.
291
+ finish_reason: nil,
286
292
 
287
293
  # Log probability information for the choice.
288
294
 
@@ -294,8 +300,8 @@ module OpenAI
294
300
  override.returns(
295
301
  {
296
302
  delta: OpenAI::Chat::ChatCompletionChunk::Choice::Delta,
297
- finish_reason: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason::TaggedSymbol),
298
303
  index: Integer,
304
+ finish_reason: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason::TaggedSymbol),
299
305
  logprobs: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::Logprobs)
300
306
  }
301
307
  )
@@ -311,6 +317,14 @@ module OpenAI
311
317
  )
312
318
  end
313
319
 
320
+ # A partial audio response. Audio chunks may carry an ID, base64 data, or
321
+ # transcript text; the final audio update contains only its expiry timestamp.
322
+ sig { returns(T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio)) }
323
+ attr_reader :audio
324
+
325
+ sig { params(audio: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio::OrHash).void }
326
+ attr_writer :audio
327
+
314
328
  # The contents of the chunk message.
315
329
  sig { returns(T.nilable(String)) }
316
330
  attr_accessor :content
@@ -342,10 +356,14 @@ module OpenAI
342
356
  }
343
357
  attr_writer :tool_calls
344
358
 
345
- # A chat completion delta generated by streamed model responses.
359
+ # A chat completion delta generated by streamed model responses. Streamed audio
360
+ # can arrive in partial updates with an ID, base64 data, or transcript text. The
361
+ # final audio update contains only its expiry timestamp.
346
362
  sig do
347
363
  params(
348
364
 
365
+ audio: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio::OrHash,
366
+
349
367
  content: T.nilable(String),
350
368
 
351
369
  function_call: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall::OrHash,
@@ -360,6 +378,10 @@ module OpenAI
360
378
  end
361
379
  def self.new(
362
380
 
381
+ # A partial audio response. Audio chunks may carry an ID, base64 data, or
382
+ # transcript text; the final audio update contains only its expiry timestamp.
383
+ audio: nil,
384
+
363
385
  # The contents of the chunk message.
364
386
  content: nil,
365
387
 
@@ -380,6 +402,7 @@ module OpenAI
380
402
  sig do
381
403
  override.returns(
382
404
  {
405
+ audio: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio,
383
406
  content: T.nilable(String),
384
407
  function_call: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall,
385
408
  refusal: T.nilable(String),
@@ -391,6 +414,88 @@ module OpenAI
391
414
  def to_hash
392
415
  end
393
416
 
417
+ class Audio < OpenAI::Internal::Type::BaseModel
418
+ OrHash = T.type_alias do
419
+ T.any(
420
+ OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio,
421
+ OpenAI::Internal::AnyHash
422
+ )
423
+ end
424
+
425
+ # Unique identifier for this audio response.
426
+ sig { returns(T.nilable(String)) }
427
+ attr_reader :id
428
+
429
+ sig { params(id: String).void }
430
+ attr_writer :id
431
+
432
+ # Base64 encoded audio bytes generated by the model, in the format specified in
433
+ # the request.
434
+ sig { returns(T.nilable(String)) }
435
+ attr_reader :data
436
+
437
+ sig { params(data: String).void }
438
+ attr_writer :data
439
+
440
+ # The Unix timestamp (in seconds) for when this audio response will no longer be
441
+ # accessible on the server for use in multi-turn conversations.
442
+ sig { returns(T.nilable(Integer)) }
443
+ attr_reader :expires_at
444
+
445
+ sig { params(expires_at: Integer).void }
446
+ attr_writer :expires_at
447
+
448
+ # Transcript text from this audio chunk.
449
+ sig { returns(T.nilable(String)) }
450
+ attr_reader :transcript
451
+
452
+ sig { params(transcript: String).void }
453
+ attr_writer :transcript
454
+
455
+ # A partial audio response. Audio chunks may carry an ID, base64 data, or
456
+ # transcript text; the final audio update contains only its expiry timestamp.
457
+ sig do
458
+ params(
459
+
460
+ id: String,
461
+
462
+ data: String,
463
+
464
+ expires_at: Integer,
465
+
466
+ transcript: String
467
+ )
468
+ .returns(T.attached_class)
469
+ end
470
+ def self.new(
471
+
472
+ # Unique identifier for this audio response.
473
+ id: nil,
474
+
475
+ # Base64 encoded audio bytes generated by the model, in the format specified in
476
+ # the request.
477
+ data: nil,
478
+
479
+ # The Unix timestamp (in seconds) for when this audio response will no longer be
480
+ # accessible on the server for use in multi-turn conversations.
481
+ expires_at: nil,
482
+
483
+ # Transcript text from this audio chunk.
484
+
485
+ transcript: nil
486
+ )
487
+ end
488
+
489
+ sig do
490
+ override.returns(
491
+ {id: String, data: String, expires_at: Integer, transcript: String}
492
+ )
493
+ end
494
+ def to_hash
495
+ end
496
+
497
+ end
498
+
394
499
  class FunctionCall < OpenAI::Internal::Type::BaseModel
395
500
  OrHash = T.type_alias do
396
501
  T.any(
@@ -633,7 +738,8 @@ module OpenAI
633
738
  # number of tokens specified in the request was reached, `content_filter` if
634
739
  # content was omitted due to a flag from our content filters, `tool_calls` if the
635
740
  # model called a tool, or `function_call` (deprecated) if the model called a
636
- # function.
741
+ # function. Omitted from the final audio update containing only
742
+ # `delta.audio.expires_at`.
637
743
  module FinishReason
638
744
  extend OpenAI::Internal::Type::Enum
639
745
 
@@ -95,6 +95,11 @@ module OpenAI
95
95
  sig { params(error_type: T.any(String, OpenAI::ErrorObject::Misalignment::ErrorType::OrSymbol)).void }
96
96
  attr_writer :error_type
97
97
 
98
+ # An opaque target for explicitly continuing this review, or null when
99
+ # unavailable.
100
+ sig { returns(T.nilable(String)) }
101
+ attr_accessor :review_target
102
+
98
103
  # An optional public continuation instruction.
99
104
  sig { returns(T.nilable(OpenAI::ErrorObject::Misalignment::Steer)) }
100
105
  attr_reader :steer
@@ -109,6 +114,8 @@ module OpenAI
109
114
 
110
115
  error_type: T.any(String, OpenAI::ErrorObject::Misalignment::ErrorType::OrSymbol),
111
116
 
117
+ review_target: T.nilable(String),
118
+
112
119
  steer: OpenAI::ErrorObject::Misalignment::Steer::OrHash
113
120
  )
114
121
  .returns(T.attached_class)
@@ -121,6 +128,10 @@ module OpenAI
121
128
  # An optional classification; clients must accept additional values.
122
129
  error_type: nil,
123
130
 
131
+ # An opaque target for explicitly continuing this review, or null when
132
+ # unavailable.
133
+ review_target: nil,
134
+
124
135
  # An optional public continuation instruction.
125
136
 
126
137
  steer: nil
@@ -132,6 +143,7 @@ module OpenAI
132
143
  {
133
144
  detailed_explanation: String,
134
145
  error_type: T.any(String, OpenAI::ErrorObject::Misalignment::ErrorType::OrSymbol),
146
+ review_target: T.nilable(String),
135
147
  steer: OpenAI::ErrorObject::Misalignment::Steer
136
148
  }
137
149
  )