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

# Installation

> Install and configure the ElevenLabs AI agent with Connect, Twilio Audio Interface, and webhooks.

# Installation & Configuration

## 1) Install the service

* Install the Odoo modules and the Twilio Audio Interface service from `connect_elevenlabs/service`.
* Copy and fill the environment file, then install dependencies and run:

```bash theme={null}
cd service
cp .env.example .env
cat .env  # set ELEVENLABS_API_KEY, ODOO_USER, ODOO_PASSWORD, ODOO_URL
uv sync
uv run main.py
```

* In Odoo, set a password for the `connect` portal user (remove the Internal Users filter to see it) and reuse it in `.env`.

## 2) Expose the service with ngrok

* Create an ngrok account, install the CLI, and add your auth token:

```bash theme={null}
ngrok config add-authtoken <token>
ngrok http 48000
```

<img src="https://mintcdn.com/test-99895540/4eQ6AIbO89AUVLyN/connect/images/elevenlabs-ngrok-tunnel.png?fit=max&auto=format&n=4eQ6AIbO89AUVLyN&q=85&s=cc06b8cb69804f664000a7f812245190" alt="ngrok tunnel" width="1890" height="908" data-path="connect/images/elevenlabs-ngrok-tunnel.png" />

## 3) Agent URL in Connect

In **Connect → Settings → ElevenLabs → Settings**, set the Agent URL to the public ngrok URL.

<img src="https://mintcdn.com/test-99895540/4eQ6AIbO89AUVLyN/connect/images/elevenlabs-agent-url.png?fit=max&auto=format&n=4eQ6AIbO89AUVLyN&q=85&s=a14d689ea4bbef094250eebc50b626d3" alt="Agent URL in Connect" width="1920" height="602" data-path="connect/images/elevenlabs-agent-url.png" />

## 4) Post-call webhook from Odoo

Copy the Post-Call Webhook URL shown in **ElevenLabs → Settings**.

<img src="https://mintcdn.com/test-99895540/4eQ6AIbO89AUVLyN/connect/images/elevenlabs-postcall-url.png?fit=max&auto=format&n=4eQ6AIbO89AUVLyN&q=85&s=eba30b0a7e1a91fddd3ef75885cf4580" alt="Post-call URL" width="1886" height="866" data-path="connect/images/elevenlabs-postcall-url.png" />

## 5) Create webhook in ElevenLabs

Paste the URL into the ElevenLabs webhook form and save.

<img src="https://mintcdn.com/test-99895540/4eQ6AIbO89AUVLyN/connect/images/elevenlabs-webhook-form.png?fit=max&auto=format&n=4eQ6AIbO89AUVLyN&q=85&s=d945d3d88370f342a85aa3991a3669ee" alt="Webhook form" width="1220" height="1170" data-path="connect/images/elevenlabs-webhook-form.png" />

Copy the generated webhook secret.

<img src="https://mintcdn.com/test-99895540/4eQ6AIbO89AUVLyN/connect/images/elevenlabs-webhook-secret.png?fit=max&auto=format&n=4eQ6AIbO89AUVLyN&q=85&s=4cac3eb5a80822b904858c4076a3ad64" alt="Webhook secret" width="1142" height="620" data-path="connect/images/elevenlabs-webhook-secret.png" />

<img src="https://mintcdn.com/test-99895540/4eQ6AIbO89AUVLyN/connect/images/elevenlabs-webhook-secret-copied.png?fit=max&auto=format&n=4eQ6AIbO89AUVLyN&q=85&s=b3529d0c3ab1251d184fb795db99e441" alt="Webhook secret copy" width="1494" height="648" data-path="connect/images/elevenlabs-webhook-secret-copied.png" />

## 6) Store webhook secret in Odoo

Paste the secret back into **Connect → Settings → ElevenLabs**.

<img src="https://mintcdn.com/test-99895540/4eQ6AIbO89AUVLyN/connect/images/elevenlabs-webhook-secret-odoo.png?fit=max&auto=format&n=4eQ6AIbO89AUVLyN&q=85&s=732128af1e4f94b4ce9254478a1402e2" alt="Webhook secret in Odoo" width="1920" height="763" data-path="connect/images/elevenlabs-webhook-secret-odoo.png" />

## 7) Run in production with systemd

Use systemd units to keep ngrok and the agent running after reboots. Replace paths and users as needed.

### Ngrok service

Create `/etc/systemd/system/ngrok-elevenlabs.service`:

```ini theme={null}
[Unit]
Description=Ngrok tunnel for ElevenLabs agent
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
WorkingDirectory=/opt/connect-elevenlabs/service
ExecStart=/usr/bin/env ngrok http 48000
Restart=on-failure
User=odoo

[Install]
WantedBy=multi-user.target
```

### Agent service

Create `/etc/systemd/system/elevenlabs-agent.service`:

```ini theme={null}
[Unit]
Description=ElevenLabs agent for Oduist Connect
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
WorkingDirectory=/opt/connect-elevenlabs/service
EnvironmentFile=/opt/connect-elevenlabs/service/.env
ExecStart=/usr/bin/env uv run main.py
Restart=on-failure
User=odoo

[Install]
WantedBy=multi-user.target
```

### Enable and monitor

```bash theme={null}
sudo systemctl daemon-reload
sudo systemctl enable --now ngrok-elevenlabs.service elevenlabs-agent.service
sudo journalctl -u ngrok-elevenlabs.service -u elevenlabs-agent.service -f
```

Confirm the ngrok URL stays stable after a reboot and keep the `.env` file owned/readable by the service user only.

## Other HTTPS tunnel options

* **Cloudflare Tunnel (Argo):** free tier, custom domain, TLS handled by Cloudflare; no inbound ports needed.
* **Tailscale Funnel:** quick HTTPS from a private node; good for internal services with short-lived public URLs.
* **Caddy or Nginx reverse proxy + Let’s Encrypt:** terminate TLS on your own server/static IP or VPS.
* **Traefik:** dynamic reverse proxy with auto-cert via ACME and service discovery (Docker/K8s friendly).
* **frp (Fast Reverse Proxy):** self-hosted tunnel; run your own frps server and frpc client.
* **LocalTunnel or Pagekite:** lightweight OSS tunnels for quick testing (not ideal for production).
