@ai-sdk/zai 3.0.44 Adds Async Credential Callbacks and Async getServerWebSocketConfig
The latest patch for Vercel's @ai-sdk/zai library introduces asynchronous and promise-based provider credential resolution and updates the experimental OpenAI Live API configuration to support asynchronous operations.
What changed?
The @ai-sdk/zai 3.0.44 release adds support for promises and both synchronous and asynchronous callbacks when setting provider API keys and tokens. Now, credentials are resolved for each authenticated request, while maintaining existing authentication patterns and synchronous credential serialization. Additionally, the experimental OpenAI Live getServerWebSocketConfig() can now resolve asynchronously, and should be awaited before using the returned settings.
Why does it matter to an everyday developer?
This update makes it easier to integrate dynamic or externally fetched credentials in authentication workflows. Developers can now implement logic that retrieves API keys or tokens from secure stores or remote sources asynchronously, instead of only supplying static values or synchronous callbacks. The asynchronous resolution of getServerWebSocketConfig() allows for integrating dynamic server configuration, such as fetching or computing WebSocket parameters at runtime.
What can the developer do now?
Developers using @ai-sdk/zai can provide async functions or promises for credentials, supporting more secure and flexible authentication strategies. For projects utilizing the experimental OpenAI Live API, developers should await the getServerWebSocketConfig() result when establishing WebSocket connections, allowing integration with asynchronous config loading. No breaking changes were introduced, so existing synchronous patterns continue to work.

