Skip to content

Commit 937db9a

Browse files
authored
Merge branch 'main' into sri/add-mcp-server-docs
2 parents 4a48272 + d5144a9 commit 937db9a

21 files changed

+816
-95
lines changed

fern/advanced/sip/sip-telnyx.mdx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ To allow Vapi.ai to make outbound calls through your Telnyx account:
5050
1. **Set Up Outbound Authentication**
5151
- Go to Voice / SIP Trunking / Authentication and routing
5252
- Scroll down to "Outbound calls authentication"
53-
- Whitelist Vapi's SIP server IPs:
54-
- **44.229.228.186**
55-
- **44.238.177.138**
56-
- Select Tech Prefix and create a new credential for Vapi to use
53+
- Create a new credential for Vapi to use
5754
<Frame>
5855
<img src="../../static/images/sip/telynx-outbound-auth.png" />
5956
</Frame>
@@ -153,4 +150,4 @@ curl --location 'https://api.vapi.ai/call/phone' \
153150

154151
Replace all placeholder values with your actual information.
155152

156-
By following these steps, your Telnyx SIP trunk will be fully integrated with Vapi.ai, allowing your AI voice assistants to manage calls effectively.
153+
By following these steps, your Telnyx SIP trunk will be fully integrated with Vapi.ai, allowing your AI voice assistants to manage calls effectively.

fern/apis/api/openapi.json

Lines changed: 431 additions & 80 deletions
Large diffs are not rendered by default.

fern/calls/websocket-transport.mdx

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
---
2+
title: WebSocket Transport
3+
description: Stream audio directly via WebSockets for real-time, bidirectional communication
4+
slug: calls/websocket-transport
5+
---
6+
7+
# WebSocket Transport
8+
9+
Vapi's WebSocket transport enables real-time, bidirectional audio communication directly between your application and Vapi's AI assistants. Unlike traditional phone or web calls, this transport method lets you stream raw audio data instantly with minimal latency.
10+
11+
## Key Benefits
12+
13+
- **Low Latency**: Direct streaming ensures minimal delays.
14+
- **Bidirectional Streaming**: Real-time audio flow in both directions.
15+
- **Easy Integration**: Compatible with any environment supporting WebSockets.
16+
- **Flexible Audio Formats**: Customize audio parameters such as sample rate.
17+
- **Automatic Sample Rate Conversion**: Seamlessly handles various audio rates.
18+
19+
## Creating a WebSocket Call
20+
21+
To initiate a call using WebSocket transport:
22+
23+
```bash
24+
curl 'https://api.vapi.ai/call' \
25+
-H 'authorization: Bearer YOUR_API_KEY' \
26+
-H 'content-type: application/json' \
27+
--data-raw '{
28+
"assistant": { "assistantId": "YOUR_ASSISTANT_ID" },
29+
"transport": {
30+
"provider": "vapi.websocket",
31+
"audioFormat": {
32+
"format": "pcm_s16le",
33+
"container": "raw",
34+
"sampleRate": 16000
35+
}
36+
}
37+
}'
38+
```
39+
40+
### Sample API Response
41+
42+
```json
43+
{
44+
"id": "7420f27a-30fd-4f49-a995-5549ae7cc00d",
45+
"assistantId": "5b0a4a08-133c-4146-9315-0984f8c6be80",
46+
"type": "vapi.websocketCall",
47+
"createdAt": "2024-09-10T11:14:12.339Z",
48+
"updatedAt": "2024-09-10T11:14:12.339Z",
49+
"orgId": "eb166faa-7145-46ef-8044-589b47ae3b56",
50+
"cost": 0,
51+
"status": "queued",
52+
"transport": {
53+
"provider": "vapi.websocket",
54+
"websocketCallUrl": "wss://api.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/transport"
55+
}
56+
}
57+
```
58+
59+
## Audio Format Configuration
60+
61+
When creating a WebSocket call, the audio format can be customized:
62+
63+
| Parameter | Description | Default |
64+
|-------------|-------------------------|---------------------|
65+
| `format` | Audio encoding format | `pcm_s16le` (16-bit PCM) |
66+
| `container` | Audio container format | `raw` (Raw PCM) |
67+
| `sampleRate`| Sample rate in Hz | `16000` (16kHz) |
68+
69+
Currently, Vapi supports only raw PCM (`pcm_s16le` with `raw` container). Additional formats may be supported in future updates.
70+
71+
<Note>
72+
Vapi automatically converts sample rates as needed. You can stream audio at 8kHz, 44.1kHz, etc., and Vapi will handle conversions seamlessly.
73+
</Note>
74+
75+
## Connecting to the WebSocket
76+
77+
Use the WebSocket URL from the response to establish a connection:
78+
79+
```javascript
80+
const socket = new WebSocket("wss://api.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/transport");
81+
82+
socket.onopen = () => console.log("WebSocket connection opened.");
83+
socket.onclose = () => console.log("WebSocket connection closed.");
84+
socket.onerror = (error) => console.error("WebSocket error:", error);
85+
```
86+
87+
## Sending and Receiving Data
88+
89+
The WebSocket supports two types of messages:
90+
91+
- **Binary audio data** (PCM, 16-bit signed little-endian)
92+
- **Text-based JSON control messages**
93+
94+
### Sending Audio Data
95+
96+
```javascript
97+
function sendAudioChunk(audioBuffer) {
98+
if (socket.readyState === WebSocket.OPEN) {
99+
socket.send(audioBuffer);
100+
}
101+
}
102+
103+
navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {
104+
const audioContext = new AudioContext();
105+
const source = audioContext.createMediaStreamSource(stream);
106+
const processor = audioContext.createScriptProcessor(1024, 1, 1);
107+
108+
processor.onaudioprocess = (event) => {
109+
const pcmData = event.inputBuffer.getChannelData(0);
110+
const int16Data = new Int16Array(pcmData.length);
111+
112+
for (let i = 0; i < pcmData.length; i++) {
113+
int16Data[i] = Math.max(-32768, Math.min(32767, pcmData[i] * 32768));
114+
}
115+
116+
sendAudioChunk(int16Data.buffer);
117+
};
118+
119+
source.connect(processor);
120+
processor.connect(audioContext.destination);
121+
});
122+
```
123+
124+
### Receiving Data
125+
126+
```javascript
127+
socket.onmessage = (event) => {
128+
if (event.data instanceof Blob) {
129+
event.data.arrayBuffer().then(buffer => {
130+
const audioData = new Int16Array(buffer);
131+
playAudio(audioData);
132+
});
133+
} else {
134+
try {
135+
const message = JSON.parse(event.data);
136+
handleControlMessage(message);
137+
} catch (error) {
138+
console.error("Failed to parse message:", error);
139+
}
140+
}
141+
};
142+
```
143+
144+
### Sending Control Messages
145+
146+
```javascript
147+
function sendControlMessage(messageObj) {
148+
if (socket.readyState === WebSocket.OPEN) {
149+
socket.send(JSON.stringify(messageObj));
150+
}
151+
}
152+
153+
// Example: hangup call
154+
function hangupCall() {
155+
sendControlMessage({ type: "hangup" });
156+
}
157+
```
158+
159+
## Ending the Call
160+
161+
To gracefully end the WebSocket call:
162+
163+
```javascript
164+
sendControlMessage({ type: "hangup" });
165+
socket.close();
166+
```
167+
168+
## Comparison: WebSocket Transport vs. Call Listen Feature
169+
170+
Vapi provides two WebSocket options:
171+
172+
| WebSocket Transport | Call Listen Feature |
173+
|-------------------------------------|------------------------------------|
174+
| Primary communication method | Secondary, monitoring-only channel |
175+
| Bidirectional audio streaming | Unidirectional (listen-only) |
176+
| Replaces phone/web as transport | Supplements existing calls |
177+
| Uses `provider: "vapi.websocket"` | Accessed via `monitor.listenUrl` |
178+
179+
Refer to [Live Call Control](/calls/call-features) for more on the Call Listen feature.
180+
181+
<Warning>
182+
When using WebSocket transport, phone-based parameters (`phoneNumber` or `phoneNumberId`) are not permitted. These methods are mutually exclusive.
183+
</Warning>
184+

fern/changelog/2025-03-20.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
1. **Integration with Google Calendar**: You can now create and manage Google Calendar events directly within your tools. Configure OAuth2 credentials through the [dashboard > Build > Provider Keys](https://dashboard.vapi.ai/keys#:~:text=Google%20Calendar) to authenticate and interact with Google Calendar APIs.
44

55
<Frame caption="Google Calendar Integration">
6-
<img src="../static/images/changelog/google-calendar-integration.png" alt="Google Calendar Integration" />
6+
<img src="../static/images/changelog/google-calendar-tool.png" alt="Google Calendar Integration" />
77
</Frame>
88

99
2. **Enhanced Voice Customization for RimeAIVoice**: Gain more control over [Rime AI voice](https://api.vapi.ai/api#:~:text=RimeAIVoice) properties with new options like `reduceLatency`, `inlineSpeedAlpha`, `pauseBetweenBrackets`, and `phonemizeBetweenBrackets`. These settings let you optimize voice streaming and adjust speech delivery to better suit your assistant's needs.

fern/changelog/2025-03-28.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
1. **New Slack and Google Calendar Tools Added**: You can now use the built-in [Slack tool](https://docs.vapi.ai/tools/slack) to send messages and use the [Google Calendar tool](https://docs.vapi.ai/tools/google-calendar) to check calendar availability directly from your assistant, with full CRUD operations available via the [`/tool` API endpoint](https://docs.vapi.ai/api-reference/tools/list). You can authenticate the [Slack tool](https://dashboard.vapi.ai/keys#:~:text=Slack) and the [Google Calendar tool](https://dashboard.vapi.ai/keys#:~:text=Google%20Calendar) using OAuth2 from the [Vapi provider keys page](https://dashboard.vapi.ai/keys).
2+
3+
<Frame caption="Slack Tool">
4+
<img src="../static/images/changelog/slack-tool.png" alt="Slack Tool" />
5+
</Frame>
6+
7+
<Frame caption="Google Calendar Tool">
8+
<img src="../static/images/changelog/google-calendar-tool.png" alt="Google Calendar Tool" />
9+
</Frame>
10+
11+
2. **Select LLM Model in Workflow Nodes**: You can now select and update which LLM model you want to use within workflow nodes, allowing more precise control over the assistant's behavior in different workflow nodes and easier configuration updates.
12+
13+
4. **Enhanced Call Monitoring and Reporting**: We've improved call monitoring with conversation turn tracking, millisecond-precision timestamps, and provided more detailed call end reasons. These enhancements make it easier to track conversation flow, perform precise time calculations, and diagnose specific call termination issues like server overloads or database errors.
14+
15+
5. **Enable Background Denoising**: You can now filter out background noise during calls by setting `Assistant.backgroundDenoisingEnabled` to `true`.

fern/changelog/2025-03-30.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
1. **TestSuiteRunTestAttempt now accepts `callId` and `metadata`**: You can now include a `callId` and `metadata` when creating a test suite run attempt, allowing you to reference calls by ID and attach session-related information.
2+
3+
2. **`call` property in [TestSuiteRunTestAttempt](https://api.vapi.ai/api#:~:text=TestSuiteRunTestAttemptMetadata) is no longer required**: It's now optional to include the full `call` object in a test attempt, providing flexibility for cases where call details are unnecessary or already known.
4+
5+
3. **Attach Metadata to Test Suite Run Attempts**: You can now attach [metadata](https://api.vapi.ai/api#:~:text=TestSuiteRunTestAttemptMetadata) like `sessionId` to test attempts for better tracking and analysis.

fern/changelog/2025-04-03.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
1. **Introducing `SmsSendTool` for SMS messaging support**: You can now create and manage tools of type `sms` using the new [SMS Send Tool](https://api.vapi.ai/api#:~:text=SmsSendTool), allowing you to send SMS messages via defined servers. The `sms` tool type is also now recognized in API endpoints, ensuring that SMS send tools are correctly processed during CRUD operations.
2+
3+
2. **New configuration options for voice and transcriber settings**: The `autoMode` property has been added to [Eleven Labs Voice Settings](https://api.vapi.ai/api#:~:text=ElevenLabsVoice), letting developers control automatic voice settings. Additionally, `confidenceThreshold` has been introduced in transcriber settings, allowing developers to set thresholds to discard low-confidence transcriptions and improve accuracy.
4+
5+
3. **Enhanced speed control in `CartesiaExperimentalControls`**: The `speed` property now accepts both predefined speeds (`'slowest'`, `'slow'`, `'normal'`, `'fast'`, `'fastest'`) and numeric values between -1 and 1. This gives you more precise control over speed settings for better customization.

fern/changelog/2025-04-04.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1. **Addition of `assistantId` to `TargetPlan` settings**: You can now specify an `assistantId` when testing [target plans](https://api.vapi.ai/api#:~:text=TargetPlan), allowing you to test scenarios involving specific assistants directly.

fern/changelog/2025-04-05.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
1. **Introducing `SmsSendTool` for SMS messaging support**: You can now create and send `sms` text messages using the new `[Send Text`](https://api.vapi.ai/api#:~:text=SmsSendTool) tool, enabling assistants to send SMS messages via defined servers.
2+
3+
<Frame caption="Send SMS with 'Send Text' tool">
4+
<img src="../static/images/changelog/send-text-tool.png" alt="SmsSendTool" />
5+
</Frame>
6+
7+
2. **[Eleven Labs Voice](https://api.vapi.ai/api#:~:text=ElevenLabsVoice) Auto Mode and Confidence Threshold configuration options**: When using [`Eleven Labs Voice`](https://api.vapi.ai/api#:~:text=ElevenLabsVoice) in your Assistant, you can now configure `autoMode` (default: false) to automatically manage manage chunking strategies for long texts; Eleven Labs automatically determines the best way to process and generate audio, optimizing for latency and efficiency. Additionally, `confidenceThreshold` has been introduced in transcriber schemas, allowing developers to set thresholds to discard low-confidence transcriptions and improve accuracy.
8+
9+
3. **Changes to `CartesiaExperimentalControls` Speed property**: The `speed` property now accepts both predefined speeds (`'slowest'`, `'slow'`, `'normal'`, `'fast'`, `'fastest'`) and numeric values between -1 and 1. This simplifies the process of controlling the speed of the generated audio with Cartesia.

fern/changelog/2025-04-08.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
1. **Simplified `transport` property in `Call` configuration**: You should now configure the `transport` property in [`Call`](https://api.vapi.ai/api#:~:text=Call) as an object when creating or updating a [`Call`](https://api.vapi.ai/api#:~:text=Call), since the separate `Transport` schema has been deprecated. This simplification makes it easier to work with transport details without referencing a separate transport configuration.
2+
3+
<Warning>
4+
The `Transport` schema is now deprecated and will be removed in a future release.
5+
</Warning>
6+
7+
2. **New call type `vapi.websocketCall`**: You can now make [phone calls over WebSockets](https://docs.vapi.ai/calls/websocket-transport) with Vapi. The `Call` schema now supports a new `type` value: `vapi.websocketCall`.

fern/changelog/2025-04-11.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
1. **Updated AI Edge Condition with Prompt**: When defining an AI edge condition, the `matches` property has been renamed to `prompt`. The `prompt` allows you to provide a natural language condition (up to 1000 characters) that guides AI decision-making in workflows.
2+
3+
<Frame caption="Updated AI Edge Condition with Prompt">
4+
<img src="../static/images/changelog/ai-edge-condition-prompt.png" alt="AI Edge Condition with Prompt" />
5+
</Frame>
6+
7+
2. **Assistant Overrides per Customer**: You can now customize assistant settings for individual customers using `assistantOverrides` when [creating customers](https://api.vapi.ai/api#:~:text=CreateCustomerDTO). This enables personalized assistant interactions for each customer in batch calls.
8+
9+
3. **New Call Ended Reasons**: New error codes have been added to `endedReason` enums, providing more detailed insights into call terminations related to providers like Anthropic Bedrock and Vertex. This helps in better error handling and debugging of call issues.

fern/changelog/2025-04-12.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
1. **Expanded Voice Selection for Assistant Voices**: You can now specify any valid `voiceId` for assistant voices without being limited to a predefined list. This provides greater flexibility to use different voices in `Assistant.voice`, and related configurations.

fern/changelog/2025-04-15.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
1. **New GPT-4.1 Models Available**: You can now use `'gpt-4.1'`, `'gpt-4.1-mini'`, and `'gpt-4.1-nano'` as options for the `model` and `fallbackModels` with your [OpenAI models](https://api.vapi.ai/api#:~:text=OpenAIModel). These models may offer improved performance or features over previous versions.
2+
3+
<Frame caption="New GPT-4.1 Models Available">
4+
<img src="../static/images/changelog/gpt-4.1-models.png" alt="New GPT-4.1 Models Available" />
5+
</Frame>

fern/docs.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ navigation:
364364
path: calls/call-handling-with-vapi-and-twilio.mdx
365365
- page: Voicemail Detection
366366
path: calls/voicemail-detection.mdx
367+
- page: WebSocket Transport
368+
path: calls/websocket-transport.mdx
367369

368370
- section: SDKs
369371
path: sdks.mdx
@@ -457,19 +459,21 @@ navigation:
457459
path: enterprise/plans.mdx
458460
- page: On-Prem Deployments
459461
path: enterprise/onprem.mdx
460-
- page: HIPAA Compliance
461-
path: security-and-privacy/hipaa.mdx
462-
- page: PCI Compliance
463-
path: security-and-privacy/PCI.mdx
464-
- link: SOC-2 Compliance
465-
href: https://security.vapi.ai/
466-
467462
- page: Glossary
468463
path: glossary.mdx
469-
470464
- page: RSS Feed
471465
path: rss-feed.mdx
472-
466+
- section: Security and Privacy
467+
collapsed: true
468+
contents:
469+
- page: GDPR Compliance
470+
path: security-and-privacy/GDPR.mdx
471+
- page: HIPAA Compliance
472+
path: security-and-privacy/hipaa.mdx
473+
- page: PCI Compliance
474+
path: security-and-privacy/PCI.mdx
475+
- link: SOC-2 Compliance
476+
href: https://security.vapi.ai/
473477
- section: Legal
474478
collapsed: true
475479
contents:

0 commit comments

Comments
 (0)