Telepath
Telepath Documentation
High-Performance Voice AI Infrastructure. The "Metal" for your AI Models.
1. Introduction
Telepath is the Real-Time Voice AI Infrastructure that bridges the gap between traditional telephony (PSTN/SIP) and modern AI Agents. We provide a Zero-Latency websocket bridge, allowing you to connect any SIP carrier (Twilio, Telnyx, etc.) directly to OpenAI, ElevenLabs, or your custom AI backend with millisecond precision.
Signal Flow
- PSTN/Carrier (Twilio/Telnyx) sends audio via SIP to Telepath.
- Telepath acts as a Relay, converting SIP/RTP into a WebSocket stream.
- AI Agent (OpenAI/Custom) processes the stream and responds.
- Telepath streams the response back to the caller in real-time.
2. Quick Start
Prerequisites
- A SIP Trunking provider (Twilio, Telnyx, Vonage, Bandwidth, SignalWire, Plivo, etc.)
- An API Key from an AI provider (OpenAI, ElevenLabs, etc.)
Step 1: Create a Connection
- Log in to the Telepath Dashboard.
- Click "Create Connection".
- Enter a SIP Username (e.g.,
my-sales-bot). - Select your AI Provider (e.g., OpenAI) and enter your API Key.
- Important: Copy the generated SIP Password immediately. You will not be able to see it again.
Step 2: Point Your Carrier to Telepath
Configure your carrier's **Origination SIP URI** to point to your new connection:
sip:{sip_username}@sip.telepath.live
Step 3: Make a Test Call
Call your carrier's phone number. The call will route through Telepath to your AI agent. You should hear the AI respond instantly.
3. Creating a Connection
A "Connection" (or Trunk) links a specific SIP Username to an AI Backend configuration.
Required Fields
- SIP Username: unique identifier (3-30 characters) for the SIP address.
- AI Provider: The service handling the logic (OpenAI, ElevenLabs, Custom).
- Provider Credentials: Your private API Key (stored with AES-256 encryption).
Optional Fields
- Inbound Numbers: List of E.164 phone numbers (e.g.,
+14155550100) allowed to use this trunk. - Status Webhook URL: An HTTP endpoint where Telepath sends call lifecycle events (POST).
- Webhook Secret: A secret key to sign webhook requests for security.
Integration URI
Once created, your connection is accessible at:
sip:{sip_username}@sip.telepath.live
4. AI Voice Agent Provider
OpenAI Realtime
Telepath connects directly to OpenAI's WebSocket API, offering ultra-low latency integration.
- Model: Defaults to
gpt-4o-realtime-preview. - API Key: Your standard OpenAI Project API Key.
ElevenLabs
Full support for ElevenLabs Conversational AI Agents.
- Agent ID: Found in the ConvAI dashboard (
agent_...). - API Key: Your
xi-api-key.
Custom / Generic
Connect to your own websocket server or any compatible AI service (Retell, Vapi, etc.).
- WebSocket URL:
wss://your-server.com/stream - Auth Headers: Custom headers to pass (e.g.,
Authorization: Bearer ...).
5. Carrier Configuration
Telepath is carrier-agnostic. You can use any provider that supports SIP Sending (Origination).
Supported Carriers
- Twilio: Search for "Elastic SIP Trunking" -> "Origination".
- Telnyx: "SIP Connections" -> "Outbound Options".
- Vonage: "SIP Trunking".
- Bandwidth: "Unified Communications".
- SignalWire: "Domain App".
- Plivo: "SIP Trunking".
Note: Ensure your carrier supports G.711 (PCMU/PCMA) or G.722 codecs.
6. Dashboard
Call Logs
The Logs view provides a real-time audit trail of every call.
- ID: Unique Call UUID.
- Billable Duration: The talk time (Answer to Hangup), rounded up for billing.
- Start Time: When the call was initialized (SIP INVITE).
- Answer Time: When the AI actually picked up.
- Blame: System analysis of who caused a disconnect (e.g.,
AI Agent,Caller,Carrier). - Disconnect Explanation: Human-readable reason for the call end.
Analytics
View aggregate metrics like Average Latency, Concurrent Calls, and Call Volume over the last 24-72 hours.
7. Webhooks
Configuration
Set the Status Webhook URL in your Connection settings to receive POST events when calls end.
Behavior
- Trigger: Fires when a call ends (Completed, Failed, Busy).
- Retry: Fire-and-forget (no retries).
- Timeout: 5s.
Payload Format
{
"sip_call_id": "a1b2c3d4-...",
"timestamp": "2025-01-15T10:30:00Z",
"direction": "inbound",
"from_number": "+15550100",
"to_number": "+15550200",
"carrier": "twilio",
"status": "completed",
"disconnect_reason": "hangup",
"disconnect_explanation": "User hung up",
"blame": "caller",
"duration": 45.2,
"billable_duration": 46.0,
"ai_latency": 450,
"jitter_max": 12.5
}
8. Codec & VAD
Supported Codecs
Telepath supports high-definition audio transcoding.
- G.711 PCMU (u-law): Standard US telephony.
- G.711 PCMA (a-law): Standard EU telephony.
- G.722: HD Voice (Wideband audio) for superior AI transcription accuracy.
Voice Activity Detection (VAD)
Telepath implements an adaptive audio system that works in tandem with your Voice AI Agent's native Voice Activity Detection.
- Natural Interruptions: Seamless barge-in handling allowing users to speak over the AI naturally.
- Silence Detection: Adaptive sensitivity to ensure accurate end-of-turn detection in various environments.
9. Security
Encryption
- Credentials: All API Keys (OpenAI, etc.) are encrypted at rest using AES-256.
- Media: We support standard RTP.
- Data Retention: Audio is ephemeral and never stored. Logs are retained for analytics only.
SIP Password Rotation
If you believe a SIP password has been compromised, use the Rotate Password feature in the Dashboard or API to immediately generate a new one and revoke the old one.
10. Troubleshooting
Robotic or Choppy Audio
Check Region: Ensure your carrier is routing to the nearest Telepath region (US-East/VA).
Jitter: High jitter (>30ms) typically indicates carrier-side routing issues.
Silent Agent
Check API Key: Verify your OpenAI/ElevenLabs key is valid and has quota.
Check Blame: If it says ai_agent, the issue is
upstream.
Call Connects Then Drops
Password: Ensure your SIP Password is correct.
Firewall: Ensure your carrier allows traffic to/from Telepath IPs.
One-Way Audio
NAT: This is almost always a NAT issue on the carrier side. Ensure they are sending valid public IPs in SDP.
Disconnect Reasons
BYE: Normal hangup.486 Busy: Agent or number busy.503 Service Unavailable: Upstream provider outage.401 Unauthorized: Invalid SIP Credentials.
11. Advanced Integration
DTMF (Keypad Input)
Telepath supports RFC 4733 (formerly RFC 2833) for DTMF signaling.
- Behavior: When a caller presses a key, Telepath converts the RTP event into a JSON message sent to your AI Agent's WebSocket.
- Payload:
{"type": "dtmf", "digit": "1"}
Custom SIP Headers (Context Passing)
You can pass context from your carrier (e.g., User ID, Campaign ID) directly to your AI Agent.
- Carrier Side: Add a SIP Header starting with
X-(e.g.,X-Customer-ID: 12345). - Telepath: Extracts all
X-headers from the INVITE. - AI Side: Receives these headers in the initial connection payload.
Standard SIP Headers
Telepath automatically forwards critical SIP metadata to the AI Agent context:
X-SIP-Call-ID: The carrier's unique Call ID.From: The caller's number (E.164).To: The called number (E.164).
API Reference
Authentication
All API requests must be authenticated using a Bearer Token. You can retrieve your API Key from the Telepath Dashboard.
Base URL: https://api.telepath.live/v1
Authorization: Bearer <YOUR_API_KEY>
Trunks (Connections)
Trunks represent the bridge between the Telephony Network (PSTN) and your AI Agent.
GET /trunks
Retrieve a list of all SIP trunks associated with your account.
Response Attributes
| Field | Type | Description |
|---|---|---|
id |
string | Unique Trunk ID (UUID) |
sip_username |
string | The SIP username used for registration (e.g. my-agent) |
outbound_webhook_url |
string | The WebSocket URL for the AI stream (custom provider only) |
inbound_numbers |
array[string] | List of E.164 phone numbers associated with this trunk |
created_at |
string | ISO 8601 timestamp of creation |
[
{
"id": "uuid",
"sip_username": "my-agent",
"outbound_webhook_url": "wss://...",
"inbound_numbers": ["+14155550100"],
"created_at": "2024-01-01T12:00:00Z"
}
]
POST /trunks
Provision a new SIP trunk.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
sip_username |
string | Yes | Unique identifier (3-30 alphanumeric characters) |
provider |
string | Yes | One of: openai, elevenlabs, retell,
custom
|
provider_config |
object | No | Provider-specific configuration (e.g. model) |
provider_credential |
string | Yes | Private API Key for the AI provider (stored encrypted) |
inbound_numbers |
array[string] | No | List of E.164 phone numbers to link |
{
"sip_username": "my-agent",
"provider": "openai",
"provider_config": {
"model": "gpt-4o-realtime-preview"
},
"provider_credential": "sk-proj-...",
"inbound_numbers": ["+14155550100"]
}
PATCH /trunks/{id}
Modify configuration. Sending null for a field explicitly
clears it.
Request Parameters
| Field | Type | Description |
|---|---|---|
webhook_url |
string | URL for call lifecycle webhooks |
inbound_numbers |
array[string] | Replaces the entire list of associated numbers |
{
"webhook_url": "https://myapp.com/webhooks/calls",
"inbound_numbers": ["+15550199"]
}
POST /trunks/{id}/rotate-sip-password
Regenerate the SIP password. Warning: This immediately invalidates existing SIP registrations.
{
"sip_password": "new-secure-password"
}
Calls (Logs)
Access real-time call data. Logs are indexed and searchable immediately after a call ends.
GET /calls
Retrieve a paginated list of call logs.
Query Parameters
| Parameter | Default | Description |
|---|---|---|
| limit | 50 | Number of records (Max: 1000) |
| offset | 0 | Pagination offset |
Response Attributes
| Field | Type | Description |
|---|---|---|
id |
string | Unique Call ID (UUID) |
direction |
string | inbound or outbound |
from_number |
string | Caller ID |
to_number |
string | Called Number |
duration |
number | Total connection time (seconds) |
billable_duration |
number | Talk time rounded up (seconds) |
status |
string | completed, failed, busy |
disconnect_reason |
string | Reason for hangup (e.g. hangup, timeout,
error)
|
ai_latency |
number | Average AI response latency (ms) |
{
"data": [
{
"id": "uuid",
"direction": "inbound",
"from_number": "+14155550100",
"to_number": "+12125550199",
"duration": 45.5,
"billable_duration": 46.0,
"status": "completed",
"disconnect_reason": "hangup",
"ai_latency": 450
}
],
"total": 1540
}
GET /calls/{id}
Retrieve granular details including turn-by-turn analysis. Returns the same structure as a single item in the list response, but with additional metadata.
Analytics
Retrieve aggregated performance metrics.
GET /analytics/overview
Get a health snapshot of your traffic.
Query Parameters
| Parameter | Default | Description |
|---|---|---|
| hours | 24 | Lookback window in hours |
Response Attributes
| Field | Type | Description |
|---|---|---|
active_calls |
integer | Number of currently live calls |
volume |
array | Time-series data of call volume |
latency_stats |
object | P50 and P95 latency metrics (ms) |
{
"active_calls": 5,
"volume": [
{ "time": "10:00", "count": 120 }
],
"latency_stats": {
"p50": 120,
"p95": 450
}
}