Skip to content

Commit c5ede36

Browse files
feat(api): add o3 and o4-mini model IDs
1 parent bf6dd81 commit c5ede36

16 files changed

+342
-69
lines changed

Diff for: .stats.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 97
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

Diff for: src/openai/resources/chat/completions/completions.py

+56-26
Large diffs are not rendered by default.

Diff for: src/openai/resources/completions.py

+18-6
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ def create(
159159
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
160160
response parameter to monitor changes in the backend.
161161
162-
stop: Up to 4 sequences where the API will stop generating further tokens. The
162+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
163+
164+
Up to 4 sequences where the API will stop generating further tokens. The
163165
returned text will not contain the stop sequence.
164166
165167
stream: Whether to stream back partial progress. If set, tokens will be sent as
@@ -319,7 +321,9 @@ def create(
319321
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
320322
response parameter to monitor changes in the backend.
321323
322-
stop: Up to 4 sequences where the API will stop generating further tokens. The
324+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
325+
326+
Up to 4 sequences where the API will stop generating further tokens. The
323327
returned text will not contain the stop sequence.
324328
325329
stream_options: Options for streaming response. Only set this when you set `stream: true`.
@@ -472,7 +476,9 @@ def create(
472476
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
473477
response parameter to monitor changes in the backend.
474478
475-
stop: Up to 4 sequences where the API will stop generating further tokens. The
479+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
480+
481+
Up to 4 sequences where the API will stop generating further tokens. The
476482
returned text will not contain the stop sequence.
477483
478484
stream_options: Options for streaming response. Only set this when you set `stream: true`.
@@ -703,7 +709,9 @@ async def create(
703709
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
704710
response parameter to monitor changes in the backend.
705711
706-
stop: Up to 4 sequences where the API will stop generating further tokens. The
712+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
713+
714+
Up to 4 sequences where the API will stop generating further tokens. The
707715
returned text will not contain the stop sequence.
708716
709717
stream: Whether to stream back partial progress. If set, tokens will be sent as
@@ -863,7 +871,9 @@ async def create(
863871
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
864872
response parameter to monitor changes in the backend.
865873
866-
stop: Up to 4 sequences where the API will stop generating further tokens. The
874+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
875+
876+
Up to 4 sequences where the API will stop generating further tokens. The
867877
returned text will not contain the stop sequence.
868878
869879
stream_options: Options for streaming response. Only set this when you set `stream: true`.
@@ -1016,7 +1026,9 @@ async def create(
10161026
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
10171027
response parameter to monitor changes in the backend.
10181028
1019-
stop: Up to 4 sequences where the API will stop generating further tokens. The
1029+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
1030+
1031+
Up to 4 sequences where the API will stop generating further tokens. The
10201032
returned text will not contain the stop sequence.
10211033
10221034
stream_options: Options for streaming response. Only set this when you set `stream: true`.

Diff for: src/openai/resources/responses/responses.py

+124-6
Large diffs are not rendered by default.

Diff for: src/openai/types/chat/chat_completion.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,26 @@ class ChatCompletion(BaseModel):
5959
object: Literal["chat.completion"]
6060
"""The object type, which is always `chat.completion`."""
6161

62-
service_tier: Optional[Literal["scale", "default"]] = None
63-
"""The service tier used for processing the request."""
62+
service_tier: Optional[Literal["auto", "default", "flex"]] = None
63+
"""Specifies the latency tier to use for processing the request.
64+
65+
This parameter is relevant for customers subscribed to the scale tier service:
66+
67+
- If set to 'auto', and the Project is Scale tier enabled, the system will
68+
utilize scale tier credits until they are exhausted.
69+
- If set to 'auto', and the Project is not Scale tier enabled, the request will
70+
be processed using the default service tier with a lower uptime SLA and no
71+
latency guarentee.
72+
- If set to 'default', the request will be processed using the default service
73+
tier with a lower uptime SLA and no latency guarentee.
74+
- If set to 'flex', the request will be processed with the Flex Processing
75+
service tier.
76+
[Learn more](https://platform.openai.com/docs/guides/flex-processing).
77+
- When not set, the default behavior is 'auto'.
78+
79+
When this parameter is set, the response body will include the `service_tier`
80+
utilized.
81+
"""
6482

6583
system_fingerprint: Optional[str] = None
6684
"""This fingerprint represents the backend configuration that the model runs with.

Diff for: src/openai/types/chat/chat_completion_audio_param.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class ChatCompletionAudioParam(TypedDict, total=False):
12-
format: Required[Literal["wav", "mp3", "flac", "opus", "pcm16"]]
12+
format: Required[Literal["wav", "aac", "mp3", "flac", "opus", "pcm16"]]
1313
"""Specifies the output audio format.
1414
1515
Must be one of `wav`, `mp3`, `flac`, `opus`, or `pcm16`.
@@ -22,6 +22,6 @@ class ChatCompletionAudioParam(TypedDict, total=False):
2222
]
2323
"""The voice the model uses to respond.
2424
25-
Supported voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, and
26-
`shimmer`.
25+
Supported voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`,
26+
`onyx`, `sage`, and `shimmer`.
2727
"""

Diff for: src/openai/types/chat/chat_completion_chunk.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,26 @@ class ChatCompletionChunk(BaseModel):
128128
object: Literal["chat.completion.chunk"]
129129
"""The object type, which is always `chat.completion.chunk`."""
130130

131-
service_tier: Optional[Literal["scale", "default"]] = None
132-
"""The service tier used for processing the request."""
131+
service_tier: Optional[Literal["auto", "default", "flex"]] = None
132+
"""Specifies the latency tier to use for processing the request.
133+
134+
This parameter is relevant for customers subscribed to the scale tier service:
135+
136+
- If set to 'auto', and the Project is Scale tier enabled, the system will
137+
utilize scale tier credits until they are exhausted.
138+
- If set to 'auto', and the Project is not Scale tier enabled, the request will
139+
be processed using the default service tier with a lower uptime SLA and no
140+
latency guarentee.
141+
- If set to 'default', the request will be processed using the default service
142+
tier with a lower uptime SLA and no latency guarentee.
143+
- If set to 'flex', the request will be processed with the Flex Processing
144+
service tier.
145+
[Learn more](https://platform.openai.com/docs/guides/flex-processing).
146+
- When not set, the default behavior is 'auto'.
147+
148+
When this parameter is set, the response body will include the `service_tier`
149+
utilized.
150+
"""
133151

134152
system_fingerprint: Optional[str] = None
135153
"""

Diff for: src/openai/types/chat/completion_create_params.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
4545
"""
4646

4747
model: Required[Union[str, ChatModel]]
48-
"""Model ID used to generate the response, like `gpt-4o` or `o1`.
48+
"""Model ID used to generate the response, like `gpt-4o` or `o3`.
4949
5050
OpenAI offers a wide range of models with different capabilities, performance
5151
characteristics, and price points. Refer to the
@@ -123,7 +123,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
123123
124124
This value is now deprecated in favor of `max_completion_tokens`, and is not
125125
compatible with
126-
[o1 series models](https://platform.openai.com/docs/guides/reasoning).
126+
[o-series models](https://platform.openai.com/docs/guides/reasoning).
127127
"""
128128

129129
metadata: Optional[Metadata]
@@ -208,7 +208,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
208208
in the backend.
209209
"""
210210

211-
service_tier: Optional[Literal["auto", "default"]]
211+
service_tier: Optional[Literal["auto", "default", "flex"]]
212212
"""Specifies the latency tier to use for processing the request.
213213
214214
This parameter is relevant for customers subscribed to the scale tier service:
@@ -220,16 +220,20 @@ class CompletionCreateParamsBase(TypedDict, total=False):
220220
latency guarentee.
221221
- If set to 'default', the request will be processed using the default service
222222
tier with a lower uptime SLA and no latency guarentee.
223+
- If set to 'flex', the request will be processed with the Flex Processing
224+
service tier.
225+
[Learn more](https://platform.openai.com/docs/guides/flex-processing).
223226
- When not set, the default behavior is 'auto'.
224227
225228
When this parameter is set, the response body will include the `service_tier`
226229
utilized.
227230
"""
228231

229232
stop: Union[Optional[str], List[str], None]
230-
"""Up to 4 sequences where the API will stop generating further tokens.
233+
"""Not supported with latest reasoning models `o3` and `o4-mini`.
231234
232-
The returned text will not contain the stop sequence.
235+
Up to 4 sequences where the API will stop generating further tokens. The
236+
returned text will not contain the stop sequence.
233237
"""
234238

235239
store: Optional[bool]

Diff for: src/openai/types/completion_create_params.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ class CompletionCreateParamsBase(TypedDict, total=False):
120120
"""
121121

122122
stop: Union[Optional[str], List[str], None]
123-
"""Up to 4 sequences where the API will stop generating further tokens.
123+
"""Not supported with latest reasoning models `o3` and `o4-mini`.
124124
125-
The returned text will not contain the stop sequence.
125+
Up to 4 sequences where the API will stop generating further tokens. The
126+
returned text will not contain the stop sequence.
126127
"""
127128

128129
stream_options: Optional[ChatCompletionStreamOptionsParam]

Diff for: src/openai/types/responses/response.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Response(BaseModel):
6262
"""
6363

6464
model: ResponsesModel
65-
"""Model ID used to generate the response, like `gpt-4o` or `o1`.
65+
"""Model ID used to generate the response, like `gpt-4o` or `o3`.
6666
6767
OpenAI offers a wide range of models with different capabilities, performance
6868
characteristics, and price points. Refer to the
@@ -149,6 +149,27 @@ class Response(BaseModel):
149149
[reasoning models](https://platform.openai.com/docs/guides/reasoning).
150150
"""
151151

152+
service_tier: Optional[Literal["auto", "default", "flex"]] = None
153+
"""Specifies the latency tier to use for processing the request.
154+
155+
This parameter is relevant for customers subscribed to the scale tier service:
156+
157+
- If set to 'auto', and the Project is Scale tier enabled, the system will
158+
utilize scale tier credits until they are exhausted.
159+
- If set to 'auto', and the Project is not Scale tier enabled, the request will
160+
be processed using the default service tier with a lower uptime SLA and no
161+
latency guarentee.
162+
- If set to 'default', the request will be processed using the default service
163+
tier with a lower uptime SLA and no latency guarentee.
164+
- If set to 'flex', the request will be processed with the Flex Processing
165+
service tier.
166+
[Learn more](https://platform.openai.com/docs/guides/flex-processing).
167+
- When not set, the default behavior is 'auto'.
168+
169+
When this parameter is set, the response body will include the `service_tier`
170+
utilized.
171+
"""
172+
152173
status: Optional[ResponseStatus] = None
153174
"""The status of the response generation.
154175

Diff for: src/openai/types/responses/response_create_params.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ResponseCreateParamsBase(TypedDict, total=False):
3838
"""
3939

4040
model: Required[ResponsesModel]
41-
"""Model ID used to generate the response, like `gpt-4o` or `o1`.
41+
"""Model ID used to generate the response, like `gpt-4o` or `o3`.
4242
4343
OpenAI offers a wide range of models with different capabilities, performance
4444
characteristics, and price points. Refer to the
@@ -102,6 +102,27 @@ class ResponseCreateParamsBase(TypedDict, total=False):
102102
[reasoning models](https://platform.openai.com/docs/guides/reasoning).
103103
"""
104104

105+
service_tier: Optional[Literal["auto", "default", "flex"]]
106+
"""Specifies the latency tier to use for processing the request.
107+
108+
This parameter is relevant for customers subscribed to the scale tier service:
109+
110+
- If set to 'auto', and the Project is Scale tier enabled, the system will
111+
utilize scale tier credits until they are exhausted.
112+
- If set to 'auto', and the Project is not Scale tier enabled, the request will
113+
be processed using the default service tier with a lower uptime SLA and no
114+
latency guarentee.
115+
- If set to 'default', the request will be processed using the default service
116+
tier with a lower uptime SLA and no latency guarentee.
117+
- If set to 'flex', the request will be processed with the Flex Processing
118+
service tier.
119+
[Learn more](https://platform.openai.com/docs/guides/flex-processing).
120+
- When not set, the default behavior is 'auto'.
121+
122+
When this parameter is set, the response body will include the `service_tier`
123+
utilized.
124+
"""
125+
105126
store: Optional[bool]
106127
"""Whether to store the generated model response for later retrieval via API."""
107128

Diff for: src/openai/types/shared/chat_model.py

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"gpt-4.1-2025-04-14",
1212
"gpt-4.1-mini-2025-04-14",
1313
"gpt-4.1-nano-2025-04-14",
14+
"o4-mini",
15+
"o4-mini-2025-04-16",
16+
"o3",
17+
"o3-2025-04-16",
1418
"o3-mini",
1519
"o3-mini-2025-01-31",
1620
"o1",

Diff for: src/openai/types/shared/reasoning.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,17 @@ class Reasoning(BaseModel):
1919
result in faster responses and fewer tokens used on reasoning in a response.
2020
"""
2121

22-
generate_summary: Optional[Literal["concise", "detailed"]] = None
23-
"""**computer_use_preview only**
22+
generate_summary: Optional[Literal["auto", "concise", "detailed"]] = None
23+
"""**Deprecated:** use `summary` instead.
2424
2525
A summary of the reasoning performed by the model. This can be useful for
26-
debugging and understanding the model's reasoning process. One of `concise` or
27-
`detailed`.
26+
debugging and understanding the model's reasoning process. One of `auto`,
27+
`concise`, or `detailed`.
28+
"""
29+
30+
summary: Optional[Literal["auto", "concise", "detailed"]] = None
31+
"""A summary of the reasoning performed by the model.
32+
33+
This can be useful for debugging and understanding the model's reasoning
34+
process. One of `auto`, `concise`, or `detailed`.
2835
"""

Diff for: src/openai/types/shared_params/chat_model.py

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"gpt-4.1-2025-04-14",
1414
"gpt-4.1-mini-2025-04-14",
1515
"gpt-4.1-nano-2025-04-14",
16+
"o4-mini",
17+
"o4-mini-2025-04-16",
18+
"o3",
19+
"o3-2025-04-16",
1620
"o3-mini",
1721
"o3-mini-2025-01-31",
1822
"o1",

Diff for: src/openai/types/shared_params/reasoning.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,17 @@ class Reasoning(TypedDict, total=False):
2020
result in faster responses and fewer tokens used on reasoning in a response.
2121
"""
2222

23-
generate_summary: Optional[Literal["concise", "detailed"]]
24-
"""**computer_use_preview only**
23+
generate_summary: Optional[Literal["auto", "concise", "detailed"]]
24+
"""**Deprecated:** use `summary` instead.
2525
2626
A summary of the reasoning performed by the model. This can be useful for
27-
debugging and understanding the model's reasoning process. One of `concise` or
28-
`detailed`.
27+
debugging and understanding the model's reasoning process. One of `auto`,
28+
`concise`, or `detailed`.
29+
"""
30+
31+
summary: Optional[Literal["auto", "concise", "detailed"]]
32+
"""A summary of the reasoning performed by the model.
33+
34+
This can be useful for debugging and understanding the model's reasoning
35+
process. One of `auto`, `concise`, or `detailed`.
2936
"""

0 commit comments

Comments
 (0)