Get Started
Create an API key
Create an Inworld account.In Inworld Portal, generate an API key by going to Settings > API Keys. Copy the Base64 credentials.
Set your API key as an environment variable.

Create the server
Create
server.js. It proxies WebSocket events between the browser and Inworld, configures the voice session, and triggers an initial greeting.server.js
Create the frontend
Create
index.html in the same directory. It captures microphone audio, plays agent audio, and displays transcripts that fade after each turn.index.html
Install and run
How It Works
| Component | Role |
|---|---|
| Browser | Captures mic audio (PCM16, 24 kHz), plays agent audio |
| Server | Proxies events between browser and Inworld, holds the API key server-side |
| Inworld Realtime API | Handles speech-to-text, LLM processing, and text-to-speech in one WebSocket session |
input_audio_buffer.append— streams mic audio to Inworldresponse.output_audio.delta— agent audio chunks for playbackinput_audio_buffer.speech_started— triggers interruption (stops agent playback)