Skip to main content
The Vercel AI SDK is a unified TypeScript library for building reactive AI web applications. It supports token streaming, conversational UI hooks, and structured output extraction.

Setup

Install the core SDK and the OpenAI-compatible adapter:

Provider Initialization

Instantiate the Neosantara provider using createOpenAICompatible:

Text Generation and Streaming

Next.js App Router Route (app/api/chat/route.ts)

Return a standard data stream response compatible with the frontend useChat hook:
app/api/chat/route.ts

Vercel AI SDK Method Comparison

Next Steps