Skip to content

Commit 1963c8b

Browse files
authored
Merge pull request #272 from openai/release-please--branches--main--changes--next
release: 0.63.0
2 parents 97de201 + ad92c39 commit 1963c8b

16 files changed

Lines changed: 175 additions & 29 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.62.0"
2+
".": "0.63.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 232
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-371f497afe4d6070f6e252e5febbe8f453c7058a8dff0c26a01b4d88442a4ac2.yml
3-
openapi_spec_hash: d39f46e8fda45f77096448105efd175a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-50d816559ef0935e64d07789ff936a2b762e26ab0714a2fa6bc06d06d4484294.yml
3+
openapi_spec_hash: c5d8f37edbf66c1fef627d787b4c54fd
44
config_hash: b64135fff1fe9cf4069b9ecf59ae8b07

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.63.0 (2026-05-13)
4+
5+
Full Changelog: [v0.62.0...v0.63.0](https://github.com/openai/openai-ruby/compare/v0.62.0...v0.63.0)
6+
7+
### Features
8+
9+
* **api:** add service_tier parameter to responses compact method ([b0ed0cb](https://github.com/openai/openai-ruby/commit/b0ed0cbce8afbf6a2d099dbfed4c4d734ac10d0d))
10+
311
## 0.62.0 (2026-05-07)
412

513
Full Changelog: [v0.61.0...v0.62.0](https://github.com/openai/openai-ruby/compare/v0.61.0...v0.62.0)

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
openai (0.62.0)
14+
openai (0.63.0)
1515
base64
1616
cgi
1717
connection_pool

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
1515
<!-- x-release-please-start-version -->
1616

1717
```ruby
18-
gem "openai", "~> 0.62.0"
18+
gem "openai", "~> 0.63.0"
1919
```
2020

2121
<!-- x-release-please-end -->
@@ -111,6 +111,7 @@ Note that you can also pass a raw `IO` descriptor, but this disables retries, as
111111

112112
For secure, automated environments like cloud-managed Kubernetes, Azure, and GCP, you can use workload identity authentication with short-lived tokens from cloud identity providers instead of long-lived API keys.
113113

114+
`client_id` remains available as an optional parameter for token exchange setups that require an explicit OAuth client ID.
114115

115116
### Kubernetes Service Account
116117

@@ -121,7 +122,6 @@ require "openai"
121122
provider = OpenAI::Auth::SubjectTokenProviders::K8sServiceAccountTokenProvider.new
122123

123124
workload_identity = OpenAI::Auth::WorkloadIdentity.new(
124-
client_id: ENV["OAUTH_CLIENT_ID"], # This is the default and can be omitted
125125
identity_provider_id: ENV["IDENTITY_PROVIDER_ID"], # This is the default and can be omitted
126126
service_account_id: ENV["SERVICE_ACCOUNT_ID"], # This is the default and can be omitted
127127
provider: provider
@@ -143,7 +143,6 @@ response = client.chat.completions.create(
143143
provider = OpenAI::Auth::SubjectTokenProviders::AzureManagedIdentityTokenProvider.new
144144

145145
workload_identity = OpenAI::Auth::WorkloadIdentity.new(
146-
client_id: ENV["OAUTH_CLIENT_ID"], # This is the default and can be omitted
147146
identity_provider_id: ENV["IDENTITY_PROVIDER_ID"], # This is the default and can be omitted
148147
service_account_id: ENV["SERVICE_ACCOUNT_ID"], # This is the default and can be omitted
149148
provider: provider
@@ -160,7 +159,6 @@ client = OpenAI::Client.new(
160159
provider = OpenAI::Auth::SubjectTokenProviders::GCPIDTokenProvider.new
161160

162161
workload_identity = OpenAI::Auth::WorkloadIdentity.new(
163-
client_id: ENV["OAUTH_CLIENT_ID"], # This is the default and can be omitted
164162
identity_provider_id: ENV["IDENTITY_PROVIDER_ID"], # This is the default and can be omitted
165163
service_account_id: ENV["SERVICE_ACCOUNT_ID"], # This is the default and can be omitted
166164
provider: provider
@@ -191,7 +189,6 @@ end
191189
provider = CustomProvider.new
192190

193191
workload_identity = OpenAI::Auth::WorkloadIdentity.new(
194-
client_id: ENV["OAUTH_CLIENT_ID"], # This is the default and can be omitted
195192
identity_provider_id: ENV["IDENTITY_PROVIDER_ID"], # This is the default and can be omitted
196193
service_account_id: ENV["SERVICE_ACCOUNT_ID"], # This is the default and can be omitted
197194
provider: provider

lib/openai/auth/workload_identity.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ class WorkloadIdentity
66
attr_reader :client_id, :identity_provider_id, :service_account_id, :provider, :refresh_buffer_seconds
77

88
def initialize(
9-
client_id:,
109
identity_provider_id:,
1110
service_account_id:,
1211
provider:,
12+
client_id: nil,
1313
refresh_buffer_seconds: 1200
1414
)
15-
@client_id = client_id.to_s
15+
@client_id = client_id&.to_s
1616
@identity_provider_id = identity_provider_id.to_s
1717
@service_account_id = service_account_id.to_s
1818
@provider = provider

lib/openai/auth/workload_identity_auth.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,15 @@ def fetch_token_from_exchange
9292

9393
request = Net::HTTP::Post.new(@token_exchange_url)
9494
request["Content-Type"] = "application/json"
95-
request.body = JSON.generate(
95+
body = {
9696
grant_type: TOKEN_EXCHANGE_GRANT_TYPE,
97-
client_id: @config.client_id,
9897
subject_token: subject_token,
9998
subject_token_type: subject_token_type,
10099
identity_provider_id: @config.identity_provider_id,
101100
service_account_id: @config.service_account_id
102-
)
101+
}
102+
body[:client_id] = @config.client_id unless @config.client_id.nil?
103+
request.body = JSON.generate(body)
103104

104105
response = Net::HTTP.start(
105106
@token_exchange_url.hostname,

lib/openai/models/responses/response_compact_params.rb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ class ResponseCompactParams < OpenAI::Internal::Type::BaseModel
5656
enum: -> { OpenAI::Responses::ResponseCompactParams::PromptCacheRetention },
5757
nil?: true
5858

59-
# @!method initialize(model:, input: nil, instructions: nil, previous_response_id: nil, prompt_cache_key: nil, prompt_cache_retention: nil, request_options: {})
59+
# @!attribute service_tier
60+
# The service tier to use for this request.
61+
#
62+
# @return [Symbol, OpenAI::Models::Responses::ResponseCompactParams::ServiceTier, nil]
63+
optional :service_tier, enum: -> { OpenAI::Responses::ResponseCompactParams::ServiceTier }, nil?: true
64+
65+
# @!method initialize(model:, input: nil, instructions: nil, previous_response_id: nil, prompt_cache_key: nil, prompt_cache_retention: nil, service_tier: nil, request_options: {})
6066
# Some parameter documentations has been truncated, see
6167
# {OpenAI::Models::Responses::ResponseCompactParams} for more details.
6268
#
@@ -72,6 +78,8 @@ class ResponseCompactParams < OpenAI::Internal::Type::BaseModel
7278
#
7379
# @param prompt_cache_retention [Symbol, OpenAI::Models::Responses::ResponseCompactParams::PromptCacheRetention, nil] How long to retain a prompt cache entry created by this request.
7480
#
81+
# @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCompactParams::ServiceTier, nil] The service tier to use for this request.
82+
#
7583
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
7684

7785
# Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a
@@ -401,6 +409,19 @@ module PromptCacheRetention
401409
# @!method self.values
402410
# @return [Array<Symbol>]
403411
end
412+
413+
# The service tier to use for this request.
414+
module ServiceTier
415+
extend OpenAI::Internal::Type::Enum
416+
417+
AUTO = :auto
418+
DEFAULT = :default
419+
FLEX = :flex
420+
PRIORITY = :priority
421+
422+
# @!method self.values
423+
# @return [Array<Symbol>]
424+
end
404425
end
405426
end
406427
end

lib/openai/resources/responses.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def cancel(response_id, params = {})
483483
# For ZDR-compatible compaction details, see
484484
# [Compaction (advanced)](https://platform.openai.com/docs/guides/conversation-state#compaction-advanced).
485485
#
486-
# @overload compact(model:, input: nil, instructions: nil, previous_response_id: nil, prompt_cache_key: nil, prompt_cache_retention: nil, request_options: {})
486+
# @overload compact(model:, input: nil, instructions: nil, previous_response_id: nil, prompt_cache_key: nil, prompt_cache_retention: nil, service_tier: nil, request_options: {})
487487
#
488488
# @param model [Symbol, String, OpenAI::Models::Responses::ResponseCompactParams::Model, nil] Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wi
489489
#
@@ -497,6 +497,8 @@ def cancel(response_id, params = {})
497497
#
498498
# @param prompt_cache_retention [Symbol, OpenAI::Models::Responses::ResponseCompactParams::PromptCacheRetention, nil] How long to retain a prompt cache entry created by this request.
499499
#
500+
# @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCompactParams::ServiceTier, nil] The service tier to use for this request.
501+
#
500502
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
501503
#
502504
# @return [OpenAI::Models::Responses::CompactedResponse]

lib/openai/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module OpenAI
4-
VERSION = "0.62.0"
4+
VERSION = "0.63.0"
55
end

0 commit comments

Comments
 (0)