Openai Realtime Api Nextjs

screenshot of Openai Realtime Api Nextjs

Leverage the OpenAI Realtime API (12-17-2024) with this Next.js 15 starter template featuring shadcn/ui components, tool-calling & localization. Use starter to build Voice AI apps with WebRTC.

Overview:

The OpenAI WebRTC Shadcn Next15 Starter is a WebRTC-based Voice AI stream application that utilizes OpenAI's Realtime API and WebRTC. It includes a /api route and user interface components developed with Next.js and shadcn/ui. The application supports real-time audio conversations with the use of an abstracted WebRTC handling hook.

Features:

  • Next.js Framework: Built with Next.js for server-side rendering and API routes.
  • Modern UI: Includes animations using Tailwind CSS, Framer Motion, and shadcn/ui.
  • Use-WebRTC Hook: Provides a hook to abstract the OpenAI WebRTC handling.
  • Tool Calling: Includes 6 example functions for client-side tools and Realtime API operations like getCurrentTime, partyMode, changeBackground, launchWebsite, copyToClipboard, and scrapeWebsite.
  • Localization: Allows users to select app language and voice agent language among English, Spanish, French, and Chinese.
  • Type Safety: Utilizes TypeScript with strict eslint rules (optional).

Summary:

The OpenAI WebRTC Shadcn Next15 Starter is a WebRTC-based Voice AI application built with Next.js, offering modern UI features and a variety of tools for real-time audio conversations. It provides easy installation steps, supports multiple languages for localization, and includes type safety with TypeScript.