AIGenLab
EN

UPDATEvercel-ai-sdk ai@7.0.185

Vercel AI SDK 7.0.185 adds a binary WebSocket frame callback

Version & typeai@7.0.185 · Feature
In short

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.

Read the original announcement

On this page
  1. Release inventory
  2. This release only moves t…
  3. Binary frames get their o…
  4. Both internal packages mo…
  5. The upgrade touches only…
  6. Three version lines shipp…
  7. Three realtime voice SDKs…
  8. Between the two versions…
  9. Release analysis
  10. Questions
  11. Sources & method

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.

How this release splits across four groups: 5 items on binary frames, 4 on package pins, 4 on upgrade steps and 5 on the version line, 18 in total. The chart is generated from our inventory, not a vendor graphic.
Where the 18 grouped changes landWhere the 18 grouped changes landBinary frames5Package pins4Upgrade steps4Version line5
AIGenLab original

Binary frames get their own callback, so audio bytes stop arriving as decoded text

  1. New callback: onMessageBinary fires once per frame and receives a Uint8Array.
  2. Routing: once it is passed, non-string frames no longer reach onMessageText.
  3. 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

  1. Main package: ai@7.0.185 pins provider-utils 5.0.86 and gateway 4.0.158.
  2. One changeset: both packages come from 743e15b, so a single install brings both.
  3. 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

  1. Upgrade: npm install ai@7.0.185; you do not install either internal package yourself.
  2. To get bytes: pass onMessageBinary where you call connectToWebSocket; other options stay as they are.
  3. 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

  1. Previous: ai@7.0.184 carried two dependency updates and moved gateway to 4.0.157.
  2. Next: ai@7.0.186 moves gateway to 4.0.159 with a model settings file update.
  3. 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.

UpdateOpenAI Node v7.65.0Google GenAI JS v3.6.1Vercel AI SDK ai@7.0.185
Realtime entryOpenAIRealtimeWS (openai/realtime/ws), with the socket at rt.socketai.live.connect() returns a Session; conn is the WebSocketconnectToWebSocket in provider-utils
Inbound framesEvents parsed into objects, sent to rt.on(...); socket at rt.socketonmessage gets a parsed LiveServerMessage, audio under BlobText to onMessageText, binary to the new onMessageBinary
Audio bytesdelta on response.output_audio.delta is base64Blob.data is base64onMessageBinary delivers a Uint8Array per frame
How the notes describe this changev7.65.0 carries one Features entry: add spend alerts and response compaction fieldsv3.6.1 carries one Bug Fixes entry: update sdk enumNotes 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.

Feature7.0.1847.0.185
Pinned gateway4.0.1574.0.158
Binary frame callbackNone: frames decoded and passed to onMessageTextonMessageBinary added, one Uint8Array per frame
Frame orderA single onMessageText queueBoth kinds share one queue, async decoding keeps order
What the gateway didUpdated 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 tested

For 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?
Only if you run your own provider and need binary frames over WebSocket: pass onMessageBinary where you call connectToWebSocket. Apps on official providers change nothing.
What exactly does onMessageBinary receive?
One callback per frame with a Uint8Array. The connection sets binaryType to arraybuffer, binary frames stop reaching onMessageText, and both frame kinds share one queue.
Did the gateway change in this release?
No. gateway 4.0.158 only re-pins provider-utils 5.0.86; the model settings file updates landed in 4.0.157 and 4.0.159.

Official sources and scope

Dates beside sources indicate when we consulted them, not when the vendor released the update. Procedures are editorial guidance, not independently tested.