openai 0.71.0 → 0.72.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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/admin/organization/organization_spend_limit.rb +151 -0
  5. data/lib/openai/models/admin/organization/organization_spend_limit_deleted.rb +33 -0
  6. data/lib/openai/models/admin/organization/projects/project_spend_limit.rb +155 -0
  7. data/lib/openai/models/admin/organization/projects/project_spend_limit_deleted.rb +35 -0
  8. data/lib/openai/models/admin/organization/projects/spend_limit_delete_params.rb +26 -0
  9. data/lib/openai/models/admin/organization/projects/spend_limit_retrieve_params.rb +26 -0
  10. data/lib/openai/models/admin/organization/projects/spend_limit_update_params.rb +77 -0
  11. data/lib/openai/models/admin/organization/spend_limit_delete_params.rb +18 -0
  12. data/lib/openai/models/admin/organization/spend_limit_retrieve_params.rb +18 -0
  13. data/lib/openai/models/admin/organization/spend_limit_update_params.rb +67 -0
  14. data/lib/openai/models/beta/beta_response.rb +12 -6
  15. data/lib/openai/models/beta/beta_response_error.rb +1 -0
  16. data/lib/openai/models/beta/beta_response_text_config.rb +4 -2
  17. data/lib/openai/models/beta/beta_responses_client_event.rb +12 -6
  18. data/lib/openai/models/beta/response_create_params.rb +12 -6
  19. data/lib/openai/models/beta/responses/input_token_count_params.rb +12 -4
  20. data/lib/openai/models/chat/completion_create_params.rb +8 -6
  21. data/lib/openai/models/reasoning.rb +8 -2
  22. data/lib/openai/models/responses/input_token_count_params.rb +4 -2
  23. data/lib/openai/models/responses/response.rb +4 -4
  24. data/lib/openai/models/responses/response_create_params.rb +4 -4
  25. data/lib/openai/models/responses/response_error.rb +1 -0
  26. data/lib/openai/models/responses/response_text_config.rb +4 -2
  27. data/lib/openai/models/responses/responses_client_event.rb +4 -4
  28. data/lib/openai/resources/admin/organization/projects/spend_limit.rb +95 -0
  29. data/lib/openai/resources/admin/organization/projects.rb +4 -0
  30. data/lib/openai/resources/admin/organization/spend_limit.rb +86 -0
  31. data/lib/openai/resources/admin/organization.rb +4 -0
  32. data/lib/openai/resources/beta/responses.rb +4 -4
  33. data/lib/openai/resources/chat/completions.rb +4 -4
  34. data/lib/openai/resources/responses.rb +4 -4
  35. data/lib/openai/version.rb +1 -1
  36. data/lib/openai.rb +12 -0
  37. data/rbi/openai/models/admin/organization/organization_spend_limit.rbi +278 -0
  38. data/rbi/openai/models/admin/organization/organization_spend_limit_deleted.rbi +48 -0
  39. data/rbi/openai/models/admin/organization/projects/project_spend_limit.rbi +280 -0
  40. data/rbi/openai/models/admin/organization/projects/project_spend_limit_deleted.rbi +49 -0
  41. data/rbi/openai/models/admin/organization/projects/spend_limit_delete_params.rbi +44 -0
  42. data/rbi/openai/models/admin/organization/projects/spend_limit_retrieve_params.rbi +44 -0
  43. data/rbi/openai/models/admin/organization/projects/spend_limit_update_params.rbi +149 -0
  44. data/rbi/openai/models/admin/organization/spend_limit_delete_params.rbi +34 -0
  45. data/rbi/openai/models/admin/organization/spend_limit_retrieve_params.rbi +34 -0
  46. data/rbi/openai/models/admin/organization/spend_limit_update_params.rbi +141 -0
  47. data/rbi/openai/models/beta/beta_response.rbi +18 -15
  48. data/rbi/openai/models/beta/beta_response_error.rbi +5 -0
  49. data/rbi/openai/models/beta/beta_response_text_config.rbi +6 -3
  50. data/rbi/openai/models/beta/beta_responses_client_event.rbi +18 -15
  51. data/rbi/openai/models/beta/response_create_params.rbi +18 -15
  52. data/rbi/openai/models/beta/responses/input_token_count_params.rbi +18 -6
  53. data/rbi/openai/models/chat/completion_create_params.rbi +12 -15
  54. data/rbi/openai/models/reasoning.rbi +12 -3
  55. data/rbi/openai/models/responses/input_token_count_params.rbi +6 -3
  56. data/rbi/openai/models/responses/response.rbi +6 -12
  57. data/rbi/openai/models/responses/response_create_params.rbi +6 -12
  58. data/rbi/openai/models/responses/response_error.rbi +5 -0
  59. data/rbi/openai/models/responses/response_text_config.rbi +6 -3
  60. data/rbi/openai/models/responses/responses_client_event.rbi +6 -12
  61. data/rbi/openai/resources/admin/organization/projects/spend_limit.rbi +78 -0
  62. data/rbi/openai/resources/admin/organization/projects.rbi +7 -0
  63. data/rbi/openai/resources/admin/organization/spend_limit.rbi +57 -0
  64. data/rbi/openai/resources/admin/organization.rbi +3 -0
  65. data/rbi/openai/resources/beta/responses.rbi +4 -4
  66. data/rbi/openai/resources/chat/completions.rbi +8 -6
  67. data/rbi/openai/resources/responses.rbi +4 -4
  68. data/sig/openai/models/admin/organization/organization_spend_limit.rbs +94 -0
  69. data/sig/openai/models/admin/organization/organization_spend_limit_deleted.rbs +28 -0
  70. data/sig/openai/models/admin/organization/projects/project_spend_limit.rbs +96 -0
  71. data/sig/openai/models/admin/organization/projects/project_spend_limit_deleted.rbs +30 -0
  72. data/sig/openai/models/admin/organization/projects/spend_limit_delete_params.rbs +29 -0
  73. data/sig/openai/models/admin/organization/projects/spend_limit_retrieve_params.rbs +29 -0
  74. data/sig/openai/models/admin/organization/projects/spend_limit_update_params.rbs +67 -0
  75. data/sig/openai/models/admin/organization/spend_limit_delete_params.rbs +19 -0
  76. data/sig/openai/models/admin/organization/spend_limit_retrieve_params.rbs +19 -0
  77. data/sig/openai/models/admin/organization/spend_limit_update_params.rbs +60 -0
  78. data/sig/openai/models/beta/beta_response.rbs +8 -12
  79. data/sig/openai/models/beta/beta_response_error.rbs +2 -0
  80. data/sig/openai/models/beta/beta_responses_client_event.rbs +8 -12
  81. data/sig/openai/models/beta/response_create_params.rbs +8 -12
  82. data/sig/openai/models/chat/completion_create_params.rbs +8 -12
  83. data/sig/openai/models/responses/response.rbs +8 -12
  84. data/sig/openai/models/responses/response_create_params.rbs +8 -12
  85. data/sig/openai/models/responses/response_error.rbs +2 -0
  86. data/sig/openai/models/responses/responses_client_event.rbs +8 -12
  87. data/sig/openai/resources/admin/organization/projects/spend_limit.rbs +31 -0
  88. data/sig/openai/resources/admin/organization/projects.rbs +2 -0
  89. data/sig/openai/resources/admin/organization/spend_limit.rbs +26 -0
  90. data/sig/openai/resources/admin/organization.rbs +2 -0
  91. data/sig/openai/resources/beta/responses.rbs +4 -4
  92. data/sig/openai/resources/chat/completions.rbs +4 -4
  93. data/sig/openai/resources/responses.rbs +4 -4
  94. metadata +38 -2
@@ -0,0 +1,141 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Admin
6
+ module Organization
7
+ class SpendLimitUpdateParams < OpenAI::Internal::Type::BaseModel
8
+ extend OpenAI::Internal::Type::RequestParameters::Converter
9
+ include OpenAI::Internal::Type::RequestParameters
10
+
11
+ OrHash =
12
+ T.type_alias do
13
+ T.any(
14
+ OpenAI::Admin::Organization::SpendLimitUpdateParams,
15
+ OpenAI::Internal::AnyHash
16
+ )
17
+ end
18
+
19
+ # The currency for the threshold amount. Currently, only `USD` is supported.
20
+ sig do
21
+ returns(
22
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Currency::OrSymbol
23
+ )
24
+ end
25
+ attr_accessor :currency
26
+
27
+ # The time interval for evaluating spend against the threshold. Currently, only
28
+ # `month` is supported.
29
+ sig do
30
+ returns(
31
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Interval::OrSymbol
32
+ )
33
+ end
34
+ attr_accessor :interval
35
+
36
+ # The hard spend limit amount, in cents.
37
+ sig { returns(Integer) }
38
+ attr_accessor :threshold_amount
39
+
40
+ sig do
41
+ params(
42
+ currency:
43
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Currency::OrSymbol,
44
+ interval:
45
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Interval::OrSymbol,
46
+ threshold_amount: Integer,
47
+ request_options: OpenAI::RequestOptions::OrHash
48
+ ).returns(T.attached_class)
49
+ end
50
+ def self.new(
51
+ # The currency for the threshold amount. Currently, only `USD` is supported.
52
+ currency:,
53
+ # The time interval for evaluating spend against the threshold. Currently, only
54
+ # `month` is supported.
55
+ interval:,
56
+ # The hard spend limit amount, in cents.
57
+ threshold_amount:,
58
+ request_options: {}
59
+ )
60
+ end
61
+
62
+ sig do
63
+ override.returns(
64
+ {
65
+ currency:
66
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Currency::OrSymbol,
67
+ interval:
68
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Interval::OrSymbol,
69
+ threshold_amount: Integer,
70
+ request_options: OpenAI::RequestOptions
71
+ }
72
+ )
73
+ end
74
+ def to_hash
75
+ end
76
+
77
+ # The currency for the threshold amount. Currently, only `USD` is supported.
78
+ module Currency
79
+ extend OpenAI::Internal::Type::Enum
80
+
81
+ TaggedSymbol =
82
+ T.type_alias do
83
+ T.all(
84
+ Symbol,
85
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Currency
86
+ )
87
+ end
88
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
89
+
90
+ USD =
91
+ T.let(
92
+ :USD,
93
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Currency::TaggedSymbol
94
+ )
95
+
96
+ sig do
97
+ override.returns(
98
+ T::Array[
99
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Currency::TaggedSymbol
100
+ ]
101
+ )
102
+ end
103
+ def self.values
104
+ end
105
+ end
106
+
107
+ # The time interval for evaluating spend against the threshold. Currently, only
108
+ # `month` is supported.
109
+ module Interval
110
+ extend OpenAI::Internal::Type::Enum
111
+
112
+ TaggedSymbol =
113
+ T.type_alias do
114
+ T.all(
115
+ Symbol,
116
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Interval
117
+ )
118
+ end
119
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
120
+
121
+ MONTH =
122
+ T.let(
123
+ :month,
124
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Interval::TaggedSymbol
125
+ )
126
+
127
+ sig do
128
+ override.returns(
129
+ T::Array[
130
+ OpenAI::Admin::Organization::SpendLimitUpdateParams::Interval::TaggedSymbol
131
+ ]
132
+ )
133
+ end
134
+ def self.values
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -204,10 +204,7 @@ module OpenAI
204
204
  # hit rates. Replaces the `user` field.
205
205
  # [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
206
206
  sig { returns(T.nilable(String)) }
207
- attr_reader :prompt_cache_key
208
-
209
- sig { params(prompt_cache_key: String).void }
210
- attr_writer :prompt_cache_key
207
+ attr_accessor :prompt_cache_key
211
208
 
212
209
  # The prompt-caching options that were applied to the response. Supported for
213
210
  # `gpt-5.6` and later models.
@@ -271,10 +268,7 @@ module OpenAI
271
268
  # identifying information.
272
269
  # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
273
270
  sig { returns(T.nilable(String)) }
274
- attr_reader :safety_identifier
275
-
276
- sig { params(safety_identifier: String).void }
277
- attr_writer :safety_identifier
271
+ attr_accessor :safety_identifier
278
272
 
279
273
  # Specifies the processing type used for serving the request.
280
274
  #
@@ -452,7 +446,7 @@ module OpenAI
452
446
  T.nilable(OpenAI::Beta::BetaResponse::Moderation::OrHash),
453
447
  previous_response_id: T.nilable(String),
454
448
  prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt::OrHash),
455
- prompt_cache_key: String,
449
+ prompt_cache_key: T.nilable(String),
456
450
  prompt_cache_options:
457
451
  OpenAI::Beta::BetaResponse::PromptCacheOptions::OrHash,
458
452
  prompt_cache_retention:
@@ -460,7 +454,7 @@ module OpenAI
460
454
  OpenAI::Beta::BetaResponse::PromptCacheRetention::OrSymbol
461
455
  ),
462
456
  reasoning: T.nilable(OpenAI::Beta::BetaResponse::Reasoning::OrHash),
463
- safety_identifier: String,
457
+ safety_identifier: T.nilable(String),
464
458
  service_tier:
465
459
  T.nilable(OpenAI::Beta::BetaResponse::ServiceTier::OrSymbol),
466
460
  status: OpenAI::Beta::BetaResponseStatus::OrSymbol,
@@ -691,7 +685,7 @@ module OpenAI
691
685
  moderation: T.nilable(OpenAI::Beta::BetaResponse::Moderation),
692
686
  previous_response_id: T.nilable(String),
693
687
  prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt),
694
- prompt_cache_key: String,
688
+ prompt_cache_key: T.nilable(String),
695
689
  prompt_cache_options:
696
690
  OpenAI::Beta::BetaResponse::PromptCacheOptions,
697
691
  prompt_cache_retention:
@@ -699,7 +693,7 @@ module OpenAI
699
693
  OpenAI::Beta::BetaResponse::PromptCacheRetention::TaggedSymbol
700
694
  ),
701
695
  reasoning: T.nilable(OpenAI::Beta::BetaResponse::Reasoning),
702
- safety_identifier: String,
696
+ safety_identifier: T.nilable(String),
703
697
  service_tier:
704
698
  T.nilable(
705
699
  OpenAI::Beta::BetaResponse::ServiceTier::TaggedSymbol
@@ -2014,7 +2008,10 @@ module OpenAI
2014
2008
  )
2015
2009
  end
2016
2010
 
2017
- # Controls which reasoning items are rendered back to the model on later turns.
2011
+ # Controls which reasoning items are rendered back to the model on later turns. If
2012
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
2013
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
2014
+ #
2018
2015
  # When returned on a response, this is the effective reasoning context mode used
2019
2016
  # for the response.
2020
2017
  sig do
@@ -2121,7 +2118,10 @@ module OpenAI
2121
2118
  ).returns(T.attached_class)
2122
2119
  end
2123
2120
  def self.new(
2124
- # Controls which reasoning items are rendered back to the model on later turns.
2121
+ # Controls which reasoning items are rendered back to the model on later turns. If
2122
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
2123
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
2124
+ #
2125
2125
  # When returned on a response, this is the effective reasoning context mode used
2126
2126
  # for the response.
2127
2127
  context: nil,
@@ -2178,7 +2178,10 @@ module OpenAI
2178
2178
  def to_hash
2179
2179
  end
2180
2180
 
2181
- # Controls which reasoning items are rendered back to the model on later turns.
2181
+ # Controls which reasoning items are rendered back to the model on later turns. If
2182
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
2183
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
2184
+ #
2182
2185
  # When returned on a response, this is the effective reasoning context mode used
2183
2186
  # for the response.
2184
2187
  module Context
@@ -70,6 +70,11 @@ module OpenAI
70
70
  :invalid_prompt,
71
71
  OpenAI::Beta::BetaResponseError::Code::TaggedSymbol
72
72
  )
73
+ DATA_RESIDENCY_MISMATCH =
74
+ T.let(
75
+ :data_residency_mismatch,
76
+ OpenAI::Beta::BetaResponseError::Code::TaggedSymbol
77
+ )
73
78
  BIO_POLICY =
74
79
  T.let(
75
80
  :bio_policy,
@@ -54,7 +54,8 @@ module OpenAI
54
54
 
55
55
  # Constrains the verbosity of the model's response. Lower values will result in
56
56
  # more concise responses, while higher values will result in more verbose
57
- # responses. Currently supported values are `low`, `medium`, and `high`.
57
+ # responses. Currently supported values are `low`, `medium`, and `high`. The
58
+ # default is `medium`.
58
59
  sig do
59
60
  returns(
60
61
  T.nilable(OpenAI::Beta::BetaResponseTextConfig::Verbosity::OrSymbol)
@@ -98,7 +99,8 @@ module OpenAI
98
99
  format_: nil,
99
100
  # Constrains the verbosity of the model's response. Lower values will result in
100
101
  # more concise responses, while higher values will result in more verbose
101
- # responses. Currently supported values are `low`, `medium`, and `high`.
102
+ # responses. Currently supported values are `low`, `medium`, and `high`. The
103
+ # default is `medium`.
102
104
  verbosity: nil
103
105
  )
104
106
  end
@@ -124,7 +126,8 @@ module OpenAI
124
126
 
125
127
  # Constrains the verbosity of the model's response. Lower values will result in
126
128
  # more concise responses, while higher values will result in more verbose
127
- # responses. Currently supported values are `low`, `medium`, and `high`.
129
+ # responses. Currently supported values are `low`, `medium`, and `high`. The
130
+ # default is `medium`.
128
131
  module Verbosity
129
132
  extend OpenAI::Internal::Type::Enum
130
133
 
@@ -238,10 +238,7 @@ module OpenAI
238
238
  # hit rates. Replaces the `user` field.
239
239
  # [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
240
240
  sig { returns(T.nilable(String)) }
241
- attr_reader :prompt_cache_key
242
-
243
- sig { params(prompt_cache_key: String).void }
244
- attr_writer :prompt_cache_key
241
+ attr_accessor :prompt_cache_key
245
242
 
246
243
  # Options for prompt caching. Supported for `gpt-5.6` and later models. By
247
244
  # default, OpenAI automatically chooses one implicit cache breakpoint. You can add
@@ -325,10 +322,7 @@ module OpenAI
325
322
  # identifying information.
326
323
  # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
327
324
  sig { returns(T.nilable(String)) }
328
- attr_reader :safety_identifier
329
-
330
- sig { params(safety_identifier: String).void }
331
- attr_writer :safety_identifier
325
+ attr_accessor :safety_identifier
332
326
 
333
327
  # Specifies the processing type used for serving the request.
334
328
  #
@@ -612,7 +606,7 @@ module OpenAI
612
606
  parallel_tool_calls: T.nilable(T::Boolean),
613
607
  previous_response_id: T.nilable(String),
614
608
  prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt::OrHash),
615
- prompt_cache_key: String,
609
+ prompt_cache_key: T.nilable(String),
616
610
  prompt_cache_options:
617
611
  OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::PromptCacheOptions::OrHash,
618
612
  prompt_cache_retention:
@@ -623,7 +617,7 @@ module OpenAI
623
617
  T.nilable(
624
618
  OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::Reasoning::OrHash
625
619
  ),
626
- safety_identifier: String,
620
+ safety_identifier: T.nilable(String),
627
621
  service_tier:
628
622
  T.nilable(
629
623
  OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::ServiceTier::OrSymbol
@@ -938,7 +932,7 @@ module OpenAI
938
932
  parallel_tool_calls: T.nilable(T::Boolean),
939
933
  previous_response_id: T.nilable(String),
940
934
  prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt),
941
- prompt_cache_key: String,
935
+ prompt_cache_key: T.nilable(String),
942
936
  prompt_cache_options:
943
937
  OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::PromptCacheOptions,
944
938
  prompt_cache_retention:
@@ -949,7 +943,7 @@ module OpenAI
949
943
  T.nilable(
950
944
  OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::Reasoning
951
945
  ),
952
- safety_identifier: String,
946
+ safety_identifier: T.nilable(String),
953
947
  service_tier:
954
948
  T.nilable(
955
949
  OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::ServiceTier::OrSymbol
@@ -2198,7 +2192,10 @@ module OpenAI
2198
2192
  )
2199
2193
  end
2200
2194
 
2201
- # Controls which reasoning items are rendered back to the model on later turns.
2195
+ # Controls which reasoning items are rendered back to the model on later turns. If
2196
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
2197
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
2198
+ #
2202
2199
  # When returned on a response, this is the effective reasoning context mode used
2203
2200
  # for the response.
2204
2201
  sig do
@@ -2310,7 +2307,10 @@ module OpenAI
2310
2307
  ).returns(T.attached_class)
2311
2308
  end
2312
2309
  def self.new(
2313
- # Controls which reasoning items are rendered back to the model on later turns.
2310
+ # Controls which reasoning items are rendered back to the model on later turns. If
2311
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
2312
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
2313
+ #
2314
2314
  # When returned on a response, this is the effective reasoning context mode used
2315
2315
  # for the response.
2316
2316
  context: nil,
@@ -2371,7 +2371,10 @@ module OpenAI
2371
2371
  def to_hash
2372
2372
  end
2373
2373
 
2374
- # Controls which reasoning items are rendered back to the model on later turns.
2374
+ # Controls which reasoning items are rendered back to the model on later turns. If
2375
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
2376
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
2377
+ #
2375
2378
  # When returned on a response, this is the effective reasoning context mode used
2376
2379
  # for the response.
2377
2380
  module Context
@@ -195,10 +195,7 @@ module OpenAI
195
195
  # hit rates. Replaces the `user` field.
196
196
  # [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
197
197
  sig { returns(T.nilable(String)) }
198
- attr_reader :prompt_cache_key
199
-
200
- sig { params(prompt_cache_key: String).void }
201
- attr_writer :prompt_cache_key
198
+ attr_accessor :prompt_cache_key
202
199
 
203
200
  # Options for prompt caching. Supported for `gpt-5.6` and later models. By
204
201
  # default, OpenAI automatically chooses one implicit cache breakpoint. You can add
@@ -274,10 +271,7 @@ module OpenAI
274
271
  # identifying information.
275
272
  # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
276
273
  sig { returns(T.nilable(String)) }
277
- attr_reader :safety_identifier
278
-
279
- sig { params(safety_identifier: String).void }
280
- attr_writer :safety_identifier
274
+ attr_accessor :safety_identifier
281
275
 
282
276
  # Specifies the processing type used for serving the request.
283
277
  #
@@ -546,7 +540,7 @@ module OpenAI
546
540
  parallel_tool_calls: T.nilable(T::Boolean),
547
541
  previous_response_id: T.nilable(String),
548
542
  prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt::OrHash),
549
- prompt_cache_key: String,
543
+ prompt_cache_key: T.nilable(String),
550
544
  prompt_cache_options:
551
545
  OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::OrHash,
552
546
  prompt_cache_retention:
@@ -555,7 +549,7 @@ module OpenAI
555
549
  ),
556
550
  reasoning:
557
551
  T.nilable(OpenAI::Beta::ResponseCreateParams::Reasoning::OrHash),
558
- safety_identifier: String,
552
+ safety_identifier: T.nilable(String),
559
553
  service_tier:
560
554
  T.nilable(
561
555
  OpenAI::Beta::ResponseCreateParams::ServiceTier::OrSymbol
@@ -857,7 +851,7 @@ module OpenAI
857
851
  parallel_tool_calls: T.nilable(T::Boolean),
858
852
  previous_response_id: T.nilable(String),
859
853
  prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt),
860
- prompt_cache_key: String,
854
+ prompt_cache_key: T.nilable(String),
861
855
  prompt_cache_options:
862
856
  OpenAI::Beta::ResponseCreateParams::PromptCacheOptions,
863
857
  prompt_cache_retention:
@@ -866,7 +860,7 @@ module OpenAI
866
860
  ),
867
861
  reasoning:
868
862
  T.nilable(OpenAI::Beta::ResponseCreateParams::Reasoning),
869
- safety_identifier: String,
863
+ safety_identifier: T.nilable(String),
870
864
  service_tier:
871
865
  T.nilable(
872
866
  OpenAI::Beta::ResponseCreateParams::ServiceTier::OrSymbol
@@ -2099,7 +2093,10 @@ module OpenAI
2099
2093
  )
2100
2094
  end
2101
2095
 
2102
- # Controls which reasoning items are rendered back to the model on later turns.
2096
+ # Controls which reasoning items are rendered back to the model on later turns. If
2097
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
2098
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
2099
+ #
2103
2100
  # When returned on a response, this is the effective reasoning context mode used
2104
2101
  # for the response.
2105
2102
  sig do
@@ -2211,7 +2208,10 @@ module OpenAI
2211
2208
  ).returns(T.attached_class)
2212
2209
  end
2213
2210
  def self.new(
2214
- # Controls which reasoning items are rendered back to the model on later turns.
2211
+ # Controls which reasoning items are rendered back to the model on later turns. If
2212
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
2213
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
2214
+ #
2215
2215
  # When returned on a response, this is the effective reasoning context mode used
2216
2216
  # for the response.
2217
2217
  context: nil,
@@ -2272,7 +2272,10 @@ module OpenAI
2272
2272
  def to_hash
2273
2273
  end
2274
2274
 
2275
- # Controls which reasoning items are rendered back to the model on later turns.
2275
+ # Controls which reasoning items are rendered back to the model on later turns. If
2276
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
2277
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
2278
+ #
2276
2279
  # When returned on a response, this is the effective reasoning context mode used
2277
2280
  # for the response.
2278
2281
  module Context
@@ -544,7 +544,10 @@ module OpenAI
544
544
  )
545
545
  end
546
546
 
547
- # Controls which reasoning items are rendered back to the model on later turns.
547
+ # Controls which reasoning items are rendered back to the model on later turns. If
548
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
549
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
550
+ #
548
551
  # When returned on a response, this is the effective reasoning context mode used
549
552
  # for the response.
550
553
  sig do
@@ -654,7 +657,10 @@ module OpenAI
654
657
  ).returns(T.attached_class)
655
658
  end
656
659
  def self.new(
657
- # Controls which reasoning items are rendered back to the model on later turns.
660
+ # Controls which reasoning items are rendered back to the model on later turns. If
661
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
662
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
663
+ #
658
664
  # When returned on a response, this is the effective reasoning context mode used
659
665
  # for the response.
660
666
  context: nil,
@@ -715,7 +721,10 @@ module OpenAI
715
721
  def to_hash
716
722
  end
717
723
 
718
- # Controls which reasoning items are rendered back to the model on later turns.
724
+ # Controls which reasoning items are rendered back to the model on later turns. If
725
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
726
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
727
+ #
719
728
  # When returned on a response, this is the effective reasoning context mode used
720
729
  # for the response.
721
730
  module Context
@@ -1006,7 +1015,8 @@ module OpenAI
1006
1015
 
1007
1016
  # Constrains the verbosity of the model's response. Lower values will result in
1008
1017
  # more concise responses, while higher values will result in more verbose
1009
- # responses. Currently supported values are `low`, `medium`, and `high`.
1018
+ # responses. Currently supported values are `low`, `medium`, and `high`. The
1019
+ # default is `medium`.
1010
1020
  sig do
1011
1021
  returns(
1012
1022
  T.nilable(
@@ -1052,7 +1062,8 @@ module OpenAI
1052
1062
  format_: nil,
1053
1063
  # Constrains the verbosity of the model's response. Lower values will result in
1054
1064
  # more concise responses, while higher values will result in more verbose
1055
- # responses. Currently supported values are `low`, `medium`, and `high`.
1065
+ # responses. Currently supported values are `low`, `medium`, and `high`. The
1066
+ # default is `medium`.
1056
1067
  verbosity: nil
1057
1068
  )
1058
1069
  end
@@ -1078,7 +1089,8 @@ module OpenAI
1078
1089
 
1079
1090
  # Constrains the verbosity of the model's response. Lower values will result in
1080
1091
  # more concise responses, while higher values will result in more verbose
1081
- # responses. Currently supported values are `low`, `medium`, and `high`.
1092
+ # responses. Currently supported values are `low`, `medium`, and `high`. The
1093
+ # default is `medium`.
1082
1094
  module Verbosity
1083
1095
  extend OpenAI::Internal::Type::Enum
1084
1096
 
@@ -236,10 +236,7 @@ module OpenAI
236
236
  # hit rates. Replaces the `user` field.
237
237
  # [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
238
238
  sig { returns(T.nilable(String)) }
239
- attr_reader :prompt_cache_key
240
-
241
- sig { params(prompt_cache_key: String).void }
242
- attr_writer :prompt_cache_key
239
+ attr_accessor :prompt_cache_key
243
240
 
244
241
  # Options for prompt caching. Supported for `gpt-5.6` and later models. By
245
242
  # default, OpenAI automatically chooses one implicit cache breakpoint. You can add
@@ -344,10 +341,7 @@ module OpenAI
344
341
  # identifying information.
345
342
  # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
346
343
  sig { returns(T.nilable(String)) }
347
- attr_reader :safety_identifier
348
-
349
- sig { params(safety_identifier: String).void }
350
- attr_writer :safety_identifier
344
+ attr_accessor :safety_identifier
351
345
 
352
346
  # This feature is in Beta. If specified, our system will make a best effort to
353
347
  # sample deterministically, such that repeated requests with the same `seed` and
@@ -515,7 +509,8 @@ module OpenAI
515
509
 
516
510
  # Constrains the verbosity of the model's response. Lower values will result in
517
511
  # more concise responses, while higher values will result in more verbose
518
- # responses. Currently supported values are `low`, `medium`, and `high`.
512
+ # responses. Currently supported values are `low`, `medium`, and `high`. The
513
+ # default is `medium`.
519
514
  sig do
520
515
  returns(
521
516
  T.nilable(OpenAI::Chat::CompletionCreateParams::Verbosity::OrSymbol)
@@ -584,7 +579,7 @@ module OpenAI
584
579
  prediction:
585
580
  T.nilable(OpenAI::Chat::ChatCompletionPredictionContent::OrHash),
586
581
  presence_penalty: T.nilable(Float),
587
- prompt_cache_key: String,
582
+ prompt_cache_key: T.nilable(String),
588
583
  prompt_cache_options:
589
584
  OpenAI::Chat::CompletionCreateParams::PromptCacheOptions::OrHash,
590
585
  prompt_cache_retention:
@@ -599,7 +594,7 @@ module OpenAI
599
594
  OpenAI::StructuredOutput::JsonSchemaConverter,
600
595
  OpenAI::ResponseFormatJSONObject::OrHash
601
596
  ),
602
- safety_identifier: String,
597
+ safety_identifier: T.nilable(String),
603
598
  seed: T.nilable(Integer),
604
599
  service_tier:
605
600
  T.nilable(
@@ -870,7 +865,8 @@ module OpenAI
870
865
  user: nil,
871
866
  # Constrains the verbosity of the model's response. Lower values will result in
872
867
  # more concise responses, while higher values will result in more verbose
873
- # responses. Currently supported values are `low`, `medium`, and `high`.
868
+ # responses. Currently supported values are `low`, `medium`, and `high`. The
869
+ # default is `medium`.
874
870
  verbosity: nil,
875
871
  # This tool searches the web for relevant results to use in a response. Learn more
876
872
  # about the
@@ -922,7 +918,7 @@ module OpenAI
922
918
  prediction:
923
919
  T.nilable(OpenAI::Chat::ChatCompletionPredictionContent),
924
920
  presence_penalty: T.nilable(Float),
925
- prompt_cache_key: String,
921
+ prompt_cache_key: T.nilable(String),
926
922
  prompt_cache_options:
927
923
  OpenAI::Chat::CompletionCreateParams::PromptCacheOptions,
928
924
  prompt_cache_retention:
@@ -936,7 +932,7 @@ module OpenAI
936
932
  OpenAI::ResponseFormatJSONSchema,
937
933
  OpenAI::ResponseFormatJSONObject
938
934
  ),
939
- safety_identifier: String,
935
+ safety_identifier: T.nilable(String),
940
936
  seed: T.nilable(Integer),
941
937
  service_tier:
942
938
  T.nilable(
@@ -1819,7 +1815,8 @@ module OpenAI
1819
1815
 
1820
1816
  # Constrains the verbosity of the model's response. Lower values will result in
1821
1817
  # more concise responses, while higher values will result in more verbose
1822
- # responses. Currently supported values are `low`, `medium`, and `high`.
1818
+ # responses. Currently supported values are `low`, `medium`, and `high`. The
1819
+ # default is `medium`.
1823
1820
  module Verbosity
1824
1821
  extend OpenAI::Internal::Type::Enum
1825
1822
 
@@ -6,7 +6,10 @@ module OpenAI
6
6
  OrHash =
7
7
  T.type_alias { T.any(OpenAI::Reasoning, OpenAI::Internal::AnyHash) }
8
8
 
9
- # Controls which reasoning items are rendered back to the model on later turns.
9
+ # Controls which reasoning items are rendered back to the model on later turns. If
10
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
11
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
12
+ #
10
13
  # When returned on a response, this is the effective reasoning context mode used
11
14
  # for the response.
12
15
  sig { returns(T.nilable(OpenAI::Reasoning::Context::OrSymbol)) }
@@ -66,7 +69,10 @@ module OpenAI
66
69
  ).returns(T.attached_class)
67
70
  end
68
71
  def self.new(
69
- # Controls which reasoning items are rendered back to the model on later turns.
72
+ # Controls which reasoning items are rendered back to the model on later turns. If
73
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
74
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
75
+ #
70
76
  # When returned on a response, this is the effective reasoning context mode used
71
77
  # for the response.
72
78
  context: nil,
@@ -112,7 +118,10 @@ module OpenAI
112
118
  def to_hash
113
119
  end
114
120
 
115
- # Controls which reasoning items are rendered back to the model on later turns.
121
+ # Controls which reasoning items are rendered back to the model on later turns. If
122
+ # omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
123
+ # model family defaults to `all_turns`; earlier models default to `current_turn`.
124
+ #
116
125
  # When returned on a response, this is the effective reasoning context mode used
117
126
  # for the response.
118
127
  module Context