One section per release, oldest first. Start below the version you have and read down to the one you are moving to. Each section lists what breaks, the compiler errors it raises and what Emendant patches.
- 5.4.0: chat completion service_tier accepts 'scale' 2 breaking, 0 deprecations
- 5.8.0: chat completion service_tier accepts priority 2 breaking, 0 deprecations
- 5.18.0: ClientOptions.apiKey accepts an async function 2 breaking, 0 deprecations
OpenAI Node SDK 5.4.0: chat completion service_tier accepts 'scale'
openai@5.4.0 adds 'scale' to the values service_tier may take on a chat completion request. The member sits on ChatCompletionCreateParamsBase, so both the streaming and non-streaming create params carry it. Requests written for 5.3.0 keep compiling. Code that reads service_tier back from a params object and handles each tier by name is what can break.
What changed
service_tierhas a fourth tier. It was'auto' | 'default' | 'flex' | nulland is now'auto' | 'default' | 'flex' | 'scale' | null. The member’s documentation describes how a request uses scale tier credits when the project is Scale tier enabled.
Before and after
The affected type is imported from this module:
import type { ChatCompletionCreateParamsNonStreaming } from 'openai/resources';The member as openai@5.3.0 declared it:
service_tier?: 'auto' | 'default' | 'flex' | null;And as 5.4.0 declares it:
service_tier?: 'auto' | 'default' | 'flex' | 'scale' | null;Migration guidance and its limits
Both findings carry an assisted fix at medium confidence. Name a model provider on the command line or in emendant.json and emendant fix tries them; without one they are reported with their guidance and nothing is sent anywhere. Review whether the changed members affect your code before applying a patch. Code that only builds requests may need no edit. Emendant checks each patch in a copy of your repository at 5.4.0 and withholds patches that fail. Read the patch header to see which checks passed.
Look for code that takes service_tier from a create params object and switches over it, maps it into a type of your own, or checks it for exhaustiveness. Add a 'scale' case there.
The scan reports the two names in a type position when they are imported from openai/resources. The same types reached through openai/resources/chat/completions, or on the OpenAI namespace, are not findings. The service_tier on the ChatCompletion response widened the same way and has no row. A clean scan says no file names these two types from that module, and nothing more about the release.
What Emendant detects, fixes and verifies
2 changes in openai 5.4.0. 0 automatic fixes, 2 fixes requiring a model provider you choose, 0 report only. Each patch states which checks passed. Understand patch evidence.
| Change | Severity | Detects | Fix | Verified by |
|---|---|---|---|---|
Changed the members of ChatCompletionCreateParamsNonStreamingopenai-npm-5.4.0-resources-chat-completion-create-params-non-streaming-members-changed | Breaking medium confidence |
| Patch, only when you name a model provider | Your typecheck and tests |
Changed the members of ChatCompletionCreateParamsStreamingopenai-npm-5.4.0-resources-chat-completion-create-params-streaming-members-changed | Breaking medium confidence |
| Patch, only when you name a model provider | Your typecheck and tests |
emendant explain <change-id> prints any row's entry, guidance and sources at the terminal.
Requires emendant@0.3.0 or later. Feed entry feed/npm/openai/5.4.0.json, snapshot 2026-09-23.4.
Primary sources
OpenAI Node SDK 5.8.0: chat completion service_tier accepts priority
openai@5.8.0 adds the 'priority' processing tier to chat completion requests, and replaces Record with mapped types across its declarations. Requests written for 5.7.0 keep compiling. Code that reads service_tier back from a ChatCompletionCreateParams object and expects one of the old four values is what breaks.
What changed
service_tieraccepts'priority'. OnChatCompletionCreateParamsNonStreamingandChatCompletionCreateParamsStreaming, the member was'auto' | 'default' | 'flex' | 'scale' | nulland is now'auto' | 'default' | 'flex' | 'scale' | 'priority' | null. Its documentation now says the tier in the response may differ from the one requested.logit_biasis a mapped type. It wasRecord<string, number> | nulland is now{ [key: string]: number } | null. The two describe the same values. The changelog lists it as the refactor “replace Record with mapped types”.
Before and after
The affected type is imported from this module:
import type { ChatCompletionCreateParamsNonStreaming } from 'openai/resources';The member as openai@5.7.0 declared it:
service_tier?: 'auto' | 'default' | 'flex' | 'scale' | null;And as 5.8.0 declares it:
service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;Migration guidance and its limits
Both findings carry an assisted fix at medium confidence. Name a model provider on the command line or in emendant.json and emendant fix tries them. Without one, they are reported with their guidance and nothing is sent anywhere. Review whether the changed members affect your code before applying a patch. Code that only builds requests may need no edit. Emendant checks each patch in a copy of your repository at 5.8.0 and withholds patches that fail. Read the patch header to see which checks passed.
Where code switches over params.service_tier exhaustively, or assigns it to a variable typed with the four old values, add 'priority'. The logit_bias change needs no edit.
The scan reports the two names in a type position when they are imported from openai/resources. The same types imported from openai/resources/chat/completions are not a finding, and neither is a service_tier read from a response object. The release’s webhook and deep research additions are not covered. A clean scan says no file names these types from openai/resources, and nothing more about the release.
What Emendant detects, fixes and verifies
2 changes in openai 5.8.0. 0 automatic fixes, 2 fixes requiring a model provider you choose, 0 report only. Each patch states which checks passed. Understand patch evidence.
| Change | Severity | Detects | Fix | Verified by |
|---|---|---|---|---|
Changed the members of ChatCompletionCreateParamsNonStreamingopenai-npm-5.8.0-resources-chat-completion-create-params-non-streaming-members-changed | Breaking medium confidence |
| Patch, only when you name a model provider | Your typecheck and tests |
Changed the members of ChatCompletionCreateParamsStreamingopenai-npm-5.8.0-resources-chat-completion-create-params-streaming-members-changed | Breaking medium confidence |
| Patch, only when you name a model provider | Your typecheck and tests |
emendant explain <change-id> prints any row's entry, guidance and sources at the terminal.
Requires emendant@0.3.0 or later. Feed entry feed/npm/openai/5.8.0.json, snapshot 2026-09-23.5.
Primary sources
OpenAI Node SDK 5.18.0: ClientOptions.apiKey accepts an async function
openai@5.18.0 adds support for API key provider functions, so a client can fetch or rotate its key at runtime. ClientOptions.apiKey widens from string | undefined to include ApiKeySetter, which is () => Promise<string>. Passing a string still works. Code that reads apiKey out of a ClientOptions value and treats it as a string is what breaks.
What changed
apiKeymay be anApiKeySetter. The option is nowapiKey?: string | ApiKeySetter | undefined. The client’s ownapiKeyproperty is still declaredstring.- One type, two import routes.
ClientOptionsis exported fromopenaiand fromopenai/client, and the feed carries an entry for each, so the table shows the change twice.
Before and after
The affected type is imported from this module:
import type { ClientOptions } from 'openai';The option as openai@5.17.0 declared it:
apiKey?: string | undefined;And as 5.18.0 declares it:
export type ApiKeySetter = () => Promise<string>;
apiKey?: string | ApiKeySetter | undefined;Migration guidance and its limits
Both findings carry an assisted fix at medium confidence. Name a model provider on the command line or in emendant.json and emendant fix tries them; without one they are reported with their guidance and nothing is sent anywhere. Review whether the changed members affect your code before applying a patch. Code that only builds options and passes them to the constructor may need no edit. Emendant checks each patch in a copy of your repository at 5.18.0 and withholds patches that fail. Read the patch header to see which checks passed.
Where your code reads options.apiKey, for logging, for a second client or for a header of its own, narrow it first: typeof options.apiKey === 'function' means the key is only available by awaiting the call. A wrapper type of your own that requires a string key now rejects the function form.
The scan reports the name in a type position when it is imported from either module. Options written inline in new OpenAI({ ... }) are not findings. The realtime websocket helper changes in the same release are not covered. A clean scan says no file names ClientOptions from these two modules, and nothing more about the release.
What Emendant detects, fixes and verifies
2 changes in openai 5.18.0. 0 automatic fixes, 2 fixes requiring a model provider you choose, 0 report only. Each patch states which checks passed. Understand patch evidence.
| Change | Severity | Detects | Fix | Verified by |
|---|---|---|---|---|
Changed the members of ClientOptionsopenai-npm-5.18.0-client-options-members-changed | Breaking medium confidence |
| Patch, only when you name a model provider | Your typecheck and tests |
Changed the members of ClientOptionsopenai-npm-5.18.0-client-client-options-members-changed | Breaking medium confidence |
| Patch, only when you name a model provider | Your typecheck and tests |
emendant explain <change-id> prints any row's entry, guidance and sources at the terminal.
Requires emendant@0.3.0 or later. Feed entry feed/npm/openai/5.18.0.json, snapshot 2026-09-23.4.
Primary sources
Scan your repository
Find affected code without editing your files.
npx emendant scanThen npx emendant fix writes the patches the tables say exist. Run emendant feed update first to get the latest coverage. The getting started guide covers the flags and the patch grades.
Related release pages
- OpenAI Node SDK 7.x breaking changes: 7.2.0 to 7.12.1
- OpenAI Node SDK 6.x breaking changes: 6.3.0 to 6.49.0
- OpenAI Node SDK 5.0.0: what breaks when you upgrade openai from 4.x
The OpenAI Node SDK migration guide lists every release page and says which to read for your upgrade.