@ai-sdk/openai migration guide
Review @ai-sdk/openai v4 model annotations, Responses cache options and later client settings changes, with release guides and scan limits.
Use these guides when upgrading the AI SDK OpenAI adapter. This package is separate from the openai Node SDK. Start with the v4 provider type migration if your own annotations still name v3 interfaces, then review the later 4.x option changes your upgrade crosses.
Choose your migration path
- Align model annotations with provider v4: Models returned by this adapter use the v4 provider interfaces. Confirm that the annotated value comes from this adapter before changing a v3 annotation. Your own v3 implementation may still need its original type.
- Review Responses prompt cache options: promptCacheOptions changes type on the two covered Responses option types. Check code that sets or reads it; merely naming an options type may require no edit.
- Review later provider and realtime settings: The covered settings change apiKey and headers types. Read the release page for the exact interfaces and the code that needs review.
Check your upgrade
Check your installed version in the manifest and lockfile, then read the release pages your upgrade crosses. Run npx emendant scan to find supported changes in TypeScript and JavaScript source without editing your files. Use npx emendant fix --dry-run to preview deterministic patches where available. The preview does not install dependencies, run your checks or call a model. Assisted patches need a named model provider and a fix run without --dry-run. After updating dependencies, run your typecheck and tests and review the patch grades in the fix guide.
Coverage and limits
The listed fixes are assisted and need a named model provider. Detection does not prove that an annotation refers to an adapter-produced model, and options supplied without naming the covered types can be missed. Check the actual value and the changed member before applying a possible patch.
The linked release pages list covered findings, possible fixes and tagged sources. A clean scan does not prove that every migration step is complete. Read the supported projects guide for the scan's scope.
@ai-sdk/openai release pages
- @ai-sdk/openai 4.x breaking changes: 4.0.99 to 4.0.109
3 releases, 4.0.99 to 4.0.109, released 21 October 2026 to 5 November 2026. 6 breaking, 0 deprecations. - @ai-sdk/openai 4.0.0: every model is a v4 provider type now
@ai-sdk/openai 4.0.0, released 25 June 2026. 1 breaking, 0 deprecations.
Releases without a page here may still be in the feed. Run emendant feed status to see what your snapshot holds.