Settings & Setup

Configuration guide and environment variables

Setup Guide

1

Get Gemini API Key

Visit Google AI Studio and create a new API key with access to Gemini Live API.

2

Set Up Exotel Account

Create an Exotel account, purchase an Exophone number, and get your API credentials.

3

Configure Exotel Voicebot

In Exotel dashboard, create a Voicebot Applet and set the WebSocket URL to your server.

4

Deploy to Public Server

Deploy to Railway, Render, or VPS so Exotel can connect to your WebSocket server.

5

Configure Environment

Copy .env.local and fill in your API keys. Restart the servers.

Environment Variables

Gemini AI

GEMINI_API_KEYrequiredsecret

Get from Google AI Studio (aistudio.google.com)

Exotel

EXOTEL_API_KEYrequiredsecret

Found in Exotel Dashboard → Settings → API

EXOTEL_API_TOKENrequiredsecret

Found alongside the API Key in Exotel Dashboard

EXOTEL_SIDrequired

Your Exotel Account SID

EXOTEL_CALLER_IDrequired

Your Exotel virtual phone number (Exophone)

Server

PORT

Port for the Next.js frontend (default: 3000)

INBOUND_WS_PORT

Port for the inbound WebSocket server (default: 8080)

OUTBOUND_WS_PORT

Port for the outbound WebSocket server (default: 8081)

Audio Processing Pipeline

Inbound (Caller → AI)

Exotel μ-law 8kHz
→ mulawToPcm()
→ PCM 8kHz
→ Gemini Live API

Outbound (AI → Caller)

Gemini PCM 24kHz
→ downsampleBuffer(24k→8k)
→ pcmToMulaw()
→ Exotel μ-law 8kHz

Deployment Commands

Start Frontendnpm run dev
Start Inbound Servernpm run server:inbound
Start Outbound Servernpm run server:outbound
Start All Serversnpm run server:all
Production Buildnpm run build && npm start