openai 0.116.0 → 0.118.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 (134) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/admin/organization/projects/project_optional_service_tier.rb +24 -0
  5. data/lib/openai/models/admin/organization/projects/project_service_tier_settings.rb +88 -0
  6. data/lib/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rb +29 -0
  7. data/lib/openai/models/admin/organization/projects/service_tier_setting_update_params.rb +92 -0
  8. data/lib/openai/models/admin/organization/workload_identity_provider.rb +158 -0
  9. data/lib/openai/models/admin/organization/workload_identity_provider_create_params.rb +143 -0
  10. data/lib/openai/models/admin/organization/workload_identity_provider_delete_params.rb +24 -0
  11. data/lib/openai/models/admin/organization/workload_identity_provider_deleted.rb +32 -0
  12. data/lib/openai/models/admin/organization/workload_identity_provider_list_params.rb +58 -0
  13. data/lib/openai/models/admin/organization/workload_identity_provider_retrieve_params.rb +24 -0
  14. data/lib/openai/models/admin/organization/workload_identity_provider_update_params.rb +143 -0
  15. data/lib/openai/models/admin/organization/workload_identity_providers/federation_rule.rb +161 -0
  16. data/lib/openai/models/admin/organization/workload_identity_providers/federation_rule_create_params.rb +144 -0
  17. data/lib/openai/models/admin/organization/workload_identity_providers/federation_rule_delete_params.rb +32 -0
  18. data/lib/openai/models/admin/organization/workload_identity_providers/federation_rule_deleted.rb +34 -0
  19. data/lib/openai/models/admin/organization/workload_identity_providers/federation_rule_list_params.rb +85 -0
  20. data/lib/openai/models/admin/organization/workload_identity_providers/federation_rule_retrieve_params.rb +32 -0
  21. data/lib/openai/models/admin/organization/workload_identity_providers/federation_rule_update_params.rb +134 -0
  22. data/lib/openai/models/beta/beta_response.rb +1 -0
  23. data/lib/openai/models/beta/beta_response_usage.rb +33 -1
  24. data/lib/openai/models/beta/beta_responses_client_event.rb +10 -9
  25. data/lib/openai/models/beta/chatkit/chat_session_workflow_param.rb +5 -3
  26. data/lib/openai/models/beta/chatkit_workflow.rb +5 -3
  27. data/lib/openai/models/beta/response_compact_params.rb +3 -3
  28. data/lib/openai/models/beta/response_create_params.rb +10 -9
  29. data/lib/openai/models/chat/completion_create_params.rb +3 -3
  30. data/lib/openai/models/responses/response.rb +1 -0
  31. data/lib/openai/models/responses/response_compact_params.rb +3 -3
  32. data/lib/openai/models/responses/response_create_params.rb +10 -9
  33. data/lib/openai/models/responses/response_usage.rb +33 -1
  34. data/lib/openai/models/responses/responses_client_event.rb +10 -9
  35. data/lib/openai/resources/admin/organization/projects/service_tier_settings.rb +77 -0
  36. data/lib/openai/resources/admin/organization/projects.rb +6 -0
  37. data/lib/openai/resources/admin/organization/workload_identity_providers/federation_rules.rb +198 -0
  38. data/lib/openai/resources/admin/organization/workload_identity_providers.rb +148 -0
  39. data/lib/openai/resources/admin/organization.rb +6 -0
  40. data/lib/openai/resources/beta/responses.rb +6 -6
  41. data/lib/openai/resources/chat/completions.rb +2 -2
  42. data/lib/openai/resources/responses.rb +3 -3
  43. data/lib/openai/version.rb +1 -1
  44. data/lib/openai.rb +21 -0
  45. data/rbi/openai/models/admin/organization/projects/project_optional_service_tier.rbi +45 -0
  46. data/rbi/openai/models/admin/organization/projects/project_service_tier_settings.rbi +143 -0
  47. data/rbi/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbi +63 -0
  48. data/rbi/openai/models/admin/organization/projects/service_tier_setting_update_params.rbi +183 -0
  49. data/rbi/openai/models/admin/organization/workload_identity_provider.rbi +288 -0
  50. data/rbi/openai/models/admin/organization/workload_identity_provider_create_params.rbi +311 -0
  51. data/rbi/openai/models/admin/organization/workload_identity_provider_delete_params.rbi +57 -0
  52. data/rbi/openai/models/admin/organization/workload_identity_provider_deleted.rbi +64 -0
  53. data/rbi/openai/models/admin/organization/workload_identity_provider_list_params.rbi +111 -0
  54. data/rbi/openai/models/admin/organization/workload_identity_provider_retrieve_params.rbi +57 -0
  55. data/rbi/openai/models/admin/organization/workload_identity_provider_update_params.rbi +317 -0
  56. data/rbi/openai/models/admin/organization/workload_identity_providers/federation_rule.rbi +276 -0
  57. data/rbi/openai/models/admin/organization/workload_identity_providers/federation_rule_create_params.rbi +282 -0
  58. data/rbi/openai/models/admin/organization/workload_identity_providers/federation_rule_delete_params.rbi +72 -0
  59. data/rbi/openai/models/admin/organization/workload_identity_providers/federation_rule_deleted.rbi +68 -0
  60. data/rbi/openai/models/admin/organization/workload_identity_providers/federation_rule_list_params.rbi +153 -0
  61. data/rbi/openai/models/admin/organization/workload_identity_providers/federation_rule_retrieve_params.rbi +72 -0
  62. data/rbi/openai/models/admin/organization/workload_identity_providers/federation_rule_update_params.rbi +281 -0
  63. data/rbi/openai/models/beta/beta_response.rbi +1 -0
  64. data/rbi/openai/models/beta/beta_response_usage.rbi +66 -3
  65. data/rbi/openai/models/beta/beta_responses_client_event.rbi +13 -9
  66. data/rbi/openai/models/beta/chatkit/chat_session_workflow_param.rbi +1 -1
  67. data/rbi/openai/models/beta/chatkit_workflow.rbi +1 -1
  68. data/rbi/openai/models/beta/response_compact_params.rbi +3 -3
  69. data/rbi/openai/models/beta/response_create_params.rbi +10 -9
  70. data/rbi/openai/models/chat/completion_create_params.rbi +3 -3
  71. data/rbi/openai/models/responses/response.rbi +1 -0
  72. data/rbi/openai/models/responses/response_compact_params.rbi +3 -3
  73. data/rbi/openai/models/responses/response_create_params.rbi +10 -9
  74. data/rbi/openai/models/responses/response_usage.rbi +66 -3
  75. data/rbi/openai/models/responses/responses_client_event.rbi +13 -9
  76. data/rbi/openai/resources/admin/organization/projects/service_tier_settings.rbi +67 -0
  77. data/rbi/openai/resources/admin/organization/projects.rbi +3 -0
  78. data/rbi/openai/resources/admin/organization/workload_identity_providers/federation_rules.rbi +148 -0
  79. data/rbi/openai/resources/admin/organization/workload_identity_providers.rbi +123 -0
  80. data/rbi/openai/resources/admin/organization.rbi +3 -0
  81. data/rbi/openai/resources/beta/responses.rbi +6 -6
  82. data/rbi/openai/resources/chat/completions.rbi +2 -2
  83. data/rbi/openai/resources/responses.rbi +3 -3
  84. data/sig/openai/models/admin/organization/external_key_create_params.rbs +9 -9
  85. data/sig/openai/models/admin/organization/projects/project_optional_service_tier.rbs +23 -0
  86. data/sig/openai/models/admin/organization/projects/project_service_tier_settings.rbs +72 -0
  87. data/sig/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbs +32 -0
  88. data/sig/openai/models/admin/organization/projects/service_tier_setting_update_params.rbs +91 -0
  89. data/sig/openai/models/admin/organization/workload_identity_provider.rbs +136 -0
  90. data/sig/openai/models/admin/organization/workload_identity_provider_create_params.rbs +140 -0
  91. data/sig/openai/models/admin/organization/workload_identity_provider_delete_params.rbs +30 -0
  92. data/sig/openai/models/admin/organization/workload_identity_provider_deleted.rbs +34 -0
  93. data/sig/openai/models/admin/organization/workload_identity_provider_list_params.rbs +59 -0
  94. data/sig/openai/models/admin/organization/workload_identity_provider_retrieve_params.rbs +30 -0
  95. data/sig/openai/models/admin/organization/workload_identity_provider_update_params.rbs +145 -0
  96. data/sig/openai/models/admin/organization/workload_identity_providers/federation_rule.rbs +124 -0
  97. data/sig/openai/models/admin/organization/workload_identity_providers/federation_rule_create_params.rbs +126 -0
  98. data/sig/openai/models/admin/organization/workload_identity_providers/federation_rule_delete_params.rbs +37 -0
  99. data/sig/openai/models/admin/organization/workload_identity_providers/federation_rule_deleted.rbs +36 -0
  100. data/sig/openai/models/admin/organization/workload_identity_providers/federation_rule_list_params.rbs +73 -0
  101. data/sig/openai/models/admin/organization/workload_identity_providers/federation_rule_retrieve_params.rbs +37 -0
  102. data/sig/openai/models/admin/organization/workload_identity_providers/federation_rule_update_params.rbs +123 -0
  103. data/sig/openai/models/audio/transcription_create_params.rbs +3 -3
  104. data/sig/openai/models/audio/voice_create_params.rbs +6 -6
  105. data/sig/openai/models/beta/assistant_create_params.rbs +14 -2
  106. data/sig/openai/models/beta/beta_response.rbs +2 -1
  107. data/sig/openai/models/beta/beta_response_usage.rbs +40 -3
  108. data/sig/openai/models/beta/beta_responses_client_event.rbs +11 -10
  109. data/sig/openai/models/beta/chatkit/chat_session_workflow_param.rbs +1 -1
  110. data/sig/openai/models/beta/chatkit_workflow.rbs +1 -1
  111. data/sig/openai/models/beta/response_compact_params.rbs +2 -2
  112. data/sig/openai/models/beta/response_create_params.rbs +11 -10
  113. data/sig/openai/models/beta/thread_create_and_run_params.rbs +14 -2
  114. data/sig/openai/models/beta/thread_create_params.rbs +14 -2
  115. data/sig/openai/models/chat/completion_create_params.rbs +3 -3
  116. data/sig/openai/models/decision_create_params.rbs +42 -0
  117. data/sig/openai/models/eval_create_params.rbs +29 -2
  118. data/sig/openai/models/evals/run_create_params.rbs +53 -2
  119. data/sig/openai/models/responses/response.rbs +2 -1
  120. data/sig/openai/models/responses/response_compact_params.rbs +2 -2
  121. data/sig/openai/models/responses/response_create_params.rbs +11 -10
  122. data/sig/openai/models/responses/response_usage.rbs +40 -3
  123. data/sig/openai/models/responses/responses_client_event.rbs +11 -10
  124. data/sig/openai/resources/admin/organization/external_keys.rbs +3 -3
  125. data/sig/openai/resources/admin/organization/projects/service_tier_settings.rbs +25 -0
  126. data/sig/openai/resources/admin/organization/projects.rbs +2 -0
  127. data/sig/openai/resources/admin/organization/workload_identity_providers/federation_rules.rbs +61 -0
  128. data/sig/openai/resources/admin/organization/workload_identity_providers.rbs +58 -0
  129. data/sig/openai/resources/admin/organization.rbs +2 -0
  130. data/sig/openai/resources/audio/transcriptions.rbs +2 -2
  131. data/sig/openai/resources/audio/voices.rbs +2 -2
  132. data/sig/openai/resources/decisions.rbs +14 -0
  133. data/sig/openai/resources/evals.rbs +8 -1
  134. metadata +64 -1
@@ -84,7 +84,7 @@ module OpenAI
84
84
  module StateVariable
85
85
  extend OpenAI::Internal::Type::Union
86
86
 
87
- Variants = T.type_alias { T.any(String, T::Boolean, Float) }
87
+ Variants = T.type_alias { T.any(String, Integer, T::Boolean, Float) }
88
88
 
89
89
  sig { override.returns(T::Array[OpenAI::Beta::ChatKitWorkflow::StateVariable::Variants]) }
90
90
  def self.variants
@@ -53,7 +53,7 @@ module OpenAI
53
53
  # request can write up to four breakpoints. For cache matching, OpenAI considers
54
54
  # up to the latest 80 breakpoints in the conversation, without a content-block
55
55
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
56
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
56
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
57
57
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
58
58
  # for current details.
59
59
  sig { returns(T.nilable(OpenAI::Beta::ResponseCompactParams::PromptCacheOptions)) }
@@ -151,7 +151,7 @@ module OpenAI
151
151
  # request can write up to four breakpoints. For cache matching, OpenAI considers
152
152
  # up to the latest 80 breakpoints in the conversation, without a content-block
153
153
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
154
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
154
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
155
155
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
156
156
  # for current details.
157
157
  prompt_cache_options: nil,
@@ -486,7 +486,7 @@ module OpenAI
486
486
  # request can write up to four breakpoints. For cache matching, OpenAI considers
487
487
  # up to the latest 80 breakpoints in the conversation, without a content-block
488
488
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
489
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
489
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
490
490
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
491
491
  # for current details.
492
492
  sig do
@@ -162,7 +162,7 @@ module OpenAI
162
162
  # request can write up to four breakpoints. For cache matching, OpenAI considers
163
163
  # up to the latest 80 breakpoints in the conversation, without a content-block
164
164
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
165
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
165
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
166
166
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
167
167
  # for current details.
168
168
  sig { returns(T.nilable(OpenAI::Beta::ResponseCreateParams::PromptCacheOptions)) }
@@ -639,7 +639,7 @@ module OpenAI
639
639
  # request can write up to four breakpoints. For cache matching, OpenAI considers
640
640
  # up to the latest 80 breakpoints in the conversation, without a content-block
641
641
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
642
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
642
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
643
643
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
644
644
  # for current details.
645
645
  prompt_cache_options: nil,
@@ -1563,8 +1563,8 @@ module OpenAI
1563
1563
  attr_writer :prewarm
1564
1564
 
1565
1565
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1566
- # written by the request. Defaults to `30m`, which is currently the only supported
1567
- # value. The backend may retain cache entries for longer.
1566
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1567
+ # backend may retain cache entries for longer.
1568
1568
  sig { returns(T.nilable(OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl::OrSymbol)) }
1569
1569
  attr_reader :ttl
1570
1570
 
@@ -1577,7 +1577,7 @@ module OpenAI
1577
1577
  # request can write up to four breakpoints. For cache matching, OpenAI considers
1578
1578
  # up to the latest 80 breakpoints in the conversation, without a content-block
1579
1579
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
1580
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
1580
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
1581
1581
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
1582
1582
  # for current details.
1583
1583
  sig do
@@ -1612,8 +1612,8 @@ module OpenAI
1612
1612
  prewarm: nil,
1613
1613
 
1614
1614
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1615
- # written by the request. Defaults to `30m`, which is currently the only supported
1616
- # value. The backend may retain cache entries for longer.
1615
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1616
+ # backend may retain cache entries for longer.
1617
1617
 
1618
1618
  ttl: nil
1619
1619
  )
@@ -1655,8 +1655,8 @@ module OpenAI
1655
1655
  end
1656
1656
 
1657
1657
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1658
- # written by the request. Defaults to `30m`, which is currently the only supported
1659
- # value. The backend may retain cache entries for longer.
1658
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1659
+ # backend may retain cache entries for longer.
1660
1660
  module Ttl
1661
1661
  extend OpenAI::Internal::Type::Enum
1662
1662
 
@@ -1664,6 +1664,7 @@ module OpenAI
1664
1664
  OrSymbol = T.type_alias { T.any(Symbol, String) }
1665
1665
 
1666
1666
  TTL_30M = T.let(:"30m", OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl::TaggedSymbol)
1667
+ TTL_12H = T.let(:"12h", OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl::TaggedSymbol)
1667
1668
 
1668
1669
  sig {
1669
1670
  override.returns(T::Array[OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl::TaggedSymbol])
@@ -214,7 +214,7 @@ module OpenAI
214
214
  # request can write up to four breakpoints. For cache matching, OpenAI considers
215
215
  # up to the latest 80 breakpoints in the conversation, without a content-block
216
216
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
217
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
217
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
218
218
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
219
219
  # for current details.
220
220
  sig { returns(T.nilable(OpenAI::Chat::CompletionCreateParams::PromptCacheOptions)) }
@@ -704,7 +704,7 @@ module OpenAI
704
704
  # request can write up to four breakpoints. For cache matching, OpenAI considers
705
705
  # up to the latest 80 breakpoints in the conversation, without a content-block
706
706
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
707
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
707
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
708
708
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
709
709
  # for current details.
710
710
  prompt_cache_options: nil,
@@ -1359,7 +1359,7 @@ module OpenAI
1359
1359
  # request can write up to four breakpoints. For cache matching, OpenAI considers
1360
1360
  # up to the latest 80 breakpoints in the conversation, without a content-block
1361
1361
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
1362
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
1362
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
1363
1363
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
1364
1364
  # for current details.
1365
1365
  sig do
@@ -1856,6 +1856,7 @@ module OpenAI
1856
1856
  OrSymbol = T.type_alias { T.any(Symbol, String) }
1857
1857
 
1858
1858
  TTL_30M = T.let(:"30m", OpenAI::Responses::Response::PromptCacheOptions::Ttl::TaggedSymbol)
1859
+ TTL_12H = T.let(:"12h", OpenAI::Responses::Response::PromptCacheOptions::Ttl::TaggedSymbol)
1859
1860
 
1860
1861
  sig { override.returns(T::Array[OpenAI::Responses::Response::PromptCacheOptions::Ttl::TaggedSymbol]) }
1861
1862
  def self.values
@@ -53,7 +53,7 @@ module OpenAI
53
53
  # request can write up to four breakpoints. For cache matching, OpenAI considers
54
54
  # up to the latest 80 breakpoints in the conversation, without a content-block
55
55
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
56
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
56
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
57
57
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
58
58
  # for current details.
59
59
  sig { returns(T.nilable(OpenAI::Responses::ResponseCompactParams::PromptCacheOptions)) }
@@ -144,7 +144,7 @@ module OpenAI
144
144
  # request can write up to four breakpoints. For cache matching, OpenAI considers
145
145
  # up to the latest 80 breakpoints in the conversation, without a content-block
146
146
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
147
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
147
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
148
148
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
149
149
  # for current details.
150
150
  prompt_cache_options: nil,
@@ -529,7 +529,7 @@ module OpenAI
529
529
  # request can write up to four breakpoints. For cache matching, OpenAI considers
530
530
  # up to the latest 80 breakpoints in the conversation, without a content-block
531
531
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
532
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
532
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
533
533
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
534
534
  # for current details.
535
535
  sig do
@@ -164,7 +164,7 @@ module OpenAI
164
164
  # request can write up to four breakpoints. For cache matching, OpenAI considers
165
165
  # up to the latest 80 breakpoints in the conversation, without a content-block
166
166
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
167
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
167
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
168
168
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
169
169
  # for current details.
170
170
  sig { returns(T.nilable(OpenAI::Responses::ResponseCreateParams::PromptCacheOptions)) }
@@ -633,7 +633,7 @@ module OpenAI
633
633
  # request can write up to four breakpoints. For cache matching, OpenAI considers
634
634
  # up to the latest 80 breakpoints in the conversation, without a content-block
635
635
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
636
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
636
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
637
637
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
638
638
  # for current details.
639
639
  prompt_cache_options: nil,
@@ -1287,8 +1287,8 @@ module OpenAI
1287
1287
  attr_writer :prewarm
1288
1288
 
1289
1289
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1290
- # written by the request. Defaults to `30m`, which is currently the only supported
1291
- # value. The backend may retain cache entries for longer.
1290
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1291
+ # backend may retain cache entries for longer.
1292
1292
  sig { returns(T.nilable(OpenAI::Responses::ResponseCreateParams::PromptCacheOptions::Ttl::OrSymbol)) }
1293
1293
  attr_reader :ttl
1294
1294
 
@@ -1301,7 +1301,7 @@ module OpenAI
1301
1301
  # request can write up to four breakpoints. For cache matching, OpenAI considers
1302
1302
  # up to the latest 80 breakpoints in the conversation, without a content-block
1303
1303
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
1304
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
1304
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
1305
1305
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
1306
1306
  # for current details.
1307
1307
  sig do
@@ -1336,8 +1336,8 @@ module OpenAI
1336
1336
  prewarm: nil,
1337
1337
 
1338
1338
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1339
- # written by the request. Defaults to `30m`, which is currently the only supported
1340
- # value. The backend may retain cache entries for longer.
1339
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1340
+ # backend may retain cache entries for longer.
1341
1341
 
1342
1342
  ttl: nil
1343
1343
  )
@@ -1383,8 +1383,8 @@ module OpenAI
1383
1383
  end
1384
1384
 
1385
1385
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1386
- # written by the request. Defaults to `30m`, which is currently the only supported
1387
- # value. The backend may retain cache entries for longer.
1386
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1387
+ # backend may retain cache entries for longer.
1388
1388
  module Ttl
1389
1389
  extend OpenAI::Internal::Type::Enum
1390
1390
 
@@ -1394,6 +1394,7 @@ module OpenAI
1394
1394
  OrSymbol = T.type_alias { T.any(Symbol, String) }
1395
1395
 
1396
1396
  TTL_30M = T.let(:"30m", OpenAI::Responses::ResponseCreateParams::PromptCacheOptions::Ttl::TaggedSymbol)
1397
+ TTL_12H = T.let(:"12h", OpenAI::Responses::ResponseCreateParams::PromptCacheOptions::Ttl::TaggedSymbol)
1397
1398
 
1398
1399
  sig {
1399
1400
  override.returns(T::Array[OpenAI::Responses::ResponseCreateParams::PromptCacheOptions::Ttl::TaggedSymbol])
@@ -108,13 +108,26 @@ module OpenAI
108
108
  sig { returns(Integer) }
109
109
  attr_accessor :cached_tokens
110
110
 
111
+ sig { returns(T.nilable(OpenAI::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails)) }
112
+ attr_reader :cache_write_tokens_details
113
+
114
+ sig {
115
+ params(
116
+ cache_write_tokens_details: OpenAI::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails::OrHash
117
+ )
118
+ .void
119
+ }
120
+ attr_writer :cache_write_tokens_details
121
+
111
122
  # A detailed breakdown of the input tokens.
112
123
  sig do
113
124
  params(
114
125
 
115
126
  cache_write_tokens: Integer,
116
127
 
117
- cached_tokens: Integer
128
+ cached_tokens: Integer,
129
+
130
+ cache_write_tokens_details: OpenAI::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails::OrHash
118
131
  )
119
132
  .returns(T.attached_class)
120
133
  end
@@ -125,19 +138,69 @@ module OpenAI
125
138
 
126
139
  # The number of tokens that were retrieved from the cache.
127
140
  # [More on prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching).
141
+ cached_tokens:,
128
142
 
129
- cached_tokens:
143
+ cache_write_tokens_details: nil
130
144
  )
131
145
  end
132
146
 
133
147
  sig do
134
148
  override.returns(
135
- {cache_write_tokens: Integer, cached_tokens: Integer}
149
+ {
150
+ cache_write_tokens: Integer,
151
+ cached_tokens: Integer,
152
+ cache_write_tokens_details: OpenAI::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails
153
+ }
136
154
  )
137
155
  end
138
156
  def to_hash
139
157
  end
140
158
 
159
+ class CacheWriteTokensDetails < OpenAI::Internal::Type::BaseModel
160
+ OrHash = T.type_alias do
161
+ T.any(
162
+ OpenAI::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails,
163
+ OpenAI::Internal::AnyHash
164
+ )
165
+ end
166
+
167
+ # The number of input tokens written with 12-hour retention.
168
+ sig { returns(Integer) }
169
+ attr_accessor :ttl_12h_tokens
170
+
171
+ # The number of input tokens written with 30-minute retention.
172
+ sig { returns(Integer) }
173
+ attr_accessor :ttl_30m_tokens
174
+
175
+ sig do
176
+ params(
177
+
178
+ ttl_12h_tokens: Integer,
179
+
180
+ ttl_30m_tokens: Integer
181
+ )
182
+ .returns(T.attached_class)
183
+ end
184
+ def self.new(
185
+
186
+ # The number of input tokens written with 12-hour retention.
187
+ ttl_12h_tokens:,
188
+
189
+ # The number of input tokens written with 30-minute retention.
190
+
191
+ ttl_30m_tokens:
192
+ )
193
+ end
194
+
195
+ sig do
196
+ override.returns(
197
+ {ttl_12h_tokens: Integer, ttl_30m_tokens: Integer}
198
+ )
199
+ end
200
+ def to_hash
201
+ end
202
+
203
+ end
141
204
  end
142
205
 
143
206
  class OutputTokensDetails < OpenAI::Internal::Type::BaseModel
@@ -194,7 +194,7 @@ module OpenAI
194
194
  # request can write up to four breakpoints. For cache matching, OpenAI considers
195
195
  # up to the latest 80 breakpoints in the conversation, without a content-block
196
196
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
197
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
197
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
198
198
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
199
199
  # for current details.
200
200
  sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions)) }
@@ -714,7 +714,7 @@ module OpenAI
714
714
  # request can write up to four breakpoints. For cache matching, OpenAI considers
715
715
  # up to the latest 80 breakpoints in the conversation, without a content-block
716
716
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
717
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
717
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
718
718
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
719
719
  # for current details.
720
720
  prompt_cache_options: nil,
@@ -1478,8 +1478,8 @@ module OpenAI
1478
1478
  attr_writer :prewarm
1479
1479
 
1480
1480
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1481
- # written by the request. Defaults to `30m`, which is currently the only supported
1482
- # value. The backend may retain cache entries for longer.
1481
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1482
+ # backend may retain cache entries for longer.
1483
1483
  sig {
1484
1484
  returns(
1485
1485
  T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl::OrSymbol)
@@ -1499,7 +1499,7 @@ module OpenAI
1499
1499
  # request can write up to four breakpoints. For cache matching, OpenAI considers
1500
1500
  # up to the latest 80 breakpoints in the conversation, without a content-block
1501
1501
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
1502
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
1502
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
1503
1503
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
1504
1504
  # for current details.
1505
1505
  sig do
@@ -1534,8 +1534,8 @@ module OpenAI
1534
1534
  prewarm: nil,
1535
1535
 
1536
1536
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1537
- # written by the request. Defaults to `30m`, which is currently the only supported
1538
- # value. The backend may retain cache entries for longer.
1537
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1538
+ # backend may retain cache entries for longer.
1539
1539
 
1540
1540
  ttl: nil
1541
1541
  )
@@ -1593,8 +1593,8 @@ module OpenAI
1593
1593
  end
1594
1594
 
1595
1595
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1596
- # written by the request. Defaults to `30m`, which is currently the only supported
1597
- # value. The backend may retain cache entries for longer.
1596
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1597
+ # backend may retain cache entries for longer.
1598
1598
  module Ttl
1599
1599
  extend OpenAI::Internal::Type::Enum
1600
1600
 
@@ -1607,6 +1607,10 @@ module OpenAI
1607
1607
  :"30m",
1608
1608
  OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl::TaggedSymbol
1609
1609
  )
1610
+ TTL_12H = T.let(
1611
+ :"12h",
1612
+ OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl::TaggedSymbol
1613
+ )
1610
1614
 
1611
1615
  sig {
1612
1616
  override.returns(
@@ -0,0 +1,67 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Resources
5
+
6
+ class Admin
7
+
8
+ class Organization
9
+
10
+ class Projects
11
+
12
+ class ServiceTierSettings
13
+
14
+ # Retrieve the configured default and enabled service tiers for a project.
15
+ sig {
16
+ params(project_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
17
+ OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings
18
+ )
19
+ }
20
+ def retrieve(
21
+ # The ID of the project
22
+ project_id,
23
+ request_options: {}
24
+ )
25
+ end
26
+
27
+ # Update the default or enabled service tiers atomically. Supply at least one
28
+ # field. Omitted fields keep their current values.
29
+ sig {
30
+ params(
31
+ project_id: String,
32
+ default: OpenAI::Admin::Organization::Projects::ServiceTierSettingUpdateParams::Default::OrSymbol,
33
+ enabled_tiers: T.any(
34
+ Symbol,
35
+ T::Array[OpenAI::Admin::Organization::Projects::ProjectOptionalServiceTier::OrSymbol]
36
+ ),
37
+ request_options: OpenAI::RequestOptions::OrHash
38
+ )
39
+ .returns(OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings)
40
+ }
41
+ def update(
42
+ # The ID of the project
43
+ project_id,
44
+ # Default tier for requests that omit service_tier or use auto.
45
+ default: nil,
46
+ # Additional service tiers enabled for this project. "all" includes future tiers.
47
+ # An empty array allows only Standard. Organization policy and eligibility still
48
+ # apply.
49
+ enabled_tiers: nil,
50
+ request_options: {}
51
+ )
52
+ end
53
+
54
+ # @api private
55
+ sig { params(client: OpenAI::Client).returns(T.attached_class) }
56
+ def self.new(client:)
57
+ end
58
+ end
59
+
60
+ end
61
+
62
+ end
63
+
64
+ end
65
+
66
+ end
67
+ end
@@ -45,6 +45,9 @@ module OpenAI
45
45
  sig { returns(OpenAI::Resources::Admin::Organization::Projects::Certificates) }
46
46
  attr_reader :certificates
47
47
 
48
+ sig { returns(OpenAI::Resources::Admin::Organization::Projects::ServiceTierSettings) }
49
+ attr_reader :service_tier_settings
50
+
48
51
  # Create a new project in the organization. Projects can be created and archived,
49
52
  # but cannot be deleted.
50
53
  sig {
@@ -0,0 +1,148 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Resources
5
+
6
+ class Admin
7
+
8
+ class Organization
9
+
10
+ class WorkloadIdentityProviders
11
+
12
+ class FederationRules
13
+
14
+ # Bind verified token attributes to an existing project service account.
15
+ sig {
16
+ params(
17
+ workload_identity_provider_id: String,
18
+ attribute_matchers: T::Hash[
19
+ Symbol,
20
+ OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRuleCreateParams::AttributeMatcher::Variants
21
+ ],
22
+ project_id: String,
23
+ service_account_id: String,
24
+ description: String,
25
+ enabled: T::Boolean,
26
+ name: String,
27
+ permissions: T.any(
28
+ OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRuleCreateParams::Permissions::ServiceAccountDefault::OrHash,
29
+ OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRuleCreateParams::Permissions::Restricted::OrHash
30
+ ),
31
+ request_options: OpenAI::RequestOptions::OrHash
32
+ )
33
+ .returns(OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRule)
34
+ }
35
+ def create(
36
+ workload_identity_provider_id,
37
+ attribute_matchers:,
38
+ project_id:,
39
+ service_account_id:,
40
+ description: nil,
41
+ enabled: nil,
42
+ name: nil,
43
+ permissions: nil,
44
+ request_options: {}
45
+ )
46
+ end
47
+
48
+ # Retrieve a federation rule owned by the authenticated organization and provider.
49
+ sig {
50
+ params(
51
+ workload_identity_federation_rule_id: String,
52
+ workload_identity_provider_id: String,
53
+ request_options: OpenAI::RequestOptions::OrHash
54
+ )
55
+ .returns(OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRule)
56
+ }
57
+ def retrieve(workload_identity_federation_rule_id, workload_identity_provider_id:, request_options: {})
58
+ end
59
+
60
+ # Update supplied matcher, permission, metadata, or enabled fields.
61
+ sig {
62
+ params(
63
+ workload_identity_federation_rule_id: String,
64
+ workload_identity_provider_id: String,
65
+ attribute_matchers: T::Hash[
66
+ Symbol,
67
+ OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRuleUpdateParams::AttributeMatcher::Variants
68
+ ],
69
+ description: T.nilable(String),
70
+ enabled: T::Boolean,
71
+ name: T.nilable(String),
72
+ permissions: T.any(
73
+ OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRuleUpdateParams::Permissions::DefaultPermissionsParam::OrHash,
74
+ OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRuleUpdateParams::Permissions::RestrictedPermissionsParam::OrHash
75
+ ),
76
+ request_options: OpenAI::RequestOptions::OrHash
77
+ )
78
+ .returns(OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRule)
79
+ }
80
+ def update(
81
+ # Path param
82
+ workload_identity_federation_rule_id,
83
+ # Path param
84
+ workload_identity_provider_id:,
85
+ # Body param
86
+ attribute_matchers: nil,
87
+ # Body param
88
+ description: nil,
89
+ # Body param
90
+ enabled: nil,
91
+ # Body param
92
+ name: nil,
93
+ # Body param
94
+ permissions: nil,
95
+ request_options: {}
96
+ )
97
+ end
98
+
99
+ # List the provider's federation rules to project service accounts.
100
+ sig {
101
+ params(
102
+ workload_identity_provider_id: String,
103
+ after: String,
104
+ limit: Integer,
105
+ order: OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRuleListParams::Order::OrSymbol,
106
+ service_account_id: String,
107
+ request_options: OpenAI::RequestOptions::OrHash
108
+ )
109
+ .returns(
110
+ OpenAI::Internal::CursorPage[OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRule]
111
+ )
112
+ }
113
+ def list(
114
+ workload_identity_provider_id,
115
+ after: nil,
116
+ limit: nil,
117
+ order: nil,
118
+ service_account_id: nil,
119
+ request_options: {}
120
+ )
121
+ end
122
+
123
+ # Delete a federation rule to a project service account.
124
+ sig {
125
+ params(
126
+ workload_identity_federation_rule_id: String,
127
+ workload_identity_provider_id: String,
128
+ request_options: OpenAI::RequestOptions::OrHash
129
+ )
130
+ .returns(OpenAI::Admin::Organization::WorkloadIdentityProviders::FederationRuleDeleted)
131
+ }
132
+ def delete(workload_identity_federation_rule_id, workload_identity_provider_id:, request_options: {})
133
+ end
134
+
135
+ # @api private
136
+ sig { params(client: OpenAI::Client).returns(T.attached_class) }
137
+ def self.new(client:)
138
+ end
139
+ end
140
+
141
+ end
142
+
143
+ end
144
+
145
+ end
146
+
147
+ end
148
+ end