UPDATEvercel-ai-sdk ai@7.0.185
Vercel AI SDK 7.0.185 adds a binary WebSocket frame callback
ai@7.0.185 is a patch release whose notes list only dependency updates. The change itself sits in provider-utils 5.0.86: an optional callback hands binary frames to a provider as bytes instead of decoding them as text first.
What changed in this release
18 checkpoints in 4 groups, organized by task from the official notes. Checkpoints do not count separate features or commits.
Binary frames
- onMessageBinary is a new optional callback that hands a provider one Uint8Array per binary frame.
- With the callback passed, non-string frames skip onMessageText and are no longer decoded as text first.
- The connection sets binaryType to arraybuffer, so Blob frames are read as bytes on browser and Node runtimes.
- Text and binary frames share one promise queue, so async decoding cannot reorder arrival.
- Leave the callback out and behaviour matches 5.0.85, with every frame going to onMessageText.
Package pins
- ai@7.0.185 pins @ai-sdk/provider-utils to 5.0.86.
- The same release pins @ai-sdk/gateway to 4.0.158.
- Both packages come from changeset 743e15b, so one main package install brings both.
- gateway 4.0.158 only re-pins provider-utils; the model settings files changed in 4.0.157.
Upgrade steps
- npm install ai@7.0.185 is enough; neither internal package is installed by hand.
- A custom provider that needs bytes adds onMessageBinary where it calls connectToWebSocket.
- Apps on official providers change nothing, because the callback is optional.
- A provider that already decodes binary frames itself can move that work into the new callback and drop one text decode.
Version line
- The previous release, ai@7.0.184, carried two dependency updates and moved gateway to 4.0.157.
- The next release, ai@7.0.186, moves gateway to 4.0.159 with a model settings file update.
- provider-utils 5.0.85 raised the Responses stream event size limit; 5.0.86 adds only the WebSocket callback.
- On the 6.x line, ai@6.0.340 shipped the same day and moved only gateway 3.0.245.
- On the 5.x line, ai@5.0.295 shipped the same day and moved only gateway 2.0.186.
On this page
ContextThis release only moves two internal packages, and the change lands in the WebSocket layer
ai@7.0.185 ships no new interface of its own. It moves @ai-sdk/provider-utils to 5.0.86 and @ai-sdk/gateway to 4.0.158, both on dependency lines; the main package only pins them.
Realtime voice used to stall here. connectToWebSocket had one onMessageText callback, and any non-string frame was decoded with TextDecoder first, so the original bytes were gone by the time a provider saw them.
5.0.86 adds one optional callback. Pass onMessageBinary and non-string frames go there as a Uint8Array; binaryType becomes arraybuffer and both frame kinds share one queue, so async Blob reads cannot reorder them.
The change breaks into 4 groups: binary frames, package pins, upgrade steps and the version line. See the chart below: the groups hold 5, 4, 4 and 5 items; the sections after it take each in turn.
Binary frames get their own callback, so audio bytes stop arriving as decoded text
- New callback: onMessageBinary fires once per frame and receives a Uint8Array.
- Routing: once it is passed, non-string frames no longer reach onMessageText.
- Ordering: text and binary frames share one promise queue, so async Blob reads cannot reorder them.
Both internal packages move from one changeset, and the gateway only follows the pin
- Main package: ai@7.0.185 pins provider-utils 5.0.86 and gateway 4.0.158.
- One changeset: both packages come from 743e15b, so a single install brings both.
- Gateway scope: 4.0.158 only re-pins provider-utils; the model settings file update was 4.0.157.
The upgrade touches only the main package, and a custom provider needs one callback
- Upgrade: npm install ai@7.0.185; you do not install either internal package yourself.
- To get bytes: pass onMessageBinary where you call connectToWebSocket; other options stay as they are.
- No change needed: apps on official providers leave the callback out and frames still go to onMessageText.
Three version lines shipped the same day and each moved its own gateway package
- Previous: ai@7.0.184 carried two dependency updates and moved gateway to 4.0.157.
- Next: ai@7.0.186 moves gateway to 4.0.159 with a model settings file update.
- Other lines: ai@6.0.340 and ai@5.0.295 shipped the same day and each moved only its own gateway package (3.0.245, 2.0.186).
Three realtime voice SDKs hand binary frames to application code in three ways
Pick the AI SDK route when you need raw bytes in order with text frames. When audio already travels as base64 in event JSON and decoding it yourself is enough, the OpenAI and Google SDKs need no such callback.
The task is the same in all three cases: get audio bytes out of a realtime voice session. Those two questions decide the choice, and every cell comes from the vendor's own notes or type definitions, not a third-party review.
Mind the shape difference: the AI SDK column is a provider-side transport layer, the other two are application-side event streams. The last row compares how each vendor writes its notes, not capability.
| Update | OpenAI Node v7.65.0 | Google GenAI JS v3.6.1 | Vercel AI SDK ai@7.0.185 |
|---|---|---|---|
| Realtime entry | OpenAIRealtimeWS (openai/realtime/ws), with the socket at rt.socket | ai.live.connect() returns a Session; conn is the WebSocket | connectToWebSocket in provider-utils |
| Inbound frames | Events parsed into objects, sent to rt.on(...); socket at rt.socket | onmessage gets a parsed LiveServerMessage, audio under Blob | Text to onMessageText, binary to the new onMessageBinary |
| Audio bytes | delta on response.output_audio.delta is base64 | Blob.data is base64 | onMessageBinary delivers a Uint8Array per frame |
| How the notes describe this change | v7.65.0 carries one Features entry: add spend alerts and response compaction fields | v3.6.1 carries one Bug Fixes entry: update sdk enum | Notes say Updated dependencies [743e15b] and list both |
Between the two versions sits one callback and one gateway version number
Put 7.0.184 and 7.0.185 side by side and the feature surface grows by one optional callback. Both columns are filled row by row from the announcements on the same channel.
Only the binary frame row changes your code: the older version sent every frame through TextDecoder into onMessageText, this one adds a path that delivers bytes. The version row is what an install resolves to.
If you are on an earlier release, read provider-utils 5.0.85 as well: it raised the Responses stream event size limit, a separate change from this callback.
| Feature | 7.0.184 | 7.0.185 |
|---|---|---|
| Pinned gateway | 4.0.157 | 4.0.158 |
| Binary frame callback | None: frames decoded and passed to onMessageText | onMessageBinary added, one Uint8Array per frame |
| Frame order | A single onMessageText queue | Both kinds share one queue, async decoding keeps order |
| What the gateway did | Updated gateway model settings files (4.0.157) | Only re-pinned provider-utils (4.0.158) |
Release analysisTeams running their own voice provider should take this one, everyone else can wait
The blast radius is narrow. Teams that write their own provider on provider-utils and take realtime audio over WebSocket are the only ones who gain: one less text decode and bytes that arrive directly. Apps on official providers that leave the callback out behave as before (our inference, not independently tested), so they can wait.
OpenAI Node v7.65.0 carries audio as a base64 string in an event; Google GenAI JS v3.6.1 puts the same base64 string in Blob.data, and both leave decoding to the application. The AI SDK step hands raw bytes one layer lower, and only providers on connectToWebSocket benefit.
Our call: upgrade to 7.0.185, pass onMessageBinary in a test provider, run one known audio clip to confirm the callback gets bytes in the same order as text frames, then decide whether to drop the provider's own decode logic. Do not read this as a gateway change, since 4.0.158 only re-pins, and do not rewrite an HTTP provider for this callback. This is our position, not an independent test.
AIGenLab views
Not independently testedFor projects running their own realtime voice provider, the value here is one skipped text decode; apps on official providers gain nothing.
Our position, based on the source difference between 5.0.85 and 5.0.86
Upgrade the main package first, pass onMessageBinary in a test provider and check one frame with known audio before touching production.
Our position, without production traffic validation
Keeping text and binary frames on one queue is steadier than sorting them inside a provider, especially with async Blob reads.
Our position, drawn from the promise queue in the 5.0.86 source
Questions
Do I need to change code after upgrading to ai@7.0.185?
What exactly does onMessageBinary receive?
Did the gateway change in this release?
Official sources and scope
- vercel/ai ai@7.0.185 release The version, publish date and dependency pins in this release
- @ai-sdk/provider-utils 5.0.86 release The purpose of the onMessageBinary callback and the in-order-with-text-frames wording
- connect-to-websocket.ts at provider-utils 5.0.86 The callback signature, the binaryType setting, frame routing and the promise queue that keeps order
- websocket.ts at provider-utils 5.0.85 The previous behaviour that decoded binary frames as text
- vercel/ai ai@7.0.184 release The previous version used in the vertical comparison and its gateway 4.0.157 pin
- @ai-sdk/gateway 4.0.158 release That the gateway package only re-pinned provider-utils in this release
- @ai-sdk/gateway 4.0.157 release That the model settings file update happened in 4.0.157
- @ai-sdk/gateway 4.0.159 release The gateway content that ai@7.0.186 carries next
- openai-node v7.65.0 release The current version of the OpenAI Node SDK used in the horizontal table
- openai-node Realtime API guide The OpenAI realtime connection entry points and how events are dispatched
- openai-node realtime event types That the audio delta is a base64 string
- @google/genai v3.6.1 release The current Google GenAI JS version and its patch content
- @google/genai live.Live API reference The ai.live.connect() entry point and its onmessage callback
- @google/genai type definitions The LiveServerMessage shape and the base64 note on Blob.data
Dates beside sources indicate when we consulted them, not when the vendor released the update. Procedures are editorial guidance, not independently tested.