Vercel AI SDK xAI 5.0.39 Update: Realtime Voice and Video Upload Land

@ai-sdk/xai 5.0.39 adds xAI realtime voice, transcription timestamps, and video upload
@ai-sdk/xai released patch version 5.0.39, and although only the last digit changed, the update spans three areas. For realtime voice, XaiRealtimeModel implements getServerWebSocketConfig(), consolidating the WebSocket address, model parameter, and credential-derived auth headers into the provider layer while rejecting unsupported endpoint intents; event mapping populates normalized usage on response-done and input-transcription-completed using OpenAI-compatible wire format. For transcription, word-level timestamps are exposed separately and accept the shared timestampGranularities, with explicit provider config taking priority; on the OpenAI side the parameter is sent only under verbose_json with warnings when unavailable. Video generation, editing, and extension support typed output.uploadUrl, polling returns an uploaded result without exposing signed addresses, and the new option requires HTTPS and rejects null. Dependencies @ai-sdk/provider and @ai-sdk/provider-utils are synced.
In Vercel's AI SDK ecosystem, the provider package for xAI, @ai-sdk/xai, has released patch version 5.0.39. The version number only bumped the last digit, but the patch touches three areas—realtime voice, transcription timestamps, and video generation output—making it a low-level capability fill-in that developers integrating Grok-family capabilities via the AI SDK should pay attention to.

Realtime Voice: From Model Wrapper to Server-Side WebSocket
The most structurally significant item in this update is that XaiRealtimeModel now implements getServerWebSocketConfig(). This method returns the WebSocket URL of the upstream voice realtime service, with the model query parameter included in the URL, along with request header authentication info derived from the model's configured credentials.
The significance of this change is that it consolidates realtime voice connection configuration into the provider layer. Previously, developers often had to assemble the WebSocket address themselves and inject auth headers manually—any change in the upstream address or parameter shape meant modifying business code. Now these details are carried uniformly by the model object, and the caller receives a directly usable connection configuration. For unsupported endpoint intents, the implementation rejects outright rather than sending a request destined to fail; this kind of upfront validation reduces the cost of production troubleshooting.
The event mapping layer has also been adjusted accordingly. The event mapper now populates a normalized usage field on response-done and input-transcription-completed events, using a wire format consistent with xAI's OpenAI-compatible realtime structure. This means usage statistics can flow through the same processing pipeline as other OpenAI-compatible providers, without needing a separate parsing path for xAI.
The realtime model abstraction in the AI SDK is designed to separate "streaming bidirectional voice sessions" from ordinary one-shot request-response models. Traditional completion models involve a single request corresponding to a single response, whereas a realtime session requires maintaining a long-lived connection between client and server, continuously pushing audio frames and events in both directions (such as the user starting to speak, the model starting to respond, the response ending, etc.). WebSocket is the standard protocol for carrying such long-lived connections. The convention of implementing getServerWebSocketConfig() at the provider layer moves the responsibility of "where to connect and with what credentials" from business code up to the model object, keeping realtime integration across different providers in a consistent call shape within the SDK. This aligns with the long-standing design philosophy of the provider abstraction layer in the AI SDK: model objects handle protocol details, and callers only face a unified interface.
The "normalized usage field" mentioned in the article refers to mapping usage information returned by various providers (token counts, audio duration, etc.) into the AI SDK's internal unified structure. xAI's realtime interface uses an OpenAI-compatible wire format, so the SDK can directly reuse the existing parsing path without implementing a separate one for xAI. This "OpenAI compatibility layer" is fairly common in the realtime voice space; many voice APIs deliberately align event naming and field structures with OpenAI to lower ecosystem migration costs. For developers, normalized usage can flow directly into billing and observability pipelines without branching by provider.
Transcription Timestamps and Video Upload: Usability Improvements in the Details
On the transcription side, this change exposes optional word-level timestamps separately from segments and accepts the shared timestampGranularities parameter. Explicitly set provider timing configurations take higher priority. On the OpenAI side, timestamp_granularities is now sent only in verbose_json mode, with a warning issued when the requested time granularity is unavailable or excluded, rather than failing silently.
On the video side, typed output.uploadUrl delivery is now supported, covering video generation, editing, and extension operations. Polling returns an explicit uploaded result—neither downloading the file nor exposing the signed target address—and this policy is maintained in request errors as well. The new option uses camelCase output.uploadUrl, replacing the previously passed-through output.upload_url, and rejects null values and requires an HTTPS URL.
From an engineering perspective, both changes are about "reducing surprises": timestamp availability gives explicit hints, the upload target address is not leaked to the caller, and parameter naming moves from pass-through to controlled.
timestampGranularities is a parameter in the transcription interface that controls timestamp precision; common values include segment (by sentence segment) and word (by word). Output volume and use cases differ greatly by granularity: segment-level timestamps suit subtitle segmentation and content indexing, while word-level timestamps are used for precise alignment, karaoke-style highlighting, or word-by-word search. Historically, such parameters have varied across OpenAI-compatible implementations—some endpoints only accept the parameter in verbose_json response mode, and unsupported granularities may be silently ignored. This change raises the priority of explicitly configured providers and issues warnings when granularities are unavailable or excluded, essentially turning "whether the parameter takes effect" from implicit behavior into observable behavior, making it easier to troubleshoot issues like subtitle misalignment.
Dependency Sync and Upgrade Recommendations
This version also updates several dependencies, including confirmed updates to @ai-sdk/provider@4.0.36 and @ai-sdk/provider-utils@5.0.75. Such linked updates usually indicate minor evolution in the provider abstraction layer, and when upgrading you should check locations in your project that directly reference these two packages.
If your project already uses the AI SDK to integrate xAI's realtime voice or video generation capabilities, this patch version is worth following up on; if you only use plain text completion, the practical impact of upgrading is relatively limited, but aligning dependency versions is still recommended.

@ai-sdk/provider is the core package in the AI SDK that defines the model interface contract, while @ai-sdk/provider-utils provides auxiliary tools shared by providers (such as request construction, stream parsing, and schema validation). Specific provider packages (like @ai-sdk/xai) depend on these two to ensure behavior consistency with other providers. When their minor version numbers change, it usually means the interface contract or utility behavior has been tweaked, which may affect custom provider implementations that directly reference these packages. Therefore, when upgrading provider packages, it is recommended to verify the resolved versions of these two packages in the lockfile to avoid multiple incompatible copies coexisting within the same project.
One-line Summary
@ai-sdk/xai 5.0.39 fills in xAI realtime voice, transcription timestamps, and video upload capabilities
Related articles

WorkBuddy in Practice: How Tencent's AI Agent Is Reshaping Office Workflows
An in-depth analysis of Tencent WorkBuddy AI agent: it reads local files, executes multi-step tasks, runs on schedules, and supports remote control—how is it fundamentally different from conversational AI? This article combines practical cases to help you understand its core capabilities and use cases.

Codex App Complete Guide: From Installation to Hands-On Practice — AI Automatically Organizes Files and Builds Reports
Codex App complete guide: install from the app store, configure everyday work mode, and use real coffee shop data to practice file organization, Excel reports, and visual dashboards. Learn Plan Mode and the little pet feature — master Codex's AI automation workflow in one episode.

Getting Started with Langfuse: Building a Financial Analysis Agent and Evaluation Platform
A Langfuse tutorial: explore the core capabilities and boundaries of this open-source AI Engineer platform, and learn how to build an enterprise-grade log tracing, evaluation, and observability platform for a Harness-architecture financial analysis multi-agent system, covering prompt management, token cost analysis, and integration with frameworks like LangChain.