AI SDK xAI 5.0.34 Update: Asynchronous Credential Resolution and WebSocket Configuration Changes

@ai-sdk/xai 5.0.34 supports request-level async resolution of API keys and tokens, and makes the experimental WebSocket config method async.
@ai-sdk/xai has released version 5.0.34. The core change allows the provider's API key and token settings to support Promises and synchronous/asynchronous callbacks, with credentials resolved on each authenticated request while preserving existing authentication behavior and synchronous credential serialization — a backward-compatible patch. This capability has direct value for multi-tenant, key rotation, and remote secrets service scenarios, but also requires developers to handle caching and failures themselves to avoid extra latency on the request path. The same batch of changes also makes the experimental OpenAI Live getServerWebSocketConfig() asynchronously resolvable, requiring await before use; dependencies @ai-sdk/provider-utils and @ai-sdk/provider are updated in sync.
AI SDK ecosystem releases rarely attract the same attention as major model launches, but for developers actually putting AI capabilities into production systems, a single patch update to an underlying provider package can directly determine whether the authentication pipeline holds up. @ai-sdk/xai has released version 5.0.34, with changes focused on one area: allowing the provider's API key and token settings to support Promises as well as synchronous/asynchronous callbacks.

What Changed
According to the release notes, the core change in 5.0.34 is support for Promises and synchronous or asynchronous callbacks in provider API key and token settings. The official description of this behavior is: credentials are resolved on each authenticated request, while preserving existing authentication behavior and synchronous credential serialization.
In other words, credentials no longer have to be a static string fixed at initialization time — they can be computed dynamically every time a request occurs. This has direct value for multi-tenant applications, key rotation, and scenarios where tokens are fetched from a remote secrets management service.
Why Credential Resolution Needs to Be Asynchronous
The limitations of synchronous configuration are clear: read an environment variable once at application startup, then reuse the same key for the entire process lifetime. When keys need to be differentiated per tenant, rotated on a short cycle, or issued by an external secrets service, the synchronous model forces developers to wrap their own caching and refresh logic on the outside.
The new version moves the resolution timing to each authenticated request, effectively handing that layer of flexibility back to the caller. The release notes also emphasize "preserving existing authentication behavior," meaning existing code that only uses static strings requires no changes — the upgrade is a backward-compatible patch.
However, asynchronous resolution also brings new responsibilities: credential resolution happens on the request path, so if the callback internally makes a time-consuming network call without caching, it will add extra latency to every request. Whether to cache the resolved result, and for how long, is a trade-off developers must make themselves.
In multi-tenant or key rotation scenarios, a common approach is to introduce a credential cache layer: on the first call, the resolution callback reads the key from environment variables or an external secrets service and stores the result along with an expiration time in-process; subsequent requests that hit a non-expired cache return the cached value directly, avoiding repeated network round trips. There are typically two cache invalidation strategies: passive expiration based on TTL, and active invalidation based on key version numbers. For failure handling, it's recommended to distinguish within the callback between "transient errors" (e.g., secrets service timeout — brief retry or fallback to the last valid value) and "permanent errors" (e.g., tenant disabled — should be thrown upward directly), to avoid amplifying momentary fluctuations in external dependencies into total request failures. Additionally, if the Promise returned by the async callback is shared by multiple concurrent requests, pay attention to deduplication (single-flight) to prevent cache stampede.
Asynchronous Experimental Live Interface
The same batch of changes also includes: the experimental OpenAI Live getServerWebSocketConfig() method can now resolve asynchronously, and its result must be awaited before using connection settings.
This is an easily overlooked change with a clear impact — if callers still use the return value synchronously, they will get a Promise instead of a configuration object, leading to incorrect WebSocket connection parameters. Any code that relies on this experimental interface should be checked after upgrading to see whether await needs to be added.
Since this interface is marked experimental, its signature change is not surprising, but it also reminds developers: experimental APIs should not be treated as stable contracts to depend on.
The configuration object returned by getServerWebSocketConfig() typically contains the URL, authentication headers, or subprotocol parameters needed for a WebSocket connection. After becoming asynchronous, the method returns Promise<Config>, and callers must await the resolved result before establishing a connection, then pass it to the WebSocket constructor or connection factory. If still used synchronously, a Promise instance rather than a configuration object will be passed — a typical symptom is the connection URL being undefined or authentication headers missing, causing handshake failure. When troubleshooting, check at the call site whether the return value is a Promise (e.g., via instanceof Promise or TypeScript type hints), and confirm that the await is inside a try/catch or a .catch() chain so that configuration resolution failures gracefully close the connection rather than silently hanging.
Cascading Dependency Updates
The release record shows that dependencies were also updated: @ai-sdk/provider-utils to 5.0.72, and @ai-sdk/provider to 4.0.35.
Version changes in provider packages usually mean fine-tuning of underlying interface conventions, while provider-utils carries various common utilities and parsing logic. For applications using @ai-sdk/xai directly, these dependencies are generally pulled automatically by the package manager; but if the project has dependency locks or mixes multiple AI SDK sub-packages, it's worth confirming that the actually resolved provider versions are consistent, to avoid misalignment between type definitions and runtime behavior.
Upgrade Recommendations
Projects using static API keys can upgrade directly — behavior remains unchanged.
Projects that need to provide credentials dynamically at the request level can gradually migrate their existing outer refresh logic into configuration callbacks, but should add reasonable caching and failure handling to the resolution callback to avoid amplifying fluctuations in the credential service into request failure rates.
Projects that depend on OpenAI Live getServerWebSocketConfig() must check each call site after upgrading to ensure the async result is awaited before consuming the connection configuration.
Overall, this is a narrowly scoped patch update, but it formally brings "credentials changing from static constants to request-level dynamic values" into officially supported territory. For teams building multi-tenant AI applications, it's a capability change worth following.
Related articles

Mistral Large 4 Open-Sources a Trillion Parameters, Microsoft Offers Voluntary Severance to 60,000 Employees
Mistral Large 4 open-sources a trillion-parameter multimodal model with a coding agent score of 48; SanDisk earnings show AI inference reshaping NAND demand; Google Gemini adds in-app file editing, OpenAI raises Codex quotas, and Microsoft offers voluntary severance to 60,000 employees.

Mistral Large 4 Opens Its Weights: AI Morning Brief Roundup of Models and Ecosystem Trends
Mistral Large 4 opens its weights, a 1-trillion-parameter MoE architecture that can run locally on MacStudio; Meta's test-generation technology enters production; top tax benchmark pass rate only 10.8%; Canadian government takes a stake in Cohere; Doubao Work opens third-party model calls. This AI Morning Brief rounds up model, ecosystem, capital, and policy developments.

Mistral Large 4 Goes Open Source: A 1T-Parameter European Qwen Challenging DeepSeek
Mistral Large 4 is now open source: 1T total parameters, 52B activated, focused on coding and cybersecurity, with ~610G NVFP4 weights. We analyze its comparison with DeepSeek V4 Flash, API pricing, demo realism, and local deployment value.