createChatHandler from @opengeni/sdk/chat. Connect your existing chat UI, or try it with curl. For a ready-made React UI, use SessionConversation instead.
Run it
You need Bun, a repository checkout, and a full-access organization API key. The demo uses private chats, so Only me chats must be on in Organization settings > Security & data.u_42 is added to it on their first request.
Send a message:
GET /api/chat with the same headers returns the history, and POST /api/chat/respond answers a pending approval or question.
The x-demo-user header is for the demo only. A real product authenticates the user on the server.
Formats
The handler streams its own chat chunks by default, and also speaks the Vercel UI message stream (format: "vercel"), OpenAI Chat Completions, and OpenAI Responses. See Keep your existing chat UI.
View the source on GitHub.