Skip to content

Commit a7d092f

Browse files
committed
API misc updates
1 parent 8ef5dcc commit a7d092f

20 files changed

Lines changed: 647 additions & 409 deletions

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
2-
### Unreleased
2+
### 4.49.0
3+
- **IMPORTANT:** The default model for `Request-ChatCompletion` & `Request-Response` is changed to `gpt-5.4-mini`.
4+
- **IMPORTANT:** The default model for Images endpoints is changed to `gpt-image-2`. It because the dall-e models are shut down by OpenAI.
5+
- API misc updates.
6+
- Add gpt-5.3, gpt-5.4, gpt-5.5, gpt-image-2
37
- Update documents.
48
- Add `chatgpt-image-latest` to `Request-ImageGeneration` and `Request-ImageEdit`.
59

Docs/Request-ChatCompletion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ PS C:\> Request-ChatCompletion -Message $Message -Model gpt-4o -Images "C:\image
122122

123123
### Example 6: Audio input / output
124124
```PowerShell
125-
PS C:\> Request-ChatCompletion -Modalities text, audio -InputAudio 'C:\hello.mp3' -AudioOutFile 'C:\response.mp3' -Model gpt-4o-audio-preview
125+
PS C:\> Request-ChatCompletion -Modalities text, audio -InputAudio 'C:\hello.mp3' -AudioOutFile 'C:\response.mp3' -Model gpt-audio-1.5
126126
```
127127

128128
## PARAMETERS

Docs/Request-ImageEdit.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Request-ImageEdit -Model 'gpt-image-2' -Image C:\sand_with_feather.png -Mask C:\
9393

9494
### -Image
9595
(Required)
96-
The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models, each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. For dall-e-2, you can only provide one image, and it should be a square png file less than 4MB.
96+
The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models, each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images.
9797

9898
```yaml
9999
Type: String[]
@@ -104,7 +104,7 @@ Position: Named
104104
105105
### -Prompt
106106
(Required)
107-
A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
107+
A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models.
108108
109109
```yaml
110110
Type: String
@@ -122,7 +122,7 @@ Position: Named
122122
```
123123
124124
### -Model
125-
The model to use for image generation. Only `dall-e-2` and the GPT image models are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
125+
The model to use for image generation. Defaults to `gpt-image-2`.
126126

127127
```yaml
128128
Type: String
@@ -145,8 +145,6 @@ Default value: 1
145145
The quality of the image that will be generated.
146146
- `auto` (default value) will automatically select the best quality for the given model.
147147
- `high`, `medium` and `low` are supported for the GPT image models.
148-
- `hd` and `standard` are supported for `dall-e-3`.
149-
- `standard` is the only option for `dall-e-2`.
150148

151149
```yaml
152150
Type: String

Docs/Request-ImageGeneration.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ Default value: auto
129129
The quality of the image that will be generated.
130130
- `auto` (default value) will automatically select the best quality for the given model.
131131
- `high`, `medium` and `low` are supported for the GPT image models.
132-
- `hd` and `standard` are supported for `dall-e-3`.
133-
- `standard` is the only option for `dall-e-2`.
134132

135133
```yaml
136134
Type: String

PSOpenAI-Help.xml

Lines changed: 470 additions & 249 deletions
Large diffs are not rendered by default.

Private/Assert-DeprecationModel.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,38 @@ class OpenAIDepricationModels {
5353
'gpt-4-0314' = [datetime]::new(2026, 03, 26)
5454
'gpt-4-1106-preview' = [datetime]::new(2026, 03, 26)
5555
'gpt-4-0125-preview' = [datetime]::new(2026, 03, 26)
56+
'gpt-4o-realtime-preview' = [datetime]::new(2026, 05, 07)
57+
'gpt-4o-mini-realtime-preview' = [datetime]::new(2026, 05, 07)
58+
'gpt-4o-audio-preview' = [datetime]::new(2026, 05, 07)
59+
'gpt-4o-mini-audio-preview' = [datetime]::new(2026, 05, 07)
5660
'dall-e-2' = [datetime]::new(2026, 05, 12)
5761
'dall-e-3' = [datetime]::new(2026, 05, 12)
62+
'computer-use-preview' = [datetime]::new(2026, 07, 23)
63+
'gpt-5-chat-latest' = [datetime]::new(2026, 07, 23)
64+
'gpt-5-codex' = [datetime]::new(2026, 07, 23)
65+
'gpt-5.1-chat-latest' = [datetime]::new(2026, 07, 23)
66+
'gpt-5.1-codex' = [datetime]::new(2026, 07, 23)
67+
'gpt-5.1-codex-max' = [datetime]::new(2026, 07, 23)
68+
'gpt-5.1-codex-mini' = [datetime]::new(2026, 07, 23)
69+
'o3-deep-research' = [datetime]::new(2026, 07, 23)
70+
'o4-mini-deep-research' = [datetime]::new(2026, 07, 23)
71+
'gpt-5.2-codex' = [datetime]::new(2026, 07, 23)
72+
'gpt-5.2-chat-latest' = [datetime]::new(2026, 08, 10)
73+
'gpt-5.3-chat-latest' = [datetime]::new(2026, 08, 10)
74+
'sora-2' = [datetime]::new(2026, 09, 24)
75+
'sora-2-pro' = [datetime]::new(2026, 09, 24)
5876
'gpt-3.5-turbo-instruct' = [datetime]::new(2026, 09, 28)
5977
'babbage-002' = [datetime]::new(2026, 09, 28)
6078
'davinci-002' = [datetime]::new(2026, 09, 28)
6179
'gpt-3.5-turbo-1106' = [datetime]::new(2026, 09, 28)
80+
'gpt-3.5-turbo' = [datetime]::new(2026, 10, 23)
81+
'gpt-4' = [datetime]::new(2026, 10, 23)
82+
'gpt-4.1-nano' = [datetime]::new(2026, 10, 23)
83+
'gpt-image-1' = [datetime]::new(2026, 10, 23)
84+
'o1' = [datetime]::new(2026, 10, 23)
85+
'o1-pro' = [datetime]::new(2026, 10, 23)
86+
'o3-mini' = [datetime]::new(2026, 10, 23)
87+
'o4-mini' = [datetime]::new(2026, 10, 23)
6288
}
6389
}
6490

Public/Chat/Request-ChatCompletion.ps1

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ function Request-ChatCompletion {
2323
'gpt-4',
2424
'gpt-4o',
2525
'gpt-4o-mini',
26-
'gpt-4o-audio-preview',
27-
'gpt-4o-mini-audio-preview',
2826
'gpt-4o-search-preview',
2927
'gpt-4o-mini-search-preview',
3028
'gpt-3.5-turbo-16k',
@@ -47,14 +45,21 @@ function Request-ChatCompletion {
4745
'gpt-5.2',
4846
'gpt-5.2-chat-latest',
4947
'gpt-5.2-pro',
48+
'gpt-5.3-chat-latest',
49+
'gpt-5.4',
50+
'gpt-5.4-mini',
51+
'gpt-5.4-nano',
52+
'gpt-5.5',
5053
'gpt-audio',
5154
'gpt-audio-mini',
55+
'gpt-audio-1.5',
5256
'o1',
5357
'o3',
5458
'o3-mini',
55-
'o4-mini'
59+
'o4-mini',
60+
'chat-latest'
5661
)]
57-
[string]$Model = 'gpt-3.5-turbo',
62+
[string]$Model = 'gpt-5.4-mini',
5863

5964
[Parameter()]
6065
[AllowEmptyString()]
@@ -225,7 +230,7 @@ function Request-ChatCompletion {
225230

226231
[Parameter()]
227232
[Alias('service_tier')]
228-
[Completions('auto', 'default', 'flex', 'scale')]
233+
[Completions('auto', 'default', 'flex', 'scale', 'priority')]
229234
[string]$ServiceTier,
230235

231236
[Parameter()]

Public/Images/Request-ImageEdit.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,21 @@ function Request-ImageEdit {
2020
'gpt-image-1.5',
2121
'gpt-image-1',
2222
'gpt-image-1-mini',
23-
'chatgpt-image-latest',
24-
'dall-e-2'
23+
'chatgpt-image-latest'
2524
)]
26-
[string]$Model = 'dall-e-2',
25+
[string]$Model = 'gpt-image-2',
2726

2827
[Parameter()]
2928
[ValidateRange(1, 10)]
3029
[Alias('n')]
3130
[uint16]$NumberOfImages = 1,
3231

3332
[Parameter()]
34-
[ValidateSet('auto', '1024x1024', '1536x1024', '1024x1536', '256x256', '512x512')]
33+
[Completions('auto', '1024x1024', '1536x1024', '1024x1536', '256x256', '512x512')]
3534
[string]$Size = 'auto',
3635

3736
[Parameter()]
38-
[ValidateSet('standard', 'low', 'medium', 'high', 'auto')]
37+
[ValidateSet('low', 'medium', 'high', 'auto')]
3938
[string][LowerCaseTransformation()]$Quality = 'auto',
4039

4140
[Parameter()]
@@ -57,6 +56,7 @@ function Request-ImageEdit {
5756
[ValidateSet('png', 'jpeg', 'webp')]
5857
[string][LowerCaseTransformation()]$OutputFormat = 'png',
5958

59+
# Obsolete
6060
[Parameter(ParameterSetName = 'Format')]
6161
[Alias('response_format')]
6262
[ValidateSet('url', 'base64', 'byte', 'object')]
@@ -200,7 +200,7 @@ function Request-ImageEdit {
200200
}
201201

202202
# GPT-Image model does not support response_format parameter
203-
if ($Model -like 'gpt-image-*') {
203+
if ($Model -like '*gpt-image-*') {
204204
if ($PSBoundParameters.ContainsKey('ResponseFormat') -and $ResponseFormat -eq 'url') {
205205
Write-Warning 'Your specified model does not support response_format=url. Defaulting to object.'
206206
$ResponseFormat = 'object'
@@ -230,7 +230,7 @@ function Request-ImageEdit {
230230
}
231231
}
232232

233-
if ($Model -like 'gpt-image-*') {
233+
if ($Model -like '*gpt-image-*') {
234234
# The output_format parameter is only supported for the GPT image models.
235235
if ($PSBoundParameters.ContainsKey('OutputFormat')) {
236236
$PostBody.output_format = $OutputFormat

Public/Images/Request-ImageGeneration.ps1

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,21 @@ function Request-ImageGeneration {
1111
'gpt-image-1.5',
1212
'gpt-image-1',
1313
'gpt-image-1-mini',
14-
'chatgpt-image-latest',
15-
'dall-e-3',
16-
'dall-e-2'
14+
'chatgpt-image-latest'
1715
)]
18-
[string]$Model = 'dall-e-2',
16+
[string]$Model = 'gpt-image-2',
1917

2018
[Parameter()]
2119
[ValidateRange(1, 10)]
2220
[Alias('n')]
2321
[uint16]$NumberOfImages = 1,
2422

2523
[Parameter()]
26-
[ValidateSet('auto', '1024x1024', '1536x1024', '1024x1536', '256x256', '512x512', '1792x1024', '1024x1792')]
24+
[Completions('auto', '1024x1024', '1536x1024', '1024x1536', '256x256', '512x512', '1792x1024', '1024x1792')]
2725
[string]$Size = 'auto',
2826

2927
[Parameter()]
30-
[ValidateSet('standard', 'hd', 'low', 'medium', 'high', 'auto')]
28+
[ValidateSet('low', 'medium', 'high', 'auto')]
3129
[string][LowerCaseTransformation()]$Quality = 'auto',
3230

3331
[Parameter()]
@@ -129,9 +127,7 @@ function Request-ImageGeneration {
129127
$PostBody.prompt = $Prompt
130128

131129
if ($OpenAIParameter.ApiType -eq [OpenAIApiType]::OpenAI) {
132-
if ($PSBoundParameters.ContainsKey('Model')) {
133-
$PostBody.model = $Model
134-
}
130+
$PostBody.model = $Model
135131
}
136132

137133
if ($PSBoundParameters.ContainsKey('NumberOfImages')) {
@@ -167,7 +163,7 @@ function Request-ImageGeneration {
167163
}
168164

169165
# GPT-Image model does not support response_format parameter
170-
if ($Model -like 'gpt-image-*') {
166+
if ($Model -like '*gpt-image-*') {
171167
if ($PSBoundParameters.ContainsKey('ResponseFormat') -and $ResponseFormat -eq 'url') {
172168
Write-Warning 'Your specified model does not support response_format=url. Defaulting to object.'
173169
$ResponseFormat = 'object'
@@ -197,7 +193,7 @@ function Request-ImageGeneration {
197193
}
198194
}
199195

200-
if ($Model -like 'gpt-image-*') {
196+
if ($Model -like '*gpt-image-*') {
201197
# The output_format parameter is only supported for the GPT image models.
202198
if ($PSBoundParameters.ContainsKey('OutputFormat')) {
203199
$PostBody.output_format = $OutputFormat

Public/Images/Request-ImageVariation.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Request-ImageVariation {
1212
[uint16]$NumberOfImages = 1,
1313

1414
[Parameter()]
15-
[ValidateSet('256', '512', '1024', '256x256', '512x512', '1024x1024')]
15+
[Completions('256', '512', '1024', '256x256', '512x512', '1024x1024')]
1616
[string]$Size = '1024x1024',
1717

1818
[Parameter(ParameterSetName = 'Format')]

0 commit comments

Comments
 (0)