Skip to content

Commit 797348a

Browse files
feat(api): add o3 and o4-mini model IDs
1 parent 8384d5a commit 797348a

33 files changed

+636
-63
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 95
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a555f81249cb084f463dcefa4aba069f9341fdaf3dd6ac27d7f237fc90e8f488.yml
3-
openapi_spec_hash: 8e590296cd1a54b9508510b0c7a2c45a
4-
config_hash: 5ea32de61ff42fcf5e66cff8d9e247ea
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5633633cc38734869cf7d993f7b549bb8e4d10e0ec45381ec2cd91507cd8eb8f.yml
3+
openapi_spec_hash: c855121b2b2324b99499c9244c21d24d
4+
config_hash: d20837393b73efdb19cd08e04c1cc9a1

lib/openai/models/chat/chat_completion.rb

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,23 @@ class ChatCompletion < OpenAI::Internal::Type::BaseModel
3939
required :object, const: :"chat.completion"
4040

4141
# @!attribute service_tier
42-
# The service tier used for processing the request.
42+
# Specifies the latency tier to use for processing the request. This parameter is
43+
# relevant for customers subscribed to the scale tier service:
44+
#
45+
# - If set to 'auto', and the Project is Scale tier enabled, the system will
46+
# utilize scale tier credits until they are exhausted.
47+
# - If set to 'auto', and the Project is not Scale tier enabled, the request will
48+
# be processed using the default service tier with a lower uptime SLA and no
49+
# latency guarentee.
50+
# - If set to 'default', the request will be processed using the default service
51+
# tier with a lower uptime SLA and no latency guarentee.
52+
# - If set to 'flex', the request will be processed with the Flex Processing
53+
# service tier.
54+
# [Learn more](https://platform.openai.com/docs/guides/flex-processing).
55+
# - When not set, the default behavior is 'auto'.
56+
#
57+
# When this parameter is set, the response body will include the `service_tier`
58+
# utilized.
4359
#
4460
# @return [Symbol, OpenAI::Models::Chat::ChatCompletion::ServiceTier, nil]
4561
optional :service_tier, enum: -> { OpenAI::Models::Chat::ChatCompletion::ServiceTier }, nil?: true
@@ -190,14 +206,31 @@ class Logprobs < OpenAI::Internal::Type::BaseModel
190206
end
191207
end
192208

193-
# The service tier used for processing the request.
209+
# Specifies the latency tier to use for processing the request. This parameter is
210+
# relevant for customers subscribed to the scale tier service:
211+
#
212+
# - If set to 'auto', and the Project is Scale tier enabled, the system will
213+
# utilize scale tier credits until they are exhausted.
214+
# - If set to 'auto', and the Project is not Scale tier enabled, the request will
215+
# be processed using the default service tier with a lower uptime SLA and no
216+
# latency guarentee.
217+
# - If set to 'default', the request will be processed using the default service
218+
# tier with a lower uptime SLA and no latency guarentee.
219+
# - If set to 'flex', the request will be processed with the Flex Processing
220+
# service tier.
221+
# [Learn more](https://platform.openai.com/docs/guides/flex-processing).
222+
# - When not set, the default behavior is 'auto'.
223+
#
224+
# When this parameter is set, the response body will include the `service_tier`
225+
# utilized.
194226
#
195227
# @see OpenAI::Models::Chat::ChatCompletion#service_tier
196228
module ServiceTier
197229
extend OpenAI::Internal::Type::Enum
198230

199-
SCALE = :scale
231+
AUTO = :auto
200232
DEFAULT = :default
233+
FLEX = :flex
201234

202235
finalize!
203236

lib/openai/models/chat/chat_completion_audio_param.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ChatCompletionAudioParam < OpenAI::Internal::Type::BaseModel
1313

1414
# @!attribute voice
1515
# The voice the model uses to respond. Supported voices are `alloy`, `ash`,
16-
# `ballad`, `coral`, `echo`, `sage`, and `shimmer`.
16+
# `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`.
1717
#
1818
# @return [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
1919
required :voice, union: -> { OpenAI::Models::Chat::ChatCompletionAudioParam::Voice }
@@ -38,6 +38,7 @@ module Format
3838
extend OpenAI::Internal::Type::Enum
3939

4040
WAV = :wav
41+
AAC = :aac
4142
MP3 = :mp3
4243
FLAC = :flac
4344
OPUS = :opus
@@ -51,7 +52,7 @@ module Format
5152
end
5253

5354
# The voice the model uses to respond. Supported voices are `alloy`, `ash`,
54-
# `ballad`, `coral`, `echo`, `sage`, and `shimmer`.
55+
# `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`.
5556
#
5657
# @see OpenAI::Models::Chat::ChatCompletionAudioParam#voice
5758
module Voice

lib/openai/models/chat/chat_completion_chunk.rb

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,23 @@ class ChatCompletionChunk < OpenAI::Internal::Type::BaseModel
3939
required :object, const: :"chat.completion.chunk"
4040

4141
# @!attribute service_tier
42-
# The service tier used for processing the request.
42+
# Specifies the latency tier to use for processing the request. This parameter is
43+
# relevant for customers subscribed to the scale tier service:
44+
#
45+
# - If set to 'auto', and the Project is Scale tier enabled, the system will
46+
# utilize scale tier credits until they are exhausted.
47+
# - If set to 'auto', and the Project is not Scale tier enabled, the request will
48+
# be processed using the default service tier with a lower uptime SLA and no
49+
# latency guarentee.
50+
# - If set to 'default', the request will be processed using the default service
51+
# tier with a lower uptime SLA and no latency guarentee.
52+
# - If set to 'flex', the request will be processed with the Flex Processing
53+
# service tier.
54+
# [Learn more](https://platform.openai.com/docs/guides/flex-processing).
55+
# - When not set, the default behavior is 'auto'.
56+
#
57+
# When this parameter is set, the response body will include the `service_tier`
58+
# utilized.
4359
#
4460
# @return [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::ServiceTier, nil]
4561
optional :service_tier, enum: -> { OpenAI::Models::Chat::ChatCompletionChunk::ServiceTier }, nil?: true
@@ -406,14 +422,31 @@ class Logprobs < OpenAI::Internal::Type::BaseModel
406422
end
407423
end
408424

409-
# The service tier used for processing the request.
425+
# Specifies the latency tier to use for processing the request. This parameter is
426+
# relevant for customers subscribed to the scale tier service:
427+
#
428+
# - If set to 'auto', and the Project is Scale tier enabled, the system will
429+
# utilize scale tier credits until they are exhausted.
430+
# - If set to 'auto', and the Project is not Scale tier enabled, the request will
431+
# be processed using the default service tier with a lower uptime SLA and no
432+
# latency guarentee.
433+
# - If set to 'default', the request will be processed using the default service
434+
# tier with a lower uptime SLA and no latency guarentee.
435+
# - If set to 'flex', the request will be processed with the Flex Processing
436+
# service tier.
437+
# [Learn more](https://platform.openai.com/docs/guides/flex-processing).
438+
# - When not set, the default behavior is 'auto'.
439+
#
440+
# When this parameter is set, the response body will include the `service_tier`
441+
# utilized.
410442
#
411443
# @see OpenAI::Models::Chat::ChatCompletionChunk#service_tier
412444
module ServiceTier
413445
extend OpenAI::Internal::Type::Enum
414446

415-
SCALE = :scale
447+
AUTO = :auto
416448
DEFAULT = :default
449+
FLEX = :flex
417450

418451
finalize!
419452

lib/openai/models/chat/completion_create_params.rb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel
2424
-> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Chat::ChatCompletionMessageParam] }
2525

2626
# @!attribute model
27-
# Model ID used to generate the response, like `gpt-4o` or `o1`. OpenAI offers a
27+
# Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
2828
# wide range of models with different capabilities, performance characteristics,
2929
# and price points. Refer to the
3030
# [model guide](https://platform.openai.com/docs/models) to browse and compare
@@ -121,7 +121,7 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel
121121
#
122122
# This value is now deprecated in favor of `max_completion_tokens`, and is not
123123
# compatible with
124-
# [o1 series models](https://platform.openai.com/docs/guides/reasoning).
124+
# [o-series models](https://platform.openai.com/docs/guides/reasoning).
125125
#
126126
# @return [Integer, nil]
127127
optional :max_tokens, Integer, nil?: true
@@ -240,6 +240,9 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel
240240
# latency guarentee.
241241
# - If set to 'default', the request will be processed using the default service
242242
# tier with a lower uptime SLA and no latency guarentee.
243+
# - If set to 'flex', the request will be processed with the Flex Processing
244+
# service tier.
245+
# [Learn more](https://platform.openai.com/docs/guides/flex-processing).
243246
# - When not set, the default behavior is 'auto'.
244247
#
245248
# When this parameter is set, the response body will include the `service_tier`
@@ -249,6 +252,8 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel
249252
optional :service_tier, enum: -> { OpenAI::Models::Chat::CompletionCreateParams::ServiceTier }, nil?: true
250253

251254
# @!attribute stop
255+
# Not supported with latest reasoning models `o3` and `o4-mini`.
256+
#
252257
# Up to 4 sequences where the API will stop generating further tokens. The
253258
# returned text will not contain the stop sequence.
254259
#
@@ -422,7 +427,7 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel
422427

423428
# def initialize: (Hash | OpenAI::Internal::Type::BaseModel) -> void
424429

425-
# Model ID used to generate the response, like `gpt-4o` or `o1`. OpenAI offers a
430+
# Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
426431
# wide range of models with different capabilities, performance characteristics,
427432
# and price points. Refer to the
428433
# [model guide](https://platform.openai.com/docs/models) to browse and compare
@@ -432,7 +437,7 @@ module Model
432437

433438
variant String
434439

435-
# Model ID used to generate the response, like `gpt-4o` or `o1`. OpenAI
440+
# Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
436441
# offers a wide range of models with different capabilities, performance
437442
# characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
438443
# to browse and compare available models.
@@ -589,6 +594,9 @@ module ResponseFormat
589594
# latency guarentee.
590595
# - If set to 'default', the request will be processed using the default service
591596
# tier with a lower uptime SLA and no latency guarentee.
597+
# - If set to 'flex', the request will be processed with the Flex Processing
598+
# service tier.
599+
# [Learn more](https://platform.openai.com/docs/guides/flex-processing).
592600
# - When not set, the default behavior is 'auto'.
593601
#
594602
# When this parameter is set, the response body will include the `service_tier`
@@ -598,6 +606,7 @@ module ServiceTier
598606

599607
AUTO = :auto
600608
DEFAULT = :default
609+
FLEX = :flex
601610

602611
finalize!
603612

@@ -606,6 +615,8 @@ module ServiceTier
606615
# def self.values; end
607616
end
608617

618+
# Not supported with latest reasoning models `o3` and `o4-mini`.
619+
#
609620
# Up to 4 sequences where the API will stop generating further tokens. The
610621
# returned text will not contain the stop sequence.
611622
module Stop

lib/openai/models/chat_model.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ module ChatModel
1111
GPT_4_1_2025_04_14 = :"gpt-4.1-2025-04-14"
1212
GPT_4_1_MINI_2025_04_14 = :"gpt-4.1-mini-2025-04-14"
1313
GPT_4_1_NANO_2025_04_14 = :"gpt-4.1-nano-2025-04-14"
14+
O4_MINI = :"o4-mini"
15+
O4_MINI_2025_04_16 = :"o4-mini-2025-04-16"
16+
O3 = :o3
17+
O3_2025_04_16 = :"o3-2025-04-16"
1418
O3_MINI = :"o3-mini"
1519
O3_MINI_2025_01_31 = :"o3-mini-2025-01-31"
1620
O1 = :o1

lib/openai/models/completion_create_params.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel
133133
optional :seed, Integer, nil?: true
134134

135135
# @!attribute stop
136+
# Not supported with latest reasoning models `o3` and `o4-mini`.
137+
#
136138
# Up to 4 sequences where the API will stop generating further tokens. The
137139
# returned text will not contain the stop sequence.
138140
#
@@ -288,6 +290,8 @@ module Prompt
288290
ArrayOfToken2DArray = OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::ArrayOf[Integer]]
289291
end
290292

293+
# Not supported with latest reasoning models `o3` and `o4-mini`.
294+
#
291295
# Up to 4 sequences where the API will stop generating further tokens. The
292296
# returned text will not contain the stop sequence.
293297
module Stop

lib/openai/models/reasoning.rb

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,23 @@ class Reasoning < OpenAI::Internal::Type::BaseModel
1515
optional :effort, enum: -> { OpenAI::Models::ReasoningEffort }, nil?: true
1616

1717
# @!attribute generate_summary
18-
# **computer_use_preview only**
18+
# **Deprecated:** use `summary` instead.
1919
#
2020
# A summary of the reasoning performed by the model. This can be useful for
21-
# debugging and understanding the model's reasoning process. One of `concise` or
22-
# `detailed`.
21+
# debugging and understanding the model's reasoning process. One of `auto`,
22+
# `concise`, or `detailed`.
2323
#
2424
# @return [Symbol, OpenAI::Models::Reasoning::GenerateSummary, nil]
2525
optional :generate_summary, enum: -> { OpenAI::Models::Reasoning::GenerateSummary }, nil?: true
2626

27+
# @!attribute summary
28+
# A summary of the reasoning performed by the model. This can be useful for
29+
# debugging and understanding the model's reasoning process. One of `auto`,
30+
# `concise`, or `detailed`.
31+
#
32+
# @return [Symbol, OpenAI::Models::Reasoning::Summary, nil]
33+
optional :summary, enum: -> { OpenAI::Models::Reasoning::Summary }, nil?: true
34+
2735
# @!parse
2836
# # **o-series models only**
2937
# #
@@ -32,21 +40,44 @@ class Reasoning < OpenAI::Internal::Type::BaseModel
3240
# #
3341
# # @param effort [Symbol, OpenAI::Models::ReasoningEffort, nil]
3442
# # @param generate_summary [Symbol, OpenAI::Models::Reasoning::GenerateSummary, nil]
43+
# # @param summary [Symbol, OpenAI::Models::Reasoning::Summary, nil]
3544
# #
36-
# def initialize(effort: nil, generate_summary: nil, **) = super
45+
# def initialize(effort: nil, generate_summary: nil, summary: nil, **) = super
3746

3847
# def initialize: (Hash | OpenAI::Internal::Type::BaseModel) -> void
3948

40-
# **computer_use_preview only**
49+
# @deprecated
50+
#
51+
# **Deprecated:** use `summary` instead.
4152
#
4253
# A summary of the reasoning performed by the model. This can be useful for
43-
# debugging and understanding the model's reasoning process. One of `concise` or
44-
# `detailed`.
54+
# debugging and understanding the model's reasoning process. One of `auto`,
55+
# `concise`, or `detailed`.
4556
#
4657
# @see OpenAI::Models::Reasoning#generate_summary
4758
module GenerateSummary
4859
extend OpenAI::Internal::Type::Enum
4960

61+
AUTO = :auto
62+
CONCISE = :concise
63+
DETAILED = :detailed
64+
65+
finalize!
66+
67+
# @!parse
68+
# # @return [Array<Symbol>]
69+
# def self.values; end
70+
end
71+
72+
# A summary of the reasoning performed by the model. This can be useful for
73+
# debugging and understanding the model's reasoning process. One of `auto`,
74+
# `concise`, or `detailed`.
75+
#
76+
# @see OpenAI::Models::Reasoning#summary
77+
module Summary
78+
extend OpenAI::Internal::Type::Enum
79+
80+
AUTO = :auto
5081
CONCISE = :concise
5182
DETAILED = :detailed
5283

0 commit comments

Comments
 (0)