Vercel

Overview

API reference for the Chat SDK core package.

Complete API reference for the chat package. All exports are available from the top-level import:

import { Chat, root, paragraph, text, Card, Button, emoji } from "chat";

Core

ExportDescription
ChatMain class — registers adapters, event handlers, and webhook routing
ThreadConversation thread with methods for posting, subscribing, and state
ChannelChannel/conversation container that holds threads
MessageNormalized message with text, AST, author, and metadata
ScheduledMessageReturned by thread.schedule() / channel.schedule() with cancel()

Utilities

ExportDescription
toAiMessagesConvert Message[] to AI SDK { role, content }[] format

Message formats

ExportDescription
PostableMessageUnion type accepted by thread.post()
CardsRich card components — Card, Text, Button, Actions, etc.
MarkdownAST builder functions — root, paragraph, text, strong, etc.
ModalsModal form components — Modal, TextInput, Select, etc.

On this page

GitHubEdit this page on GitHub