OpenAI Agents SDK
Stream an OpenAI Agents SDK response into the Vercel AI SDK view.
Stream UI messages from the server
Install the SDK and its UI-message extension on your server.
Use the ai-sdk-ui extension to emit a UI-message stream from your agent.
Call this from your authenticated server route with an application-configured agent, validated input and the request signal. Return its Response unchanged so stream headers survive. Persist and authorize conversation/session state in your server owner; a client-provided transcript is not authenticated history.
Connect Ghost
Point the Vercel AI SDK client at your route with DefaultChatTransport({ api: "/api/chat" }). The adapter renders the response through MessageParts.
Native capabilities and troubleshooting
Agents SDK owns handoffs, sessions, tools, guardrails and interruptions. The stream bridge only exposes what its UI-message protocol can express. Keep richer native run/interruption state in your application and bind a deliberate approval/resumption command when needed; a displayed tool call does not execute it.
A successful text stream alone does not prove approval, handoff or session recovery. Check those native flows separately if your application uses them. See the official extension for bridge behavior and SDK integration boundaries.