Skip to content

release: 4.97.0 #1489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.96.2"
".": "4.97.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-8b68ae6b807dca92e914da1dd9e835a20f69b075e79102a264367fd7fddddb33.yml
openapi_spec_hash: b6ade5b1a6327339e6669e1134de2d03
config_hash: b597cd9a31e9e5ec709e2eefb4c54122
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-0ee6b36cf3cc278cef4199a6aec5f7d530a6c1f17a74830037e96d50ca1edc50.yml
openapi_spec_hash: e8ec5f46bc0655b34f292422d58a60f6
config_hash: d9b6b6e6bc85744663e300eebc482067
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 4.97.0 (2025-05-02)

Full Changelog: [v4.96.2...v4.97.0](https://github.com/openai/openai-node/compare/v4.96.2...v4.97.0)

### Features

* **api:** add image sizes, reasoning encryption ([9c2113a](https://github.com/openai/openai-node/commit/9c2113af7c7ea9a797a0e39d07d9ad8627c96acb))


### Chores

* **docs:** add missing deprecation warnings ([253392c](https://github.com/openai/openai-node/commit/253392c93adca88e0ee83f784183b2128ff64a16))


### Documentation

* fix "procesing" -> "processing" in realtime examples ([#1406](https://github.com/openai/openai-node/issues/1406)) ([8717b9f](https://github.com/openai/openai-node/commit/8717b9fce87d03e51d40ee58f5d6259408405e1f))
* **readme:** fix typo ([cab3478](https://github.com/openai/openai-node/commit/cab3478f195f9de5c21033a1b3684f52ad347ffc))

## 4.96.2 (2025-04-29)

Full Changelog: [v4.96.1...v4.96.2](https://github.com/openai/openai-node/compare/v4.96.1...v4.96.2)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ async function main() {
main();
```

Error codes are as followed:
Error codes are as follows:

| Status Code | Error Type |
| ----------- | -------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions examples/azure/realtime/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

rt.on('error', (err) => {
// in a real world scenario this should be logged somewhere as you
// likely want to continue procesing events regardless of any errors
// likely want to continue processing events regardless of any errors
throw err;
});

Expand All @@ -57,4 +57,4 @@
rt.socket.addEventListener('close', () => console.log('\nConnection closed!'));
}

main();
main();

Check failure on line 60 in examples/azure/realtime/websocket.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎`
4 changes: 2 additions & 2 deletions examples/azure/realtime/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

rt.on('error', (err) => {
// in a real world scenario this should be logged somewhere as you
// likely want to continue procesing events regardless of any errors
// likely want to continue processing events regardless of any errors
throw err;
});

Expand All @@ -57,4 +57,4 @@
rt.socket.on('close', () => console.log('\nConnection closed!'));
}

main();
main();

Check failure on line 60 in examples/azure/realtime/ws.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎`
4 changes: 2 additions & 2 deletions examples/realtime/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

rt.on('error', (err) => {
// in a real world scenario this should be logged somewhere as you
// likely want to continue procesing events regardless of any errors
// likely want to continue processing events regardless of any errors
throw err;
});

Expand All @@ -45,4 +45,4 @@
rt.socket.addEventListener('close', () => console.log('\nConnection closed!'));
}

main();
main();

Check failure on line 48 in examples/realtime/websocket.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎`
4 changes: 2 additions & 2 deletions examples/realtime/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

rt.on('error', (err) => {
// in a real world scenario this should be logged somewhere as you
// likely want to continue procesing events regardless of any errors
// likely want to continue processing events regardless of any errors
throw err;
});

Expand All @@ -45,4 +45,4 @@
rt.socket.on('close', () => console.log('\nConnection closed!'));
}

main();
main();

Check failure on line 48 in examples/realtime/ws.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎`
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",
"version": "4.96.2",
"version": "4.97.0",
"exports": {
".": "./index.ts",
"./helpers/zod": "./helpers/zod.ts",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openai",
"version": "4.96.2",
"version": "4.97.0",
"description": "The official TypeScript library for the OpenAI API",
"author": "OpenAI <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
7 changes: 3 additions & 4 deletions realtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ rt.socket.on('open', () => {

rt.on('error', (err) => {
// in a real world scenario this should be logged somewhere as you
// likely want to continue procesing events regardless of any errors
// likely want to continue processing events regardless of any errors
throw err;
});

Expand Down Expand Up @@ -80,8 +80,7 @@ It is **highly recommended** that you register an `error` event listener and han
const rt = new OpenAIRealtimeWS({ model: 'gpt-4o-realtime-preview-2024-12-17' });
rt.on('error', (err) => {
// in a real world scenario this should be logged somewhere as you
// likely want to continue procesing events regardless of any errors
// likely want to continue processing events regardless of any errors
throw err;
});
```

```
2 changes: 1 addition & 1 deletion src/resources/audio/speech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export interface SpeechCreateParams {

/**
* The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is
* the default.
* the default. Does not work with `gpt-4o-mini-tts`.
*/
speed?: number;
}
Expand Down
8 changes: 4 additions & 4 deletions src/resources/chat/completions/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ export interface ChatCompletionCreateParamsBase {
frequency_penalty?: number | null;

/**
* Deprecated in favor of `tool_choice`.
* @deprecated Deprecated in favor of `tool_choice`.
*
* Controls which (if any) function is called by the model.
*
Expand All @@ -1187,7 +1187,7 @@ export interface ChatCompletionCreateParamsBase {
function_call?: 'none' | 'auto' | ChatCompletionFunctionCallOption;

/**
* Deprecated in favor of `tools`.
* @deprecated Deprecated in favor of `tools`.
*
* A list of functions the model may generate JSON inputs for.
*/
Expand Down Expand Up @@ -1220,8 +1220,8 @@ export interface ChatCompletionCreateParamsBase {
max_completion_tokens?: number | null;

/**
* The maximum number of [tokens](/tokenizer) that can be generated in the chat
* completion. This value can be used to control
* @deprecated The maximum number of [tokens](/tokenizer) that can be generated in
* the chat completion. This value can be used to control
* [costs](https://openai.com/api/pricing/) for text generated via API.
*
* This value is now deprecated in favor of `max_completion_tokens`, and is not
Expand Down
5 changes: 3 additions & 2 deletions src/resources/fine-tuning/jobs/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,9 @@ export interface JobCreateParams {
training_file: string;

/**
* The hyperparameters used for the fine-tuning job. This value is now deprecated
* in favor of `method`, and should be passed in under the `method` parameter.
* @deprecated The hyperparameters used for the fine-tuning job. This value is now
* deprecated in favor of `method`, and should be passed in under the `method`
* parameter.
*/
hyperparameters?: JobCreateParams.Hyperparameters;

Expand Down
24 changes: 19 additions & 5 deletions src/resources/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,13 @@ export interface ImageCreateVariationParams {

export interface ImageEditParams {
/**
* The image(s) to edit. Must be a supported image file or an array of images. For
* `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than
* 25MB. For `dall-e-2`, you can only provide one image, and it should be a square
* `png` file less than 4MB.
* The image(s) to edit. Must be a supported image file or an array of images.
*
* For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than
* 25MB. 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.
*/
image: Core.Uploadable | Array<Core.Uploadable>;

Expand All @@ -175,6 +178,17 @@ export interface ImageEditParams {
*/
prompt: string;

/**
* Allows to set transparency for the background of the generated image(s). This
* parameter is only supported for `gpt-image-1`. Must be one of `transparent`,
* `opaque` or `auto` (default value). When `auto` is used, the model will
* automatically determine the best background for the image.
*
* If `transparent`, the output format needs to support transparency, so it should
* be set to either `png` (default value) or `webp`.
*/
background?: 'transparent' | 'opaque' | 'auto' | null;

/**
* An additional image whose fully transparent areas (e.g. where alpha is zero)
* indicate where `image` should be edited. If there are multiple images provided,
Expand Down Expand Up @@ -215,7 +229,7 @@ export interface ImageEditParams {
* (landscape), `1024x1536` (portrait), or `auto` (default value) for
* `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`.
*/
size?: '256x256' | '512x512' | '1024x1024' | null;
size?: '256x256' | '512x512' | '1024x1024' | '1536x1024' | '1024x1536' | 'auto' | null;

/**
* A unique identifier representing your end-user, which can help OpenAI to monitor
Expand Down
Loading
Loading