createChatHandler from @opengeni/sdk/chat. It has no frontend: connect your existing chat UI, or try it with curl. For the full React experience, use SessionConversation instead.
Run it
You need Bun, a repository checkout, a full-access organization API key, and your organization id. An organization owner or admin must first enable Only me chats in the web app under Organization settings > Security & data. If the setting is unavailable, ask the installation operator to activate private chats. The chat facade defaults to private chats; onboarding and the chat handler do not enable this organization setting. Until enabled, requests fail closed withOPENGENI_SETUP_REQUIRED (OpenGeniSetupError in the SDK), without creating a chat or changing the setting.
bun run onboard u_42 creates the demo tenant’s workspace and makes the user u_42 a member. A real product does this once, when it admits a user. It prints an operation id; after an uncertain result, retry with bun run onboard u_42 <that id>.
Send a message:
GET /api/chat with the same headers restores history and pending decisions, 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 and checks that they may open the conversation id.
Formats
The handler streams native chat chunks by default and also speaks the Vercel UI message stream (format: "vercel"), OpenAI Chat Completions, and OpenAI Responses shapes. See Keep your existing chat UI.
View the source on GitHub.