ChatEvalAssistantMessageMockToolCall.
+ us-west and eu-west options for reduced latency and compliance.
+ /logs endpoint usage with call artifacts, monitoring plans, and end-of-call reports for comprehensive logging.
+ knowledgeBaseId references.
+
+ **Important**: You must explicitly instruct your assistant in its system prompt about when to use the query tool. The knowledge base description alone is not sufficient for the assistant to know when to search.
+
+
+Add clear instructions to your assistant's system messages, **explicitly naming the tool**:
```json
-"description": "Use this knowledge base when the user asks about pricing, subscription plans, or billing information"
+{
+ "role": "system",
+ "content": "You are a helpful customer support assistant. When users ask about products, pricing, features, or need troubleshooting help, use the 'knowledge-search' tool to search our knowledge base for accurate information. Always call the knowledge-search tool before providing answers to ensure accuracy."
+}
```
+
+
+
+## Best Practices
+
+- **Operating Point** – Select the **Enhanced** model for the best accuracy in real-time voice agents.
+- **Region** – Choose the region closest to your users to optimize latency.
+- **Custom Vocabulary** – Use this feature to add key terms (e.g., product names) and leverage the *Sounds Like* option for tricky pronunciations.
diff --git a/fern/providers/voice/vapi-voices.mdx b/fern/providers/voice/vapi-voices.mdx
index 2c20f9a99..2efc78db7 100644
--- a/fern/providers/voice/vapi-voices.mdx
+++ b/fern/providers/voice/vapi-voices.mdx
@@ -4,6 +4,10 @@ subtitle: Our curated selection of high-quality voices
slug: providers/voice/vapi-voices
---
+assistantId or a minimal assistant, then enrich context asynchronously after the call starts using Live Call Control.
+ - Host your webhook close to us-west-2 to reduce latency, and target < ~6s to allow for network jitter.
+assistantId, assistant, squadId, and squad are ignored.
+ You must still respond within 7.5 seconds.
+ To transfer silently, set destination.message to an empty string.
+ For caller ID behavior, see Call features.
+
+
+
+You can create different types of authentication credentials:
+
+- **Bearer Token**: Simple token-based authentication
+- **OAuth 2.0**: OAuth 2.0 client credentials flow
+- **HMAC**: HMAC signature-based authentication
+
+## Authentication Types
+
+### Bearer Token Authentication
+
+The most common authentication method using a bearer token in the Authorization header.
+
+
+
+
+#### Standard Authorization Header
+
+The most common Bearer Token configuration uses the standard `Authorization` header with the Bearer prefix:
+
+
+
+
+### OAuth 2.0 Authentication
+
+For OAuth 2.0 protected endpoints, configure client credentials flow with automatic token refresh.
+
+
+
+
+#### OAuth 2.0 Flow
+
+1. Vapi makes a token request to your OAuth endpoint with client credentials
+2. Your server validates the credentials and returns an access token
+3. Vapi includes the access token in the Authorization header for webhook requests
+4. When tokens expire, Vapi automatically requests new ones
-The simplest way to authenticate webhook requests is using a secret token. Vapi will include this token in the `X-Vapi-Signature` header of each request.
+#### Token Response Format
-#### Configuration
+Your OAuth server should return:
```json
+{
+ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
+ "token_type": "Bearer",
+ "expires_in": 3600
+}
+```
+
+### HMAC Authentication
+
+For maximum security, use HMAC signature-based authentication to verify request integrity.
+
+
+
+
+## Using Credentials
+
+### In Assistant Configuration
+
+Reference credentials in your assistant's server configuration:
+
+
+
+
+### In Phone Number Configuration
+
+Assign credentials to phone numbers for incoming call authentication:
+
+
+
-For OAuth2-protected webhook endpoints, you can configure OAuth2 credentials that Vapi will use to obtain and refresh access tokens.
+### In Tool Configuration
-#### Configuration (at the assistant-level)
+Secure your function tool endpoints with credentials:
-```json
+
+
+
+### Best Practices
+
+
-
+## Common Use Cases
-#### OAuth2 Flow
+### Single Credential for Multiple Resources
-1. Vapi makes a request to your token endpoint with client credentials (Content-Type `application/x-www-form-urlencoded`)
-2. Your server validates the credentials and returns an access token
-3. Vapi includes the access token in the Authorization header for webhook requests
-4. Your server validates the access token before processing the webhook
-5. When the token expires, Vapi automatically requests a new one
+Reuse the same credential across different components:
+
+
+
+
+
+
+ Your credential is now ready to use with encrypted tool arguments.
+
+
+
+
+
+
+ tool-calls messages that your frontend can handle.
+model.tools array and subscribe to clientMessages: ['tool-calls'].
+3. Listen for message.type === 'tool-calls' and perform the desired UI update. No response is sent back to the model.
+4. (Optional) Inject context mid-call using vapi.addMessage(...).
+
+## Complete example (React + Web SDK)
+
+```tsx
+import Vapi from '@vapi-ai/web';
+import { useCallback, useState } from 'react';
+
+const vapi = new Vapi('+ Start a call and ask the assistant to trigger UI updates +
+ +addMessage to provide extra context mid-call. This does not return results for a tool; it adds messages the model can see.
+
+```ts
+// Inject system-level context
+vapi.addMessage({
+ role: 'system',
+ content: 'Context: userId=123, plan=premium, theme=dark',
+});
+
+// Inject a user message
+vapi.addMessage({
+ role: 'user',
+ content: 'FYI: I switched to the settings tab.',
+});
+```
+
+clientMessages: ['tool-calls'] and handle message.type === 'tool-calls'.
+- **Add context**: Use vapi.addMessage to inject data mid-call.
+
+## Next steps
+
+- **Server-based tools**: Learn how to return results back to the model with Custom Tools.
+- **API reference**: See Tools API for full configuration options.
diff --git a/fern/tools/code-tool.mdx b/fern/tools/code-tool.mdx
new file mode 100644
index 000000000..5bc4c397f
--- /dev/null
+++ b/fern/tools/code-tool.mdx
@@ -0,0 +1,281 @@
+---
+title: Code Tool
+subtitle: Execute custom TypeScript code directly within your assistant without setting up a server.
+slug: tools/code-tool
+---
+
+The Code Tool allows you to write and execute custom TypeScript code that runs when your assistant needs to perform a specific action. Unlike custom function tools that require you to host a server, code tools run directly on Vapi's infrastructure.
+
+## When to Use Code Tools
+
+Code tools are ideal when you need to:
+- Transform or process data during a conversation
+- Make HTTP requests to external APIs
+- Perform calculations or business logic
+- Avoid the overhead of setting up and maintaining a webhook server
+
+## Creating a Code Tool
+
+Create code tools using the [Vapi API](/api-reference/tools/create). Each code tool requires:
+
+- **Tool Name**: A descriptive identifier (e.g., `get_customer_data`)
+- **Description**: Explain what your tool does - this helps the AI understand when to use it
+- **TypeScript Code**: Write the code that will execute when the tool is called
+- **Parameters**: Define the input parameters your code expects
+- **Environment Variables**: Store sensitive values like API keys securely
+
+### Writing Your Code
+
+Your code has access to two objects:
+- **`args`**: Contains the parameters passed by the assistant
+- **`env`**: Contains your environment variables
+
+```typescript
+// Access parameters from the assistant
+const { customerId, orderType } = args;
+
+// Access secure environment variables
+const { API_KEY, API_URL } = env;
+
+// Make HTTP requests to external services
+const response = await fetch(`${API_URL}/customers/${customerId}`, {
+ headers: {
+ 'Authorization': `Bearer ${API_KEY}`,
+ 'Content-Type': 'application/json'
+ }
+});
+
+const customer = await response.json();
+
+// Return data to the assistant
+return {
+ name: customer.name,
+ email: customer.email,
+ memberSince: customer.createdAt
+};
+```
+
+
+