AI Agent News/stories/vercel-s-ai-sdk-xai-5-0-52-accepts-larger-responses-stream-events.md

Frameworks

Vercel's @ai-sdk/xai 5.0.52 accepts larger Responses stream events

Vercel has released @ai-sdk/xai 5.0.52, which fixes streams that failed when a response carried several large generated images. The OpenAI and xAI Responses models can now accept stream events of up to 512 MiB.

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

The patch adds a maxEventSize option to createEventSourceResponseHandler, which the provider utilities use to read server-sent events. The OpenAI and xAI Responses language models set it to allow events up to 512 MiB, beyond the previous default limit of 64 MiB.

The change addresses how response.completed works. That event repeats every output item, including base64 image generation results, so streams with several large generated images could exceed the default limit. Those streams failed after all the images had already been delivered.

The release also updates the @ai-sdk/provider-utils dependency to 5.0.85, which carries the new option.

Why it matters if you build agents

If you generate several images through the xAI or OpenAI Responses models in one stream, those streams should no longer fail at the end. Code that retried such streams or worked around the size limit may no longer be needed. Check your lockfile after upgrading, since the provider utilities package moves to 5.0.85 as well.

Get stories like this every weekday

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

Subscribe