> ## Documentation Index
> Fetch the complete documentation index at: https://nenyax.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LiveKit Setup

> Configure LiveKit Cloud for real-time audio.

# LiveKit Setup

LiveKit handles real-time audio between the browser, voice agent, and phone calls.

## Setup Steps

1. Create an account at [LiveKit Cloud](https://cloud.livekit.io)
2. Create a new project
3. Copy your **API Key**, **API Secret**, and **WebSocket URL**
4. Add credentials via the **Nenyax Dashboard** at **API Keys > LiveKit**

<Note>
  LiveKit credentials are stored encrypted in the database and shared across all services automatically. The agent fetches them from the backend on startup — no `.env` files needed for LiveKit.
</Note>

## How It Works

* **Browser sessions**: The frontend generates a LiveKit access token and connects via WebRTC
* **Agent dispatch**: When a room is created, LiveKit dispatches the `nenyax-agent` worker
* **Phone calls**: Twilio SIP trunks route calls through LiveKit's SIP bridge (see [Telephony Setup](/configuration/telephony))

## Verify Your Setup

After adding credentials, verify everything works:

1. Start all three services (frontend, backend, agent)
2. Go to the **Preview** page in the dashboard
3. Select an agent and click **Start Preview**
4. You should hear the agent greet you within a few seconds

If the call immediately disconnects, check:

* LiveKit credentials are configured at **API Keys** and the **Test Connection** button shows success
* The `LIVEKIT_URL` format is correct (`wss://` prefix)
* The agent terminal shows `Worker registered` on startup
* The agent terminal shows `Injected N keys from backend dashboard` on startup

## Documentation

* [LiveKit Getting Started](https://docs.livekit.io/home/get-started/)
* [LiveKit Agents Quickstart](https://docs.livekit.io/agents/quickstarts/sip/)
* [LiveKit Server SDKs](https://docs.livekit.io/home/server/overview/)
