Choose your OpenAI Node SDK migration path

The openai package is the OpenAI library for TypeScript and JavaScript. Start with the release you are moving to. The 5.0 guide covers the major upgrade, which changes calls and imports. Each later page covers a smaller change to request or client option types.

  • Migrate openai 4.x to 5.0: beta.chat moves to chat, fileFromPath, the shims and runFunctions are removed, and openai/src no longer resolves. Read it with the OpenAI v5 migration guide.
  • Later 5.x, 6.x and 7.x releases: each page covers a change to the declared type of a request field or client option. Most add an accepted value. Some rename or deprecate one, such as prompt_cache_retention in 6.35.0 and Videos in 7.5.0. Read the page for each release between your current version and your target. The list is below.

Check your repository before you upgrade

  1. Check the installed openai version in your manifest and lockfile. Read each guide between that version and your target.
  2. Run npx emendant scan in your TypeScript or JavaScript repository. It reports supported changes at affected call sites without editing your files.
  3. Review the findings, then run npx emendant fix --dry-run to inspect eligible patches. Emendant does not update package versions for you.
  4. After you update dependencies, run your own typecheck and tests.

What Emendant fixes, and the gaps

  • In 5.0, transforms patch the beta.chat rename, the move to openai/core paths and the openai/src imports. The other 5.0 changes need a model provider you name, or are report only.
  • The type changes in later releases are patched only when you name a model provider. The Videos deprecation in 7.5.0 is report only.
  • The feed has no entry for openai 6.0.0 or 7.0.0. A scan does not report what those major releases changed. Read the 6.0.0 and 7.0.0 release notes before you upgrade past them.

Emendant reports only changes in its curated feed. A clean scan does not prove that every OpenAI SDK migration step is complete. Read the supported projects guide for the current scope and the fix guide for patch grades.

OpenAI Node SDK release pages

Releases without a page here may still be in the feed. Run emendant feed status to see what your snapshot holds.