📁 ai-sdk/docs/reference/ai-sdk-ui

File: ai-sdk-ui.md | Updated: 11/15/2025

Source: https://ai-sdk.dev/docs/reference/ai-sdk-ui

AI SDK

Menu

v5 (Latest)

AI SDK 5.x

AI SDK by Vercel

AI SDK 6 Beta

Foundations

Overview

Providers and Models

Prompts

Tools

Streaming

Getting Started

Navigating the Library

Next.js App Router

Next.js Pages Router

Svelte

Vue.js (Nuxt)

Node.js

Expo

Agents

Agents

Building Agents

Workflow Patterns

Loop Control

AI SDK Core

Overview

Generating Text

Generating Structured Data

Tool Calling

Model Context Protocol (MCP) Tools

Prompt Engineering

Settings

Embeddings

Image Generation

Transcription

Speech

Language Model Middleware

Provider & Model Management

Error Handling

Testing

Telemetry

AI SDK UI

Overview

Chatbot

Chatbot Message Persistence

Chatbot Resume Streams

Chatbot Tool Usage

Generative User Interfaces

Completion

Object Generation

Streaming Custom Data

Error Handling

Transport

Reading UIMessage Streams

Message Metadata

Stream Protocols

AI SDK RSC

Advanced

Reference

AI SDK Core

AI SDK UI

useChat

useCompletion

useObject

convertToModelMessages

pruneMessages

createUIMessageStream

createUIMessageStreamResponse

pipeUIMessageStreamToResponse

readUIMessageStream

InferUITools

InferUITool

AI SDK RSC

Stream Helpers

AI SDK Errors

Migration Guides

Troubleshooting

Copy markdown

AI SDK UI

===================================================================

AI SDK UI is designed to help you build interactive chat, completion, and assistant applications with ease. It is framework-agnostic toolkit, streamlining the integration of advanced AI functionalities into your applications.

AI SDK UI contains the following hooks:

useChat

Use a hook to interact with language models in a chat interface.
useCompletion

Use a hook to interact with language models in a completion interface.
useObject

Use a hook for consuming a streamed JSON objects.
convertToModelMessages

Convert useChat messages to ModelMessages for AI functions.
pruneMessages

Prunes model messages from a list of model messages.
createUIMessageStream

Create a UI message stream to stream additional data to the client.
createUIMessageStreamResponse

Create a response object to stream UI messages to the client.
pipeUIMessageStreamToResponse

Pipe a UI message stream to a Node.js ServerResponse object.
readUIMessageStream

Transform a stream of UIMessageChunk objects into an AsyncIterableStream of UIMessage objects.

UI Framework Support


AI SDK UI supports the following frameworks: React , Svelte , and Vue.js . Here is a comparison of the supported functions across these frameworks:

| Function | React | Svelte | Vue.js | | --- | --- | --- | --- | | useChat | | Chat | | | useCompletion | | Completion | | | useObject | | StructuredObject | |

Contributions are welcome to implement missing features for non-React frameworks.

On this page

AI SDK UI

UI Framework Support

Deploy and Scale AI Apps with Vercel.

Vercel delivers the infrastructure and developer experience you need to ship reliable AI-powered applications at scale.

Trusted by industry leaders:

  • OpenAI
  • Photoroom
  • leonardo-ai Logoleonardo-ai Logo
  • zapier Logozapier Logo

Talk to an expert