All integrations
AI SDK adapter

Vercel AI SDK

Connect Vercel AI SDK UIMessage streams to OpenUI with OpenUI's bundled first-party adapter and message format.

Integration overview

How it connects to OpenUI

Return the UIMessage SSE produced by streamText().toUIMessageStreamResponse(), then use vercelAIAdapter() with vercelAIMessageFormat in AgentInterface. OpenUI validates AI SDK v6 or v7 chunks and maps streamed text, tool inputs, tool results, multi-step lifecycles, and errors into AG-UI events.

The integration path

  1. 1

    Describe the interface

    Generate a component prompt from the same OpenUI library that will render the response.

  2. 2

    Stream structured output

    Let Vercel AI SDK own its part of the stack while OpenUI Lang travels as incremental text or mapped agent events.

  3. 3

    Render and interact

    Parse the stream with the matching OpenUI runtime, render real components, and return validated actions to the application.

Start here

Install or scaffold

npm install @openuidev/react-ui ai

What stays consistent

One schema for prompting and rendering
Progressive rendering while output streams
Typed components instead of arbitrary markup
Host application retains its runtime behavior