AI Agent News/stories/ai-sdk-xai-5-0-34-lets-api-keys-and-tokens-be-resolved-per-request.md

Infrastructure

@ai-sdk/xai 5.0.34 lets API keys and tokens be resolved per request

Vercel has released @ai-sdk/xai 5.0.34, a patch that changes how provider API key and token settings are resolved. The experimental getServerWebSocketConfig() method can now resolve asynchronously, so callers must await it.

Source: github.com/vercel/ai/releases/tag/%40ai-sdk%2Fxai%405.0.34

Version 5.0.34 of @ai-sdk/xai, the xAI provider package for the AI SDK, lets provider API key and token settings be given as promises or as synchronous or asynchronous callbacks. Credentials are resolved for each authenticated request, and existing authentication behavior is kept.

The release also changes the experimental OpenAI Live getServerWebSocketConfig() method, which can now resolve asynchronously. Code that uses its output should await the result before using the connection settings.

The update also moves the dependencies @ai-sdk/provider-utils to 5.0.72 and @ai-sdk/provider to 4.0.35.

Why it matters if you build agents

If your agent reads xAI keys or tokens from a secret store or a refresh flow, you can now pass a callback or promise instead of a fixed string.

Any code that calls getServerWebSocketConfig() without awaiting it will receive a promise rather than the connection settings, so it needs an await before use.

Get stories like this every weekday

One short email with the day's agent tooling news.

Subscribe