OpenUI Chat SDK

Production-ready chat UI for AI agents. Start with prebuilt layouts for fast integration, then drop down to headless hooks when you need full control over behavior and rendering.


Batteries-Included Layouts

Choose the surface that matches your product and customize from there.


Core Capabilities

The SDK handles the stateful parts so you can focus on UX, product logic, and polish.

Streaming Native

Handles text deltas, optimistic updates, loading states, and partial responses.

Thread Persistence

Save and restore conversation history with straightforward API contracts.

Composable State

Use the same primitives across prebuilt layouts and fully custom chat surfaces.

Go Headless

Use the same chat primitives without the prebuilt layouts when you need a fully custom surface.

The `useChat` hook gives you message state, append helpers, and loading semantics without locking you into a specific UI.

CustomChat.tsx
import { useChat } from '@openuidev/react';

function CustomChat() {
  const { messages, append, isLoading } = useChat();

  return (
    <div>
      {messages.map(m => (
        <div key={m.id}>
          {m.content}
        </div>
      ))}

      <input
        onChange={e => append(e.target.value)}
      />
    </div>
  );
}
Read the Headless Guide