RealtimeKeep your app up to date
AuthenticationOver 80+ OAuth integrations
Convex Components
ComponentsIndependent, modular, TypeScript building blocks for your backend.
Open sourceSelf host and develop locally
AI CodingGenerate high quality Convex code with AI
Compare
Convex vs. Firebase
Convex vs. Supabase
Convex vs. SQL
DocumentationGet started with your favorite frameworks
SearchSearch across Docs, Stack, and Discord
TemplatesUse a recipe to get started quickly
Convex for StartupsStart and scale your company with Convex
Convex ChampionsAmbassadors that support our thriving community
Convex CommunityShare ideas and ask for help in our community Discord
Stack
Stack

Stack is the Convex developer portal and blog, sharing bright ideas and techniques for building with Convex.

Explore Stack
BlogDocsPricing
GitHub
Log inStart building
Back to Templates

Next.js + Convex AI Chat Starter v.0.1

GitHub logoView RepoView Live

Built with

OpenAI iconOpenAIConvex iconConvexNext.js iconNext.jsTailwind iconTailwind

Tags

Starter
npm create convex@latest -- -t waynesutton/nextjsaichatconvextemplate

Next.js + Convex AI Chat Starter

A real-time AI chat application built with Next.js, Convex, Tailwind CSS, and OpenAI.

🛠 Tech Stack

  • Next.js
  • Convex
  • Tailwind CSS
  • OpenAI API
  • Vercel AI SDK (ai package)
  • react-textarea-autosize
  • TypeScript

✨ Features

  • Real-time chat interface using Convex and the Vercel AI SDK (useChat) for data synchronization and state management
  • AI responses powered by OpenAI, generated asynchronously in the background using Convex Actions to keep the UI responsive (supports multiple models)
  • Persistent storage of conversation history and chat sessions in the Convex database
  • Ability to clear the current chat session
  • Management of AI model preferences
  • Chat message archival functionality
  • User input handling with automatic textarea resizing
  • Responsive UI styled with Tailwind CSS and Shadcn/ui components
  • Toast notifications for user feedback
Next.js + Convex AI Chat Starter v.0.1 hero image
Get your app up and running in minutes
Start building
Convex logo
ProductSyncRealtimeAuthOpen sourceAI codingChefFAQPricing
DevelopersDocsBlogComponentsTemplatesStartupsChampionsChangelogPodcastLLMs.txt
CompanyAbout usBrandInvestorsBecome a partnerJobsNewsEventsTerms of servicePrivacy policySecurity
SocialTwitterDiscordYouTubeLumaBlueskyGitHub
A Trusted Solution
  • SOC 2 Type II Compliant
  • HIPAA Compliant
  • GDPR Verified
©2025 Convex, Inc.