Connects to the OpenAI Realtime API over WebRTC for real-time voice conversation
openai-realtime-api-nextjs — Next.js Starter Template
By cameronking4
A voice AI starter built on Next.js and shadcn/ui that connects to the OpenAI Realtime API over WebRTC, with built-in tool calling and multilingual examples.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Actual screenshot captured by the server browser.
All pages & views 2
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Provides a use-WebRTC hook that encapsulates WebRTC handling logic
Includes 6 built-in client-side tool-calling examples, covering time lookup, background switching, clipboard copying, and more
Supports localization of both the application and the voice agent in English, Spanish, French, and Chinese
Builds the interface with shadcn/ui, Tailwind CSS, and Framer Motion
Supports both Node.js and Deno runtimes
Template Details
This is a starter template for voice AI applications, centered on establishing real-time audio sessions with the OpenAI Realtime API over WebRTC. The project includes /api routes and interface components built with Next.js and shadcn/ui, and provides a use-WebRTC hook that encapsulates WebRTC handling logic, with an implementation referencing skrivov/openai-voice-webrtc-next and adding hook abstraction.
Functionally, the template ships with 6 client-side tool-calling examples: getCurrentTime, partyMode, changeBackground, launchWebsite, copyToClipboard, and scrapeWebsite, of which scrapeWebsite requires an additional FireCrawl API key. The interface supports four languages—English, Spanish, French, and Chinese—allowing separate switching of application copy and voice agent language. Styling uses Tailwind CSS and Framer Motion, the code is TypeScript, and strict ESLint rules can optionally be enabled.
For the runtime environment, a Deno or Node.js runtime is required, and an OpenAI API Key or Azure OpenAI API Key must be configured in .env. According to the README, the application runs by default at http://localhost:3000, and a one-click Vercel deploy button is also provided. The project is MIT-licensed, allowing free use, modification, commercial use, and distribution of the code, but third-party assets such as demo images, fonts, and icons, as well as external services like domains, hosting, and AI, require separate verification of licensing and costs.
Is it right for your project?
Use Cases
- Building a prototype for a real-time voice conversation application based on WebRTC
- Demonstrating the Realtime API's client-side tool-calling capabilities
- Verifying the switching effect between multilingual voice agents and application copy
- Serving as a starting point for integrating voice interaction features into a Next.js project
Suitable For
- Developers who need to quickly validate an OpenAI Realtime API voice solution
- Engineers looking for a reference on combining WebRTC with Next.js
- Teams preparing to build multilingual voice AI application prototypes
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
Requires a Deno or Node.js runtime environment
- 2
Create a .env in the root directory and configure OPENAI_API_KEY or Azure OpenAI API Key
- 3
For Node.js, use npm install and npm run dev; for Deno, use deno install and deno task start
- 4
The scrapeWebsite tool example requires an additional FireCrawl API key
- 5
Can be deployed via the one-click Vercel deploy button, and deployment requires providing OPENAI_API_KEY
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis entry covers the free version under the MIT license in the public repository; the free scope applies to that version's code and does not mean external services or third-party assets are free.
Must comply with when using
- Permits free use, modification, commercial use, and distribution of that version's code.
- When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- Running the application requires providing your own OpenAI or Azure OpenAI API key and writing it into .env; this is an external paid service dependency, and you bear the call costs yourself.
- The scrapeWebsite tool example depends on an additional FireCrawl API key; without that key configured, this feature is unavailable, and it may incur third-party service fees.
- Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
- External services such as domains, hosting, databases, payments, or AI may incur separate charges.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
OpenAI API Key or Azure OpenAI API Key in `.env` file
Original README
https://github.com/cameronking4/openai-realtime-api-nextjs/blob/main/LICENSEhttps://github.com/cameronking4/openai-realtime-api-nextjs/blob/main/README.md`scrapeWebsite` (requires FireCrawl API key)
Original README
Compiled by DeepSeek based on repository license and README ·2026-09-30. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- More documented · 85 / 100
- Technologies
- Next.js · React
- Website type
- Starter
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2025-04-12
- Screenshot last checked
- 2026-09-30
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Automatically checked against source and license rules; no manual editorial review.
Inspect the recorded source material
SHA-256: 83f142833d245c4ad7a9c6fb02e50dc55c5747b304c3b4a6c2ae0229437dca54
2026-09-30T08:13:25.865Z
Source file / repository# OpenAI WebRTC Shadcn Next15 Starter This is a WebRTC-based Voice AI stream application using `OpenAI`'s `Realtime API` and `WebRTC`. Project contains `/api` route and UI components developed with `Next.js` and `shadcn/ui`. It supports real-time audio conversations implented in [skrivov/openai-voice-webrtc-next](https://github.com/skrivov/openai-voice-webrtc-next) with the addition of a hook to abstract the WebRTC handling. https://github.com/user-attachments/assets/ea9324af-5c18-48d2-b980-2b81baeea4c0 ## Features - **Next.js Framework**: Built with Next.js for server-side rendering and API routes. - **Modern UI**: Animated using Tailwind CSS & Framer Motion & shadcn/ui. - **Use-WebRTC Hook**: A hook to abstract the OpenAI WebRTC handling. - **Tool Calling**: 6 example functions to demonstrate client side tools along with Realtime API: `getCurrentTime`, `partyMode`, `changeBackground`, `launchWebsite`, `copyToClipboard`, `scrapeWebsite` (requires FireCrawl API key) - **Localization**: Select language for app strings and the voice agent (English, Spanish, French, Chinese) - **Type Safety**: TypeScript with strict eslint rules (optional) ## Requirements - **Deno runtime** or **Node.js** - OpenAI API Key or Azure OpenAI API Key in `.env` file ## Installation ### 1. Clone the Repository ```bash git clone https://github.com/cameronking4/openai-realtime-api-nextjs.git cd openai-realtime-api-nextjs ``` ### 2. Environment Setup Create a `.env` file in the root directory: ```env OPENAI_API_KEY=your-openai-api-key ``` ### 3. Install Dependencies If using **Node.js**: ```bash npm install ``` If using **Deno**: ```bash deno install ``` ### 4. Run the Application #### Using Node.js: ```bash npm run dev ``` #### Using Deno: ```bash deno task start ``` The application will be available at `http://localhost:3000`. ## Usage 1. Open the app in your browser: `http://localhost:3000`. 3. Select a voice and start the audio session. ## Deploy to Vercel **Deploy in one-click** [](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fcameronking4%2Fopenai-realtime-api-nextjs&env=OPENAI_API_KEY&envDescription=OpenAI%20Key%20(Realtime%20API%20Beta%20access)&envLink=https%3A%2F%2Fplatform.openai.com%2Fapi-keys&project-name=openai-rt-shadcn&repository-name=openai-realtime-api-nextjs-clone&demo-title=OpenAI%20Realtime%20API%20(WebRTC)%20x%20shadcn%2Fui&demo-description=Next.js%2015%20template%20to%20create%20beautiful%20Voice%20AI%20applications%20with%20OpenAI%20Realtime%20API%20Beta&demo-url=https%3A%2F%2Fopenai-rt-shadcn.vercel.app&demo-image=http%3A%2F%2Fopenai-rt-shadcn.vercel.app%2Fdemo.gif) ## License This project is licensed under the MIT License. See the `LICENSE` file for details. ## Acknowledgements - [OpenAI](https://openai.com/) for their API and models. - [Next.js](https://nextjs.org/) for the framework. - [Tailwind CSS](https://tailwindcss.com/) for styling. - [Simon Willison’s Weblog](https://simonwillison.net/2024/Dec/17/openai-webrtc/) for inspiration - [Originator: skrivov](https://github.com/skrivov/openai-voice-webrtc-next) for the WebRTC and Nextjs implementation
Explore similar templates
Compare previews and descriptions within the same stack and category.

Next.js SaaS Starter
The official Next.js SaaS starter template, integrating email/password authentication, Stripe Checkout subscriptions, a dashboard with user/team CRUD, basic Owner/Member RBAC, and activity logging.
Next.js · SaaS

Next.js Commerce
Vercel's officially maintained Next.js App Router ecommerce starter with deep Shopify integration, offering a complete product catalog, cart, and checkout flow. Core logic is modular for swapping backends, and community provider versions exist for BigCommerce, Medusa, and Saleor.
Next.js · E-commerce

Next-js-Boilerplate
A developer-first Next.js 16 starter with Tailwind CSS 4 and TypeScript, supporting both App Router and Page Router.
Next.js · Starter

tailwind-nextjs-starter-blog
A Next.js and Tailwind CSS blog starter template using Contentlayer for Markdown/MDX, with built-in SEO, code highlighting, and tags. It targets personal technical blogs and migration from Jekyll/Hugo to React, and supports one-click Vercel deployment.
Next.js · Blog

next-forge
next-forge is a Turborepo-based Next.js template maintained by Vercel, positioned as a starting point for SaaS products.
Next.js · Starter

SaaS-Boilerplate
SaaS-Boilerplate is an open-source SaaS starter template built with Next.js App Router, React 19, TypeScript, Tailwind CSS, and Shadcn UI.
Next.js · SaaS
