Complete assistant-ui React API reference for building AI chat UIs with primitives, hooks, runtimes, adapters, tools, transport, voice, and integrations.
Start Here
The React API reference is organized by how you build with assistant-ui:
Define toolkits, install tool resources, and render tool or data parts.
Model ContextProvide instructions, merge model context, and register inline renderers for model-facing state.
TransportAssistant transport, frame provider, and serialized frame protocol APIs for cross-boundary runtimes.
External StoreRuntime and message conversion APIs for apps that own their message store.
VoiceRealtime voice sessions, speech synthesis adapters, and dictation adapters.
PrimitivesComposable React components such as ThreadPrimitive, MessagePrimitive, and ComposerPrimitive.
Reactive state hooks, runtime hooks, model context hooks, and utility hooks.
AdaptersRuntime extension points for attachments, persistence, feedback, speech, dictation, and suggestions.
IntegrationsPackage-level APIs for integrations such as @assistant-ui/react-ai-sdk and @assistant-ui/cloud-ai-sdk.
Runtime action and state shapes used by useAui and useAuiState.
The lower sections on this page show how the core React contexts nest and where the primary primitives, hooks, and runtime objects are available. Feature-first APIs such as tools, model context, transport, external store, and voice now live in their own generated sections.
Highest Level Context Providers
<AssistantRuntimeProvider runtime={runtime} /><TextMessagePartProvider text={text} />Assistant Context
The context available to components inside <AssistantRuntimeProvider />. You usually wrap your entire application in this context.
AssistantRuntime
Programmatically access the assistant's state and actions via useAui().
Instructions
Add system prompt instructions
Tool UI
Register toolkits and tool UIs
Programmatically access the list of registered tool UIs via useAuiState((s) => s.tools) and useAui().tools().
ThreadListPrimitive
Shows a list of threads and allows the user to switch between them.
Thread Context
The context for a single thread. Currently always corresponds to the runtime's main thread.
ThreadRuntime
Programmatically access the thread's state and actions.
- State:
useAuiState((s) => s.thread) - Actions:
useAui().thread() - Composer:
useAuiState((s) => s.composer)
ModelContext
useAui().thread().getModelContext()
ThreadViewportStore
ThreadPrimitive
A conversation thread.
AssistantModalPrimitive
A floating modal that usually appears in the lower right corner of the screen. Common for support use cases.
Composer Context
Manages the state and actions for the message composer
ComposerRuntime
- State:
useAuiState((s) => s.composer) - Actions:
useAui().composer()
ComposerPrimitive
Message Context
Manages the state and actions for individual messages
MessageRuntime
- State:
useAuiState((s) => s.message) - Edit Composer:
useAuiState((s) => s.message.composer) - Actions:
useAui().message() - Utilities:
useAuiState((s) => s.message.isCopied)/useAuiState((s) => s.message.isHovering)
MessagePrimitive
<MessagePrimitive.Parts /><MessagePrimitive.Attachments />ActionBarPrimitive
BranchPickerPrimitive
MessagePart Context
Manages the state and actions for message parts within messages
MessagePartRuntime
- State:
useAuiState((s) => s.part) - Actions:
useAui().part()
MessagePartPrimitive
MarkdownText
Attachment Context
Manages the state and actions for attachments in messages and composer
AttachmentRuntime
- State:
useAuiState((s) => s.attachment) - Actions:
useAui().attachment()
AttachmentPrimitive
ThreadListItem Context
Manages the state and actions for individual thread list items
ThreadListItemRuntime
- State:
useAuiState((s) => s.threadListItem) - Actions:
useAui().threadListItem()