### Go SDK Example Source: https://docs.vapi.ai/api-reference/chats/get Example of how to use the Vapi Go SDK to get a chat. ```go package example import ( context "context" serversdkgo "github.com/VapiAI/server-sdk-go" client "github.com/VapiAI/server-sdk-go/client" option "github.com/VapiAI/server-sdk-go/option" ) func do() { client := client.NewClient( option.WithToken( "YOUR_TOKEN_HERE", ), ) request := &serversdkgo.GetChatsRequest{ Id: "id", } client.Chats.Get( context.TODO(), request, ) } ``` -------------------------------- ### Create Chat Configuration Example Source: https://docs.vapi.ai/api-reference/chats/create This example demonstrates the full configuration object for creating a chat, including artifact, start speaking, stop speaking, monitor, and server plans, along with credential IDs. ```json { "artifactPlan": { "recordingEnabled": true, "recordingFormat": "wav;l16", "recordingUseCustomStorageEnabled": true, "videoRecordingEnabled": false, "fullMessageHistoryEnabled": false, "pcapEnabled": true, "pcapS3PathPrefix": "/pcaps", "pcapUseCustomStorageEnabled": true, "loggingEnabled": true, "loggingUseCustomStorageEnabled": true, "transcriptPlan": { "enabled": true, "assistantName": "string", "userName": "string" }, "recordingPath": "string", "structuredOutputIds": [ "string" ], "structuredOutputs": [ { "type": "ai", "regex": "string", "model": { "provider": "openai", "model": "gpt-5.4", "temperature": 1.1, "maxTokens": 5030 }, "compliancePlan": { "forceStoreOnHipaaEnabled": false }, "name": "string", "schema": { "type": "string", "items": {}, "properties": {}, "description": "string", "pattern": "string", "format": "date-time", "required": [ "string" ], "enum": [ "string" ], "title": "string" }, "description": "string", "assistantIds": [ "string" ], "workflowIds": [ "string" ] } ], "scorecardIds": [ "string" ], "scorecards": [ { "name": "string", "description": "string", "metrics": [ { "structuredOutputId": "string", "conditions": [ {} ] } ], "assistantIds": [ "string" ] } ], "loggingPath": "string" }, "startSpeakingPlan": { "waitSeconds": 0.4, "smartEndpointingEnabled": false, "smartEndpointingPlan": { "provider": "vapi" }, "customEndpointingRules": [ { "type": "assistant", "regex": "string", "regexOptions": [ { "type": "ignore-case", "enabled": true } ], "timeoutSeconds": 1.1 } ], "transcriptionEndpointingPlan": { "onPunctuationSeconds": 0.1, "onNoPunctuationSeconds": 1.5, "onNumberSeconds": 0.5 } }, "stopSpeakingPlan": { "numWords": 0, "voiceSeconds": 0.2, "backoffSeconds": 1, "acknowledgementPhrases": [ "i understand", "i see", "i got it", "i hear you", "im listening", "im with you", "right", "okay", "ok", "sure", "alright", "got it", "understood", "yeah", "yes", "uh-huh", "mm-hmm", "gotcha", "mhmm", "ah", "yeah okay", "yeah sure" ], "interruptionPhrases": [ "stop", "shut", "up", "enough", "quiet", "silence", "but", "dont", "not", "no", "hold", "wait", "cut", "pause", "nope", "nah", "nevermind", "never", "bad", "actually" ] }, "monitorPlan": { "listenEnabled": false, "listenAuthenticationEnabled": false, "controlEnabled": false, "controlAuthenticationEnabled": false, "monitorIds": [ "123e4567-e89b-12d3-a456-426614174000" ] }, "credentialIds": [ "string" ], "server": { "timeoutSeconds": 20, "credentialId": "550e8400-e29b-41d4-a716-446655440000" } } ``` -------------------------------- ### Python SDK Example Source: https://docs.vapi.ai/api-reference/chats/get Example of how to use the Vapi Python SDK to get a chat. ```python from vapi import Vapi client = Vapi( token="YOUR_TOKEN_HERE", ) client.chats.get( id="id", ) ``` -------------------------------- ### List Assistants API Request Example Source: https://docs.vapi.ai/api-reference/assistants/list This example demonstrates how to make a GET request to the List Assistants API endpoint. It shows the basic structure of the request, including any necessary headers or parameters. ```bash curl -X GET \ "https://api.vapi.ai/assistants" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### List All Assistants Source: https://docs.vapi.ai/api-reference/assistants/list This example demonstrates how to fetch a list of all assistants configured in your Vapi account. It uses a simple GET request to the /assistants endpoint. ```javascript const vapi = new Vapi("YOUR_API_KEY"); async function listAssistants() { try { const assistants = await vapi.assistants.list(); console.log(assistants); } catch (error) { console.error("Error listing assistants:", error); } } listAssistants(); ``` -------------------------------- ### Get File using Vapi Go SDK Source: https://docs.vapi.ai/api-reference/files/get This Go code example shows how to fetch file details using the Vapi server SDK. It requires setting up the client with your API token and constructing the request object. ```go package example import ( context "context" serversdkgo "github.com/VapiAI/server-sdk-go" client "github.com/VapiAI/server-sdk-go/client" option "github.com/VapiAI/server-sdk-go/option" ) func do() { client := client.NewClient( option.WithToken( "YOUR_TOKEN_HERE", ), ) request := &serversdkgo.GetFilesRequest{ Id: "id", } client.Files.Get( context.TODO(), request, ) } ``` -------------------------------- ### Go SDK Example for Fetching a Single Insight Source: https://docs.vapi.ai/api-reference/insight/insight-controller-find-one This Go code demonstrates how to initialize the Vapi client with your token and call the InsightControllerFindOne method to get a specific insight. Remember to replace 'YOUR_TOKEN_HERE' with your valid API token. ```go package example import ( context "context" serversdkgo "github.com/VapiAI/server-sdk-go" client "github.com/VapiAI/server-sdk-go/client" option "github.com/VapiAI/server-sdk-go/option" ) func do() { client := client.NewClient( option.WithToken( "YOUR_TOKEN_HERE", ), ) request := &serversdkgo.InsightControllerFindOneRequest{ Id: "id", } client.Insight.InsightControllerFindOne( context.TODO(), request, ) } ``` -------------------------------- ### List Files using Vapi Go SDK Source: https://docs.vapi.ai/api-reference/files/list This Go code example shows how to set up the Vapi client with your API token and then invoke the list files function. Remember to substitute 'YOUR_TOKEN_HERE' with your valid API token. ```go package example import ( context "context" client "github.com/VapiAI/server-sdk-go/client" option "github.com/VapiAI/server-sdk-go/option" ) func do() { client := client.NewClient( option.WithToken( "YOUR_TOKEN_HERE", ), ) client.Files.List( context.TODO(), ) } ``` -------------------------------- ### Rejection Plan Examples Source: https://docs.vapi.ai/api-reference/chats/create Examples demonstrating how to configure rejection plans for tool calls based on various conditions. ```json { conditions: [{ type: 'regex', regex: '(?i)\b(bye|goodbye|farewell|see you later|take care)\b', target: { position: -1, role: 'user' }, negate: true // Reject if pattern does NOT match }] } ``` ```json { conditions: [{ type: 'regex', regex: '\\?', target: { position: -1, role: 'user' } }] } ``` ```json { conditions: [{ type: 'liquid', liquid: `{% assign recentMessages = messages | last: 5 %} {% assign userMessages = recentMessages | where: 'role', 'user' %} {% assign mentioned = false %} {% for msg in userMessages %} {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} {% assign mentioned = true %} {% break %} {% endif %} {% endfor %} {% if mentioned %} false {% else %} true {% endif %}` }] } ``` ```json { conditions: [{ type: 'liquid', liquid: `{% assign recentMessages = messages | last: 6 %} {% assign userMessages = recentMessages | where: 'role', 'user' | \ reverse %} ``` -------------------------------- ### Eval Controller Get Response Example Source: https://docs.vapi.ai/api-reference/eval/eval-controller-get The response from the Eval Controller Get API includes conversation details, IDs, timestamps, and evaluation metadata. ```json { "messages": [ { "role": "assistant", "content": "Welcome to the verified user flow. How can I assist you today?", "toolCalls": [ { "name": "verify_user_status", "arguments": { "userId": "12345" } } ] } ], "id": "a3f1c9e2-7b4d-4f8a-9c3e-2d5f6b7a8c9d", "orgId": "org_987654321", "createdAt": "2024-01-15T09:30:00Z", "updatedAt": "2024-01-15T09:30:00Z", "type": "chat.mockConversation", "name": "Verified User Flow Eval", "description": "This eval checks if the user flow is verified." } ``` -------------------------------- ### Get Chat Response Example Source: https://docs.vapi.ai/api-reference/chats/get This example demonstrates the structure of the JSON response when successfully retrieving a chat conversation. It includes details about the chat, the associated assistant, and its configuration. ```APIDOC ## GET /chats/{chatId} ### Description Retrieves a specific chat conversation by its ID. ### Method GET ### Endpoint `/chats/{chatId}` ### Parameters #### Path Parameters - **chatId** (string) - Required - The unique identifier of the chat to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the chat. - **orgId** (string) - The unique identifier of the organization. - **createdAt** (string) - The timestamp when the chat was created (ISO 8601 format). - **updatedAt** (string) - The timestamp when the chat was last updated (ISO 8601 format). - **assistantId** (string) - The unique identifier of the assistant used in the chat. - **assistant** (object) - Configuration details of the assistant. - **transcriber** (object) - Configuration for the speech-to-text transcriber. - **model** (object) - Configuration for the language model. - **toolIds** (array) - List of tool IDs used by the assistant. - **knowledgeBase** (object) - Configuration for the knowledge base. #### Response Example ```json { "id": "string", "orgId": "string", "createdAt": "2024-01-15T09:30:00Z", "updatedAt": "2024-01-15T09:30:00Z", "assistantId": "string", "assistant": { "transcriber": { "provider": "assembly-ai", "language": "multi", "confidenceThreshold": 0.4, "formatTurns": true, "endOfTurnConfidenceThreshold": 0.7, "minEndOfTurnSilenceWhenConfident": 160, "wordFinalizationMaxWaitTime": 160, "maxTurnSilence": 400, "vadAssistedEndpointingEnabled": true, "speechModel": "universal-streaming-english", "realtimeUrl": "string", "wordBoost": [ "string" ], "keytermsPrompt": [ "string" ], "endUtteranceSilenceThreshold": 1.1, "disablePartialTranscripts": true, "fallbackPlan": { "transcribers": [ { "provider": "assembly-ai", "language": "multi", "confidenceThreshold": 0.4, "formatTurns": true, "endOfTurnConfidenceThreshold": 0.7, "minEndOfTurnSilenceWhenConfident": 160, "wordFinalizationMaxWaitTime": 160, "maxTurnSilence": 400, "vadAssistedEndpointingEnabled": true, "speechModel": "universal-streaming-english", "realtimeUrl": "string", "wordBoost": [ "string" ], "keytermsPrompt": [ "string" ], "endUtteranceSilenceThreshold": 1.1, "disablePartialTranscripts": true } ] } }, "model": { "messages": [ { "content": "string", "role": "assistant" } ], "tools": [ { "messages": [ { "contents": [ { "type": "text", "text": "string", "language": "aa" } ], "type": "request-start", "blocking": false, "content": "string", "conditions": [ { "operator": "eq", "param": "string", "value": "string" } ] } ], "type": "apiRequest", "method": "POST", "timeoutSeconds": 20, "credentialId": "550e8400-e29b-41d4-a716-446655440000", "encryptedPaths": [ "string" ], "parameters": [ { "key": "string", "value": {} } ], "name": "string", "description": "string", "url": "string", "body": { "type": "string", "items": {}, "properties": {}, "description": "string", "pattern": "string", "format": "date-time", "required": [ "string" ], "enum": [ "string" ], "title": "string" }, "headers": { "type": "string", "items": {}, "properties": {}, "description": "string", "pattern": "string", "format": "date-time", "required": [ "string" ], "enum": [ "string" ], "title": "string" }, "backoffPlan": { "type": "fixed", "maxRetries": 0, "baseDelaySeconds": 1, "excludedStatusCodes": [ 400, 401, 403, 404 ] }, "variableExtractionPlan": { "schema": { "type": "string", "items": {}, "properties": {}, "description": "string", "pattern": "string", "format": "date-time", "required": [ "string" ], "enum": [ "string" ], "title": "string" }, "aliases": [ { "key": "string", "value": "string" } ] }, "rejectionPlan": { "conditions": [ { "type": "regex", "regex": "\\b(cancel|stop|wait)\\b - Matches whole words" } ] } } ], "toolIds": [ "string" ], "knowledgeBase": { "provider": "custom-knowledge-base", "server": { "timeoutSeconds": 20, "credentialId": "550e8400-e29b-41d4-a716-446655440000", "staticIpAddressesEnabled": false, "encryptedPaths": [ "string" ], "url": "string" } } } } } ``` ``` -------------------------------- ### Create Assistant using Go SDK Source: https://docs.vapi.ai/api-reference/assistants/create This example demonstrates how to create an assistant using the Vapi Go SDK. Replace 'YOUR_TOKEN_HERE' with your actual API token. ```APIDOC ## Create Assistant ### Description Creates a new assistant with the specified configuration. ### Method POST ### Endpoint /assistants ### Request Body - **name** (string) - Required - The name of the assistant. - **model** (object) - Optional - Configuration for the AI model. - **provider** (string) - Optional - The AI model provider (e.g., 'openai'). - **model** (string) - Optional - The specific model to use (e.g., 'gpt-5.4'). - **temperature** (number) - Optional - Controls the randomness of the model's output. - **maxTokens** (integer) - Optional - The maximum number of tokens the model can generate. - **description** (string) - Optional - A description of the assistant. - **assistantIds** (array of strings) - Optional - IDs of other assistants to include. - **workflowIds** (array of strings) - Optional - IDs of workflows to associate with the assistant. - **scorecardIds** (array of strings) - Optional - IDs of scorecards to use for evaluation. - **scorecards** (array of objects) - Optional - Detailed scorecard configurations. - **name** (string) - Required - The name of the scorecard. - **description** (string) - Optional - A description of the scorecard. - **assistantIds** (array of strings) - Optional - IDs of assistants associated with this scorecard. - **metrics** (array of objects) - Required - Metrics to evaluate. - **structuredOutputId** (string) - Required - ID for structured output. - **conditions** (array of objects) - Optional - Conditions for the metric. - **loggingPath** (string) - Optional - Path for logging. - **startSpeakingPlan** (object) - Optional - Configuration for starting speech. - **waitSeconds** (number) - Optional - Seconds to wait before speaking. - **smartEndpointingPlan** (object) - Optional - Plan for smart endpointing. - **provider** (string) - Optional - The provider for smart endpointing. - **customEndpointingRules** (array of objects) - Optional - Custom rules for endpointing. - **type** (string) - Required - Type of rule. - **regex** (string) - Optional - Regular expression for matching. - **regexOptions** (array of objects) - Optional - Options for the regex. - **type** (string) - Required - Type of regex option. - **enabled** (boolean) - Required - Whether the option is enabled. - **timeoutSeconds** (number) - Optional - Timeout for the rule. - **transcriptionEndpointingPlan** (object) - Optional - Plan for transcription endpointing. - **onPunctuationSeconds** (number) - Optional - Seconds to wait after punctuation. - **onNoPunctuationSeconds** (number) - Optional - Seconds to wait with no punctuation. - **onNumberSeconds** (number) - Optional - Seconds to wait for numbers. - **smartEndpointingEnabled** (boolean) - Optional - Whether smart endpointing is enabled. - **stopSpeakingPlan** (object) - Optional - Configuration for stopping speech. - **numWords** (integer) - Optional - Number of words to trigger stop. - **voiceSeconds** (number) - Optional - Seconds of voice to trigger stop. - **backoffSeconds** (integer) - Optional - Seconds to back off before stopping. - **acknowledgementPhrases** (array of strings) - Optional - Phrases that acknowledge input. - **interruptionPhrases** (array of strings) - Optional - Phrases that interrupt speech. - **monitorPlan** (object) - Optional - Configuration for monitoring. - **listenEnabled** (boolean) - Optional - Whether listening is enabled. - **listenAuthenticationEnabled** (boolean) - Optional - Whether listening authentication is enabled. - **controlEnabled** (boolean) - Optional - Whether control is enabled. - **controlAuthenticationEnabled** (boolean) - Optional - Whether control authentication is enabled. - **monitorIds** (array of strings) - Optional - IDs of monitors. - **credentialIds** (array of strings) - Optional - IDs of credentials. - **server** (object) - Optional - Server configuration. - **timeoutSeconds** (integer) - Optional - Server timeout in seconds. - **credentialId** (string) - Optional - ID of the credential. - **staticIpAddressesEnabled** (boolean) - Optional - Whether static IP addresses are enabled. - **encryptedPaths** (array of strings) - Optional - Paths to encrypt. - **url** (string) - Optional - The server URL. - **headers** (object) - Optional - Custom headers. - **backoffPlan** (object) - Optional - Backoff strategy for retries. - **type** (string) - Optional - Type of backoff (e.g., 'fixed'). - **maxRetries** (integer) - Optional - Maximum number of retries. - **baseDelaySeconds** (number) - Optional - Base delay in seconds. - **excludedStatusCodes** (array of integers) - Optional - Status codes to exclude from backoff. - **keypadInputPlan** (object) - Optional - Configuration for keypad input. - **enabled** (boolean) - Optional - Whether keypad input is enabled. - **timeoutSeconds** (number) - Optional - Timeout for keypad input. - **delimiters** (string) - Optional - Delimiters for keypad input. ### Request Example ```go { "name": "My Assistant", "model": { "provider": "openai", "model": "gpt-5.4", "temperature": 1.1, "maxTokens": 5030 }, "description": "An example assistant.", "assistantIds": ["assistant-123"], "workflowIds": ["workflow-abc"], "scorecardIds": ["scorecard-xyz"], "scorecards": [ { "name": "Call Quality", "metrics": [ { "structuredOutputId": "output-1", "conditions": [] } ] } ], "loggingPath": "/var/log/vapi/assistant.log", "startSpeakingPlan": { "waitSeconds": 0.4, "smartEndpointingPlan": { "provider": "vapi" }, "customEndpointingRules": [ { "type": "assistant", "regex": ".*", "regexOptions": [ { "type": "ignore-case", "enabled": true } ], "timeoutSeconds": 1.1 } ], "transcriptionEndpointingPlan": { "onPunctuationSeconds": 0.1, "onNoPunctuationSeconds": 1.5, "onNumberSeconds": 0.5 }, "smartEndpointingEnabled": false }, "stopSpeakingPlan": { "numWords": 0, "voiceSeconds": 0.2, "backoffSeconds": 1, "acknowledgementPhrases": [ "i understand", "i see" ], "interruptionPhrases": [ "stop", "shut" ] }, "monitorPlan": { "listenEnabled": false, "listenAuthenticationEnabled": false, "controlEnabled": false, "controlAuthenticationEnabled": false, "monitorIds": ["123e4567-e89b-12d3-a456-426614174000"] }, "credentialIds": ["credential-456"], "server": { "timeoutSeconds": 20, "credentialId": "550e8400-e29b-41d4-a716-446655440000", "staticIpAddressesEnabled": false, "encryptedPaths": ["/secure/data"], "url": "https://api.example.com", "headers": {"X-Custom-Header": "value"}, "backoffPlan": { "type": "fixed", "maxRetries": 3, "baseDelaySeconds": 1, "excludedStatusCodes": [400, 401, 403, 404] } }, "keypadInputPlan": { "enabled": true, "timeoutSeconds": 1.1, "delimiters": "#" } } ``` ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier of the created assistant. - **name** (string) - The name of the assistant. - **model** (object) - Configuration for the AI model. - **description** (string) - A description of the assistant. - **assistantIds** (array of strings) - IDs of other assistants included. - **workflowIds** (array of strings) - IDs of associated workflows. - **scorecardIds** (array of strings) - IDs of associated scorecards. - **scorecards** (array of objects) - Detailed scorecard configurations. - **loggingPath** (string) - Path for logging. - **startSpeakingPlan** (object) - Configuration for starting speech. - **stopSpeakingPlan** (object) - Configuration for stopping speech. - **monitorPlan** (object) - Configuration for monitoring. - **credentialIds** (array of strings) - IDs of credentials. - **server** (object) - Server configuration. - **keypadInputPlan** (object) - Configuration for keypad input. #### Response Example ```json { "id": "asst_abc123", "name": "My Assistant", "model": { "provider": "openai", "model": "gpt-5.4", "temperature": 1.1, "maxTokens": 5030 }, "description": "An example assistant.", "assistantIds": ["assistant-123"], "workflowIds": ["workflow-abc"], "scorecardIds": ["scorecard-xyz"], "scorecards": [ { "name": "Call Quality", "metrics": [ { "structuredOutputId": "output-1", "conditions": [] } ] } ], "loggingPath": "/var/log/vapi/assistant.log", "startSpeakingPlan": { "waitSeconds": 0.4, "smartEndpointingPlan": { "provider": "vapi" }, "customEndpointingRules": [ { "type": "assistant", "regex": ".*", "regexOptions": [ { "type": "ignore-case", "enabled": true } ], "timeoutSeconds": 1.1 } ], "transcriptionEndpointingPlan": { "onPunctuationSeconds": 0.1, "onNoPunctuationSeconds": 1.5, "onNumberSeconds": 0.5 }, "smartEndpointingEnabled": false }, "stopSpeakingPlan": { "numWords": 0, "voiceSeconds": 0.2, "backoffSeconds": 1, "acknowledgementPhrases": [ "i understand", "i see" ], "interruptionPhrases": [ "stop", "shut" ] }, "monitorPlan": { "listenEnabled": false, "listenAuthenticationEnabled": false, "controlEnabled": false, "controlAuthenticationEnabled": false, "monitorIds": ["123e4567-e89b-12d3-a456-426614174000"] }, "credentialIds": ["credential-456"], "server": { "timeoutSeconds": 20, "credentialId": "550e8400-e29b-41d4-a716-446655440000", "staticIpAddressesEnabled": false, "encryptedPaths": ["/secure/data"], "url": "https://api.example.com", "headers": {"X-Custom-Header": "value"}, "backoffPlan": { "type": "fixed", "maxRetries": 3, "baseDelaySeconds": 1, "excludedStatusCodes": [400, 401, 403, 404] } }, "keypadInputPlan": { "enabled": true, "timeoutSeconds": 1.1, "delimiters": "#" } } ``` ``` -------------------------------- ### Voice Configuration Example Source: https://docs.vapi.ai/api-reference/chats/get This example demonstrates the configuration for voice settings, including caching, provider, voice ID, chunking, formatting, and fallback voice options. ```json "voice": { "cachingEnabled": true, "provider": "azure", "voiceId": "andrew", "chunkPlan": { "enabled": true, "minCharacters": 30, "punctuationBoundaries": "。", "formatPlan": { "enabled": true, "numberToDigitsCutoff": 2025, "replacements": [ { "type": "exact", "replaceAllEnabled": false, "key": "string", "value": "string" } ], "formattersEnabled": "markdown" } }, "speed": 1.1, "fallbackPlan": { "voices": [ { "cachingEnabled": true, "provider": "azure", "voiceId": "andrew", "speed": 1.1, "chunkPlan": { "enabled": true, "minCharacters": 30, "punctuationBoundaries": "。", "formatPlan": { "enabled": true, "numberToDigitsCutoff": 2025, "replacements": {}, "formattersEnabled": {} } }, "oneOf": null } ] } } ``` -------------------------------- ### Example JSON Response for Get Runs Paginated Source: https://docs.vapi.ai/api-reference/eval/eval-controller-get-runs-paginated This JSON structure represents a typical response from the Get Runs Paginated endpoint, detailing the status, end reason, and target configuration of an evaluation run. ```json { "results": [ { "status": "running", "endedReason": "mockConversation.done", "target": { "assistant": { "transcriber": { "provider": "assembly-ai", "language": "multi", "confidenceThreshold": 0.4, "formatTurns": true, "endOfTurnConfidenceThreshold": 0.7, "minEndOfTurnSilenceWhenConfident": 160, "wordFinalizationMaxWaitTime": 160, "maxTurnSilence": 400, "vadAssistedEndpointingEnabled": true, "speechModel": "universal-streaming-english", "realtimeUrl": "string", "wordBoost": [ "string" ], "keytermsPrompt": [ "string" ], "endUtteranceSilenceThreshold": 1.1, "disablePartialTranscripts": true, "fallbackPlan": { "transcribers": [ { "provider": "assembly-ai", "language": "multi", "confidenceThreshold": 0.4, "formatTurns": true, "endOfTurnConfidenceThreshold": 0.7, "minEndOfTurnSilenceWhenConfident": 160, "wordFinalizationMaxWaitTime": 160, "maxTurnSilence": 400, "vadAssistedEndpointingEnabled": true, "speechModel": "universal-streaming-english", "realtimeUrl": "string", "wordBoost": [ "string" ], "keytermsPrompt": [ "string" ], "endUtteranceSilenceThreshold": 1.1, "disablePartialTranscripts": true } ] } }, "model": { "messages": [ { "content": "string", "role": "assistant" } ], "tools": [ { "messages": [ { "contents": [ {} ], "type": "request-start", "blocking": false, "content": "string", "conditions": [ { "operator": {}, "param": {}, "value": {} } ] } ], "type": "apiRequest", "method": "POST", "timeoutSeconds": 20, "credentialId": "550e8400-e29b-41d4-a716-446655440000", "encryptedPaths": [ "string" ], "parameters": [ { "key": "string", "value": {} } ], "name": "string", "description": "string", "url": "string", "body": { "type": "string", "items": {}, "properties": {}, "description": "string", "pattern": "string", "format": "date-time", "required": [ "string" ], "enum": [ "string" ], "title": "string" }, "headers": { "type": "string", "items": {}, "properties": {}, "description": "string", "pattern": "string", "format": "date-time", "required": [ "string" ], "enum": [ "string" ], "title": "string" }, "backoffPlan": { "type": "fixed", "maxRetries": 0, "baseDelaySeconds": 1, "excludedStatusCodes": [ 400, 401, 403, 404 ] }, "variableExtractionPlan": { "schema": {}, "aliases": [ { "key": {}, "value": {} } ] }, "rejectionPlan": { "conditions": [ "[{ type: \"regex\", regex: \"(?i)\\b(cancel|stop)\\b\", target: { role: \"user\" } }]" ] } } ], "toolIds": [ "string" ], "knowledgeBase": { ``` -------------------------------- ### LLM Configuration Example Source: https://docs.vapi.ai/api-reference/chats/get Demonstrates the structure for configuring an LLM, including messages, tools, knowledge base, and voice settings. ```json { "minEndOfTurnSilenceWhenConfident": 160, "wordFinalizationMaxWaitTime": 160, "maxTurnSilence": 400, "vadAssistedEndpointingEnabled": true, "speechModel": "universal-streaming-english", "realtimeUrl": "string", "wordBoost": [ "string" ], "keytermsPrompt": [ "string" ], "endUtteranceSilenceThreshold": 1.1, "disablePartialTranscripts": true } ] } }, "model": { "messages": [ { "content": "string", "role": "assistant" } ], "tools": [ { "messages": [ { "contents": [ { "type": "text", "text": "string", "language": "aa" } ], "type": "request-start", "blocking": false, "content": "string", "conditions": [ { "operator": "eq", "param": "string", "value": "string" } ] } ], "type": "apiRequest", "method": "POST", "timeoutSeconds": 20, "credentialId": "550e8400-e29b-41d4-a716-446655440000", "encryptedPaths": [ "string" ], "parameters": [ { "key": "string", "value": {} } ], "name": "string", "description": "string", "url": "string", "body": { "type": "string", "items": {}, "properties": {}, "description": "string", "pattern": "string", "format": "date-time", "required": [ "string" ], "enum": [ "string" ], "title": "string" }, "headers": { "type": "string", "items": {}, "properties": {}, "description": "string", "pattern": "string", "format": "date-time", "required": [ "string" ], "enum": [ "string" ], "title": "string" }, "backoffPlan": { "type": "fixed", "maxRetries": 0, "baseDelaySeconds": 1, "excludedStatusCodes": [ 400, 401, 403, 404 ] }, "variableExtractionPlan": { "schema": { "type": "string", "items": {}, "properties": {}, "description": "string", "pattern": "string", "format": "date-time", "required": [ "string" ], "enum": [ "string" ], "title": "string" }, "aliases": [ { "key": "string", "value": "string" } ] }, "rejectionPlan": { "conditions": [ { "type": "regex", "regex": "\\b(cancel|stop|wait)\\b - Matches whole words" } ] } } ], "toolIds": [ "string" ], "knowledgeBase": { "provider": "custom-knowledge-base", "server": { "timeoutSeconds": 20, "credentialId": "550e8400-e29b-41d4-a716-446655440000", "staticIpAddressesEnabled": false, "encryptedPaths": [ "string" ], "url": "string", "headers": {}, "backoffPlan": { "type": "fixed", "maxRetries": 0, "baseDelaySeconds": 1, "excludedStatusCodes": [ 400, 401, 403, 404 ] } } }, "model": "claude-3-opus-20240229", "provider": "anthropic", "thinking": { "type": "enabled", "budgetTokens": 50500 }, "temperature": 1.1, "maxTokens": 5030, "emotionRecognitionEnabled": true, "numFastTurns": 1.1 }, "voice": { "cachingEnabled": true, "provider": "azure", "voiceId": "andrew", "chunkPlan": { "enabled": true, "minCharacters": 30, "punctuationBoundaries": "。", "formatPlan": { "enabled": true, "numberToDigitsCutoff": 2025, "replacements": [ { "type": "exact", "replaceAllEnabled": false, "key": "string", "value": "string" } ] } } } } ``` -------------------------------- ### Get Calls with Filters Source: https://docs.vapi.ai/api-reference/calls/get This example demonstrates how to retrieve calls, filtering by a specific date range and agent. ```APIDOC ## GET /calls ### Description Retrieves a list of calls based on the provided filters. ### Method GET ### Endpoint /calls ### Parameters #### Query Parameters - **startDate** (string) - Required - The start date for filtering calls (YYYY-MM-DD). - **endDate** (string) - Required - The end date for filtering calls (YYYY-MM-DD). - **agentId** (string) - Optional - The ID of the agent to filter calls by. - **status** (string) - Optional - The status of the calls to filter by (e.g., 'completed', 'in_progress', 'failed'). ### Response #### Success Response (200) - **calls** (array) - A list of call objects matching the filter criteria. - **callId** (string) - The unique identifier for the call. - **agentId** (string) - The ID of the agent handling the call. - **startTime** (string) - The timestamp when the call started. - **endTime** (string) - The timestamp when the call ended. - **status** (string) - The status of the call. #### Response Example ```json { "calls": [ { "callId": "call_123", "agentId": "agent_abc", "startTime": "2023-10-26T10:00:00Z", "endTime": "2023-10-26T10:05:00Z", "status": "completed" }, { "callId": "call_456", "agentId": "agent_abc", "startTime": "2023-10-26T11:00:00Z", "endTime": "2023-10-26T11:10:00Z", "status": "completed" } ] } ``` ``` -------------------------------- ### Observability Configuration Example Source: https://docs.vapi.ai/api-reference/eval/eval-controller-get-runs-paginated Configuration for Langfuse observability with prompt and trace details. ```json { "provider": "langfuse", "promptName": "string", "promptVersion": 1.1, "traceName": "string", "tags": [ "string" ], "metadata": {} } ``` -------------------------------- ### Credentials Configuration Example Source: https://docs.vapi.ai/api-reference/calls/list Sets up credentials for different AI providers, including API keys and names. ```json { "credentials": [ { "provider": "anthropic", "apiKey": "string", "name": "string" } ] } ```