├── .DS_Store ├── .vscode └── settings.json ├── GHL.mdx ├── README.md ├── advanced └── calls │ └── sip.mdx ├── api-reference ├── analytics │ └── create-analytics-queries.mdx ├── assistants │ ├── create-assistant.mdx │ ├── delete-assistant.mdx │ ├── get-assistant.mdx │ ├── list-assistants.mdx │ └── update-assistant.mdx ├── call-logs │ └── list-call-logs.mdx ├── calls │ ├── create-call.mdx │ ├── create-phone-call.mdx │ ├── delete-call-data.mdx │ ├── delete-call.mdx │ ├── get-call.mdx │ ├── list-calls.mdx │ └── update-call.mdx ├── credentials │ ├── create-credential.mdx │ ├── delete-credential.mdx │ ├── get-credential.mdx │ ├── list-credentials.mdx │ └── update-credential.mdx ├── files │ ├── delete-file.mdx │ ├── get-file.mdx │ ├── list-files.mdx │ ├── update-file.mdx │ └── upload-file.mdx ├── logs │ └── list-logs.mdx ├── messages │ ├── client-inbound-message.mdx │ ├── client-message.mdx │ ├── server-message-response.mdx │ └── server-message.mdx ├── metrics │ └── list-metrics.mdx ├── openapi.mdx ├── orgs │ ├── create-org.mdx │ ├── get-org.mdx │ ├── invite-user.mdx │ ├── leave-org.mdx │ ├── list-orgs.mdx │ ├── list-users.mdx │ └── update-org.mdx ├── phone-numbers │ ├── buy-phone-number.mdx │ ├── create-phone-number.mdx │ ├── delete-phone-number.mdx │ ├── get-phone-number.mdx │ ├── import-twilio-number.mdx │ ├── import-vonage-number.mdx │ ├── list-phone-numbers.mdx │ └── update-phone-number.mdx ├── providers │ ├── add-shared-voice-to-your-provider-account.mdx │ ├── get--locations.mdx │ ├── get--voicessearch.mdx │ ├── get--workflows-hooks.mdx │ └── get--workflows.mdx ├── squads │ ├── create-squad.mdx │ ├── delete-squad.mdx │ ├── get-squad.mdx │ ├── list-squads.mdx │ └── update-squad.mdx ├── swagger.mdx ├── tools │ ├── create-tool.mdx │ ├── delete-tool.mdx │ ├── get-tool.mdx │ ├── list-tools.mdx │ └── update-tool.mdx └── voice-library │ ├── get-voices-in-voice-library-by-providers.mdx │ ├── sync-global-voices-in-voice-library-by-providers.mdx │ └── sync-voices-in-voice-library-by-providers.mdx ├── api.json ├── assistants.mdx ├── assistants ├── background-messages.mdx ├── call-analysis.mdx ├── dynamic-variables.mdx ├── function-calling.mdx └── persistent-assistants.mdx ├── audio-interface.mdx ├── billing ├── billing-limits.mdx ├── cost-routing.mdx ├── estimating-costs.mdx └── examples.mdx ├── blocks.mdx ├── blocks ├── block-types.mdx ├── create-blocks-tutorial.mdx └── steps.mdx ├── call-forwarding.mdx ├── calls ├── call-ended-reason.mdx └── call-features.mdx ├── challenges-of-realtime-conversation.mdx ├── changelog.mdx ├── community ├── appointment-scheduling.mdx ├── assistant-request.mdx ├── community.css ├── comparisons.mdx ├── conferences.mdx ├── demos.mdx ├── expert-directory.mdx ├── ghl.mdx ├── guide.mdx ├── inbound.mdx ├── knowledgebase.mdx ├── myvapi.mdx ├── outbound.mdx ├── podcast.mdx ├── snippets-sdks-tutorials.mdx ├── special-mentions.mdx ├── squads.mdx ├── television.mdx ├── tools-calling.mdx └── usecase.mdx ├── customization ├── custom-keywords.mdx ├── custom-llm │ ├── fine-tuned-openai-models.mdx │ └── using-your-server.mdx ├── custom-voices │ ├── custom-voice.mdx │ ├── elevenlabs.mdx │ └── playht.mdx ├── jwt-authentication.mdx ├── knowledgebase.mdx ├── multilingual.mdx ├── provider-keys.mdx └── speech-configuration.mdx ├── enterprise ├── onprem.mdx └── plans.mdx ├── examples ├── inbound-support.mdx ├── outbound-call-python.mdx ├── outbound-sales.mdx ├── pizza-website.mdx └── voice-widget.mdx ├── faq.mdx ├── glossary.mdx ├── how-vapi-works.mdx ├── introduction.mdx ├── knowledgebase.mdx ├── mint.json ├── phone-calling.mdx ├── pricing.mdx ├── prompting-guide.mdx ├── providers ├── model │ ├── anthropic.mdx │ ├── deepinfra.mdx │ ├── groq.mdx │ ├── openai.mdx │ ├── openrouter.mdx │ ├── perplexity.mdx │ └── togetherai.mdx ├── transcriber │ ├── deepgram.mdx │ ├── gladia.mdx │ └── talkscriber.mdx ├── voice │ ├── azure.mdx │ ├── cartesia.mdx │ ├── deepgram.mdx │ ├── elevenlabs.mdx │ ├── imnt.mdx │ ├── neets.mdx │ ├── openai.mdx │ ├── playht.mdx │ └── rimeai.mdx └── voiceflow.mdx ├── quickstart.mdx ├── quickstart ├── dashboard.mdx ├── phone │ ├── inbound.mdx │ └── outbound.mdx └── web.mdx ├── resources.mdx ├── script.js ├── sdk └── web.mdx ├── sdks.mdx ├── security-and-privacy ├── hipaa.mdx ├── privacy-policy.mdx ├── soc.mdx └── tos.mdx ├── server-url.mdx ├── server-url ├── developing-locally.mdx ├── events.mdx ├── securing-endpoints.mdx ├── setting-server-urls.mdx └── url-priority.mdx ├── snippets ├── faq-snippet.mdx ├── quickstart │ ├── dashboard │ │ ├── assistant-setup-inbound.mdx │ │ └── provision-phone-number-with-vapi.mdx │ ├── phone │ │ └── get-a-phone-number.mdx │ ├── platform-specific │ │ └── no-code-prerequisites.mdx │ └── web │ │ └── links.mdx ├── sdk.mdx ├── sdks │ └── web │ │ ├── import-web-sdk.mdx │ │ └── install-web-sdk.mdx └── video │ ├── video.css │ └── videos.mdx ├── squads-example.mdx ├── squads.mdx ├── static └── images │ ├── .DS_Store │ ├── blocks │ ├── food-order-steps.png │ ├── recording_20241018_191621.webm │ └── screenshots_run_20241018_191537 │ │ ├── click_flow_controls_button.png │ │ ├── click_flow_controls_button_again.png │ │ ├── click_save_inside_step_config.png │ │ ├── click_save_inside_tool_call_block_config.png │ │ ├── clicking_on_block_config.png │ │ ├── clicking_on_blocks.png │ │ ├── clicking_on_create_workflow.png │ │ ├── clicking_on_new_blocks_workflow.png │ │ ├── clicking_on_platform.png │ │ ├── clicking_on_save_inside_conversation_block_config.png │ │ ├── clicking_on_save_inside_step_config_start_block.png │ │ ├── clicking_on_schedule_demo_quantstruct.png │ │ ├── clicking_on_step_config_inside_start_block.png │ │ ├── enter_prompt_inside_schedule_demo_time_block_config.png │ │ ├── entering_workflow_name_schedule_demo_quantstruct.png │ │ ├── insert_date_time_schedule_variable.png │ │ ├── navigate_to_vapi_dashboard.png │ │ ├── replace_text_inside_start_block_with_prompt_for_good_time_to_talk.png │ │ └── replace_text_inside_textarea_with_new_text.png │ ├── changelog │ ├── credit-based-billing-oct-10.png │ ├── invite-multiple-users.png │ ├── organization-settings-page.png │ ├── subscription-coupon-codes.png │ └── tavus-voice.png │ ├── favicon.png │ ├── intro │ └── custom-vs-vapi.png │ ├── learn │ ├── billing │ │ ├── billing-example-template.png │ │ ├── billing-limits-exceeded.png │ │ ├── billing-limits.png │ │ ├── call-pricing-breakdown.png │ │ ├── cost-estimate.gif │ │ ├── cost-routing.png │ │ ├── custom-model-inbound-phone-example.png │ │ ├── outbound-phone-example.png │ │ └── web-interviews-example.png │ └── platform │ │ └── vapi-orchestration.png │ ├── logo │ ├── logo-dark.png │ └── logo-light.png │ ├── pricing │ └── voice-pipeline-cost-breakdown.png │ ├── quickstart │ ├── assistant-id-dashboard.png │ ├── dashboard │ │ ├── assistant-created.png │ │ ├── assistant-model-set-up.png │ │ ├── assistant-transcriber-config.png │ │ ├── assistant-voice-config.png │ │ ├── auth-ui.png │ │ ├── buy-a-phone-number.png │ │ ├── buy-phone-number-modal.png │ │ ├── call-assistant-web-dashboard.png │ │ ├── choose-blank-template.png │ │ ├── create-new-assistant-button.png │ │ ├── inbound-assistant-set.png │ │ ├── model-provider-keys.png │ │ ├── name-your-assistant.png │ │ ├── phone-number-config.png │ │ ├── transcriber-providers-keys.png │ │ ├── vapi-dashboard-post-signup.png │ │ └── voice-provider-keys.png │ ├── phone │ │ ├── buy-phone-number-twilio.png │ │ ├── dashboard-import-phone-number.png │ │ ├── import-twilio-number-dashboard.png │ │ ├── outbound │ │ │ ├── assistant-model-setup.png │ │ │ └── dial-outbound-call-dashboard.png │ │ ├── phone-number-import-complete.png │ │ ├── set-billing-information.png │ │ ├── twilio-api-key-nav.png │ │ └── twilio-credentials.png │ ├── quickstart-banner.png │ ├── vapis-pizzeria.png │ └── web │ │ └── microphone-permissions.png │ └── server-url │ ├── developing-locally │ ├── logging-events-locally.png │ ├── ngrok-cli-ui.png │ └── reverse-proxy-developing-locally.png │ ├── overview-graphic.png │ └── settings-server-urls │ ├── assistant-server-url-dashboard.png │ ├── function-call-server-url-dashboard.png │ ├── org-settings-server-urls.png │ ├── server-url-priority.png │ └── setting-account-server-url.png ├── status.mdx ├── support.mdx └── tools-calling.mdx /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VapiAI/docs-archived/76238b8eabc00ffcbe0bd8744f826615878b8b58/.DS_Store -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": ["openapi", "vonage"] 3 | } 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Vapi Docs 2 | 3 | ### Setup 4 | 5 | `npm install -g mintlify` 6 | 7 | ### Development 8 | 9 | `mintlify dev` 10 | 11 | 12 | ### Errors 13 | 14 | If you encounter an issue try setting "openapi" value from "https://api.vapi.ai/api-json" to "./api.json" in mint.json -------------------------------------------------------------------------------- /advanced/calls/sip.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "SIP" 3 | sidebarTitle: "SIP" 4 | description: "You can make SIP calls to Vapi Assistants." 5 | --- 6 | 7 | 8 | 9 | ## 1. Create an Assistant 10 | 11 | We'll create an assistant with `POST /assistant` endpoint. This is no different than creating an assistant for other transports. 12 | 13 | ```json 14 | { 15 | "name": "My SIP Assistant", 16 | "firstMessage": "Hello {{first_name}}, you've reached me over SIP. How can I help you today?" 17 | } 18 | 19 | ``` 20 | 21 | 22 | 23 | 24 | 25 | ## 2. Create A SIP Phone Number 26 | 27 | We'll create a SIP phone number with `POST /phone-number` endpoint. 28 | 29 | ```json 30 | { 31 | "provider": "vapi", 32 | "sipUri": "sip:your_unique_user_name@sip.vapi.ai", 33 | "assistantId": "your_assistant_id" 34 | } 35 | 36 | ``` 37 | 38 | `sipUri` is the SIP URI of the phone number. It must be in the format `sip:username@sip.vapi.ai`. You are free to choose any username you like. 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | ## 3. Start a SIP call. 47 | 48 | You can use any SIP softphone to test the Assistant. Examples include [Zoiper](https://www.zoiper.com/) or [Linphone](https://www.linphone.org/). 49 | 50 | You just need to dial `sip:your_unique_user_name@sip.vapi.ai` and the Assistant will answer your call. 51 | 52 | There is no authentication or SIP registration required. 53 | 54 | 55 | 56 | 57 | 58 | ## 4. Send SIP Headers to Fill Template Variables. 59 | 60 | To fill your template variables, you can send custom SIP headers. 61 | 62 | For example, to fill the `first_name` variable, you can send a SIP header `x-first_name: John`. 63 | 64 | The header name is case insensitive. So, `X-First_Name`, `x-first_name`, and `X-FIRST_NAME` are all the same. 65 | 66 | 67 | 68 | 69 | 70 | ## 5. Use a Custom Assistant For Each Call. 71 | 72 | You can use a custom assistant for SIP calls same as phone calls. 73 | 74 | Set the `assistantId` to `null` and the `serverUrl` to the URL of your server which will respond to the `assistant-request`. 75 | 76 | `PATCH /phone-number/:id` 77 | ```json 78 | { 79 | "assistantId": null, 80 | "serverUrl": "https://your_server_url" 81 | } 82 | ``` 83 | 84 | Now, every time you make a call to this phone number, the server will receive a `assistant-request` event. 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /api-reference/analytics/create-analytics-queries.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /analytics 3 | --- -------------------------------------------------------------------------------- /api-reference/assistants/create-assistant.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /assistant 3 | --- -------------------------------------------------------------------------------- /api-reference/assistants/delete-assistant.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: delete /assistant/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/assistants/get-assistant.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /assistant/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/assistants/list-assistants.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /assistant 3 | --- -------------------------------------------------------------------------------- /api-reference/assistants/update-assistant.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: patch /assistant/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/call-logs/list-call-logs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /log 3 | --- -------------------------------------------------------------------------------- /api-reference/calls/create-call.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /call 3 | --- -------------------------------------------------------------------------------- /api-reference/calls/create-phone-call.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /call/phone 3 | --- -------------------------------------------------------------------------------- /api-reference/calls/delete-call-data.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: delete /call/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/calls/delete-call.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: delete /call/phone 3 | --- -------------------------------------------------------------------------------- /api-reference/calls/get-call.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /call/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/calls/list-calls.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /call 3 | --- -------------------------------------------------------------------------------- /api-reference/calls/update-call.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: patch /call/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/credentials/create-credential.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /credential 3 | --- -------------------------------------------------------------------------------- /api-reference/credentials/delete-credential.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: delete /credential/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/credentials/get-credential.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /credential/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/credentials/list-credentials.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /credential 3 | --- -------------------------------------------------------------------------------- /api-reference/credentials/update-credential.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: put /credential/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/files/delete-file.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: delete /file/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/files/get-file.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /file/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/files/list-files.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /file 3 | --- -------------------------------------------------------------------------------- /api-reference/files/update-file.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: patch /file/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/files/upload-file.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /file 3 | --- -------------------------------------------------------------------------------- /api-reference/logs/list-logs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /log 3 | --- -------------------------------------------------------------------------------- /api-reference/messages/client-inbound-message.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: ClientInboundMessage 3 | openapi-schema: ClientInboundMessage 4 | --- -------------------------------------------------------------------------------- /api-reference/messages/client-message.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: ClientMessage 3 | openapi-schema: ClientMessage 4 | --- -------------------------------------------------------------------------------- /api-reference/messages/server-message-response.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: ServerMessageResponse 3 | openapi-schema: ServerMessageResponse 4 | --- -------------------------------------------------------------------------------- /api-reference/messages/server-message.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: ServerMessage 3 | openapi-schema: ServerMessage 4 | --- -------------------------------------------------------------------------------- /api-reference/metrics/list-metrics.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /metrics 3 | --- -------------------------------------------------------------------------------- /api-reference/openapi.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "OpenAPI" 3 | url: "https://api.vapi.ai/api-json" 4 | --- 5 | 6 | 7 | Our OpenAPI is hosted at 8 | [https://api.vapi.ai/api-json](https://api.vapi.ai/api-json) 9 | 10 | -------------------------------------------------------------------------------- /api-reference/orgs/create-org.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /org 3 | --- -------------------------------------------------------------------------------- /api-reference/orgs/get-org.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /org/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/orgs/invite-user.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /org/{id}/invite 3 | --- -------------------------------------------------------------------------------- /api-reference/orgs/leave-org.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: delete /org/{id}/leave 3 | --- -------------------------------------------------------------------------------- /api-reference/orgs/list-orgs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /org 3 | --- -------------------------------------------------------------------------------- /api-reference/orgs/list-users.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /org/{id}/user 3 | --- -------------------------------------------------------------------------------- /api-reference/orgs/update-org.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: patch /org/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/phone-numbers/buy-phone-number.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /phone-number/buy 3 | --- -------------------------------------------------------------------------------- /api-reference/phone-numbers/create-phone-number.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /phone-number 3 | --- -------------------------------------------------------------------------------- /api-reference/phone-numbers/delete-phone-number.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: delete /phone-number/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/phone-numbers/get-phone-number.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /phone-number/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/phone-numbers/import-twilio-number.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /phone-number/import/twilio 3 | --- -------------------------------------------------------------------------------- /api-reference/phone-numbers/import-vonage-number.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /phone-number/import/vonage 3 | --- -------------------------------------------------------------------------------- /api-reference/phone-numbers/list-phone-numbers.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /phone-number 3 | --- -------------------------------------------------------------------------------- /api-reference/phone-numbers/update-phone-number.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: patch /phone-number/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/providers/add-shared-voice-to-your-provider-account.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /{provider}/voices/add 3 | --- -------------------------------------------------------------------------------- /api-reference/providers/get--locations.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /{provider}/locations 3 | --- -------------------------------------------------------------------------------- /api-reference/providers/get--voicessearch.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /{provider}/voices/search 3 | --- -------------------------------------------------------------------------------- /api-reference/providers/get--workflows-hooks.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /{provider}/workflows/{workflowId}/hooks 3 | --- -------------------------------------------------------------------------------- /api-reference/providers/get--workflows.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /{provider}/workflows 3 | --- -------------------------------------------------------------------------------- /api-reference/squads/create-squad.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /squad 3 | --- -------------------------------------------------------------------------------- /api-reference/squads/delete-squad.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: delete /squad/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/squads/get-squad.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /squad/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/squads/list-squads.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /squad 3 | --- -------------------------------------------------------------------------------- /api-reference/squads/update-squad.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: patch /squad/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/swagger.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Swagger" 3 | url: "https://api.vapi.ai/api" 4 | --- 5 | 6 | 7 | Our Swagger is hosted at [https://api.vapi.ai/api](https://api.vapi.ai/api) 8 | 9 | -------------------------------------------------------------------------------- /api-reference/tools/create-tool.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /tool 3 | --- -------------------------------------------------------------------------------- /api-reference/tools/delete-tool.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: delete /tool/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/tools/get-tool.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /tool/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/tools/list-tools.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /tool 3 | --- -------------------------------------------------------------------------------- /api-reference/tools/update-tool.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: patch /tool/{id} 3 | --- -------------------------------------------------------------------------------- /api-reference/voice-library/get-voices-in-voice-library-by-providers.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: get /voice-library/{provider} 3 | --- -------------------------------------------------------------------------------- /api-reference/voice-library/sync-global-voices-in-voice-library-by-providers.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /voice-library/sync 3 | --- -------------------------------------------------------------------------------- /api-reference/voice-library/sync-voices-in-voice-library-by-providers.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: post /voice-library/sync/{provider} 3 | --- -------------------------------------------------------------------------------- /assistants.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Introduction" 3 | sidebarTitle: "Introduction" 4 | description: "The core building-block of voice agents on Vapi." 5 | --- 6 | 7 | **Assistant** is a fancy word for an AI configuration that can be used across phone calls and Vapi clients. Your voice assistant can augment your customer support and experience for call centers, business websites, mobile apps, and much more. 8 | 9 | There are three core components: **Transcriber**, **Model**, and **Voice**. These can be configured, mixed, and matched for your use case.
There are also various other configurable properties you can find [here](/api-reference/assistants/create-assistant) Below, check out some ways you can layer in powerful customizations and features to meet any use case. 10 | 11 | ## Advanced Concepts 12 | 13 | 14 | 15 | Add your API keys for other providers 16 | 17 | 18 | Plug in your own LLM 19 | 20 | 21 | Forward and hang up with function calls 22 | 23 | 28 | Which setup is best for you? 29 | 30 | 31 | -------------------------------------------------------------------------------- /assistants/background-messages.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Background Messaging" 3 | sidebarTitle: "Background Messages" 4 | description: "Vapi SDK lets you silently update the chat history through efficient text message integration. This is particularly useful for background tasks or discreetly logging user interactions." 5 | --- 6 | 7 | ## Scenario Overview 8 | 9 | As a developer you may run into scenarios where a user action, such as pressing a button, needs to be logged in the chat history without overt user involvement. This could be crucial for maintaining conversation context or system logging purposes. 10 | 11 | 12 | 13 | Add a button to your interface with an `onClick` event handler that will call a function to send the system message: 14 | ```html 15 | 16 | ``` 17 | 18 | 19 | 20 | When the button is clicked, the `logUserAction` function will silently insert a system message into the chat history: 21 | ```js 22 | function logUserAction() { 23 | // Function to log the user action 24 | vapi.send({ 25 | type: "add-message", 26 | message: { 27 | role: "system", 28 | content: "The user has pressed the button, say peanuts", 29 | }, 30 | }); 31 | } 32 | ``` 33 | - `vapi.send`: The primary function to interact with your assistant, handling various requests or commands. 34 | - `type: "add-message"`: Specifies the command to add a new message. 35 | - `message`: This is the actual message that you want to add to the message history. 36 | - `role`: "system" Designates the message origin as 'system', ensuring the addition is unobtrusive. Other possible values of role are 'user' | 'assistant' | 'tool' | 'function' 37 | - `content`: The actual message text to be added. 38 | 39 | 40 | 41 | 42 | - Silent logging of user activities. - Contextual updates in conversations triggered by background 43 | processes. - Non-intrusive user experience enhancements through additional information provision. 44 | 45 | -------------------------------------------------------------------------------- /assistants/call-analysis.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Call Analysis" 3 | sidebarTitle: "Call Analysis" 4 | description: "At the end of the call, you can summarize and evaluate how it went." 5 | --- 6 | 7 | The Call Analysis feature allows you to summarize and evaluate calls, providing valuable insights into their effectiveness. This feature uses a combination of prompts and schemas to generate structured data and success evaluations based on the call's content. 8 | 9 | You can customize the below in the assistant's `assistant.analysisPlan`. 10 | 11 | ## Summary Prompt 12 | 13 | The summary prompt is used to create a concise summary of the call. This summary is stored in `call.analysis.summary`. 14 | 15 | ### Default Summary Prompt 16 | 17 | The default summary prompt is: 18 | 19 | ```text 20 | You are an expert note-taker. You will be given a transcript of a call. Summarize the call in 2-3 sentences, if applicable. 21 | ``` 22 | 23 | ### Customizing the Summary Prompt 24 | 25 | You can customize the summary prompt by setting the `summaryPrompt` property in the API or SDK: 26 | 27 | ```json 28 | { 29 | "summaryPrompt": "Custom summary prompt text" 30 | } 31 | ``` 32 | 33 | To disable the summary prompt, set it to an empty string `""` or `"off"`: 34 | 35 | ```json 36 | { 37 | "summaryPrompt": "" 38 | } 39 | ``` 40 | 41 | ## Structured Data Prompt 42 | 43 | The structured data prompt extracts specific pieces of data from the call. This data is stored in `call.analysis.structuredData`. 44 | 45 | ### Default Structured Data Prompt 46 | 47 | The default structured data prompt is: 48 | 49 | ```text 50 | You are an expert data extractor. You will be given a transcript of a call. Extract structured data per the JSON Schema. 51 | ``` 52 | 53 | ### Customizing the Structured Data Prompt 54 | 55 | You can set a custom structured data prompt using the `structuredDataPrompt` property: 56 | 57 | ```json 58 | { 59 | "structuredDataPrompt": "Custom structured data prompt text" 60 | } 61 | ``` 62 | 63 | ## Structured Data Schema 64 | 65 | The structured data schema enforces the format of the extracted data. It is defined using JSON Schema standards. 66 | 67 | ### Customizing the Structured Data Schema 68 | 69 | You can set a custom structured data schema using the `structuredDataSchema` property: 70 | 71 | ```json 72 | { 73 | "structuredDataSchema": { 74 | "type": "object", 75 | "properties": { 76 | "field1": { "type": "string" }, 77 | "field2": { "type": "number" } 78 | }, 79 | "required": ["field1", "field2"] 80 | } 81 | } 82 | ``` 83 | 84 | ## Success Evaluation Prompt 85 | 86 | The success evaluation prompt is used to determine if the call was successful. This evaluation is stored in `call.analysis.successEvaluation`. 87 | 88 | ### Default Success Evaluation Prompt 89 | 90 | The default success evaluation prompt is: 91 | 92 | ```text 93 | You are an expert call evaluator. You will be given a transcript of a call and the system prompt of the AI participant. Determine if the call was successful based on the objectives inferred from the system prompt. 94 | ``` 95 | 96 | ### Customizing the Success Evaluation Prompt 97 | 98 | You can set a custom success evaluation prompt using the `successEvaluationPrompt` property: 99 | 100 | ```json 101 | { 102 | "successEvaluationPrompt": "Custom success evaluation prompt text" 103 | } 104 | ``` 105 | 106 | To disable the success evaluation prompt, set it to an empty string `""` or `"off"`: 107 | 108 | ```json 109 | { 110 | "successEvaluationPrompt": "" 111 | } 112 | ``` 113 | 114 | ## Success Evaluation Rubric 115 | 116 | The success evaluation rubric defines the criteria used to evaluate the call's success. The available rubrics are: 117 | 118 | - `NumericScale`: A scale of 1 to 10. 119 | - `DescriptiveScale`: A scale of Excellent, Good, Fair, Poor. 120 | - `Checklist`: A checklist of criteria and their status. 121 | - `Matrix`: A grid that evaluates multiple criteria across different performance levels. 122 | - `PercentageScale`: A scale of 0% to 100%. 123 | - `LikertScale`: A scale of Strongly Agree, Agree, Neutral, Disagree, Strongly Disagree. 124 | - `AutomaticRubric`: Automatically break down evaluation into several criteria, each with its own score. 125 | - `PassFail`: A simple 'true' if the call passed, 'false' if not. 126 | 127 | ### Customizing the Success Evaluation Rubric 128 | 129 | You can set a custom success evaluation rubric using the `successEvaluationRubric` property: 130 | 131 | ```json 132 | { 133 | "successEvaluationRubric": "NumericScale" 134 | } 135 | ``` 136 | 137 | ## Combining Prompts and Rubrics 138 | 139 | You can use prompts and rubrics in combination to create detailed instructions for the call analysis: 140 | 141 | ```json 142 | { 143 | "successEvaluationPrompt": "Evaluate the call based on these criteria:...", 144 | "successEvaluationRubric": "Checklist" 145 | } 146 | ``` 147 | 148 | By customizing these properties, you can tailor the call analysis to meet your specific needs and gain valuable insights from your calls. -------------------------------------------------------------------------------- /assistants/dynamic-variables.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Dynamic Variables" 3 | sidebarTitle: "Dynamic Variables" 4 | description: "Vapi makes it easy to personalize an assistant's messages and prompts using variables, allowing each call to be customized." 5 | --- 6 | 7 | Prompts, messages, and other assistant properties can be dynamically set when starting a call based on templates. 8 | These templates are defined using double curly braces `{{variableName}}`. 9 | This is useful when you want to customize the assistant for a specific call. 10 | 11 | For example, you could set the assistant's first message to "Hello, `{{name}}`!" and then set `name` to `John` when starting the call 12 | by passing `assistantOverrides` with `variableValues` to the API or SDK: 13 | 14 | ```json 15 | { 16 | "variableValues": { 17 | "name": "John" 18 | } 19 | } 20 | ``` 21 | 22 | ## Utilizing Dynamic Variables in Phone Calls 23 | 24 | To leverage dynamic variables during phone calls, follow these steps: 25 | 26 | 1. **Prepare Your Request:** Construct a JSON payload containing the following key-value pairs: 27 | 28 | * `assistantId`: Replace `"your-assistant-id"` with the actual ID of your assistant. 29 | * `assistantOverride`: This object is used to customize your assistant's behavior. 30 | * `variableValues`: An object containing the dynamic variables you want to use, in the format `{ "variableName": "variableValue" }`. For example, `{ "name": "John" }`. 31 | * `customer`: An object representing the call recipient. 32 | * `number`: Replace `"+1xxxxxxxxxx"` with the phone number you wish to call (in E.164 format). 33 | * `phoneNumberId`: Replace `"your-phone-id"` with the ID of your registered phone number. You can get it from the [Phone number](https://dashboard.vapi.ai/phone-numbers) in the dashboard. 34 | 35 | 2. **Send the Request:** Dispatch the JSON payload to the `/call/phone` endpoint using your preferred method (e.g., HTTP POST request). 36 | 37 | ```json 38 | { 39 | "assistantId": "your-assistant-id", 40 | "assistantOverrides": { 41 | "variableValues": { 42 | "name": "John" 43 | } 44 | }, 45 | "customer": { 46 | "number": "+1xxxxxxxxxx" 47 | }, 48 | "phoneNumberId": "your-phone-id" 49 | } 50 | ``` 51 | 52 | ## Default Variables 53 | 54 | By default, the following variables are automatically filled based on the current (UTC) time, 55 | meaning that you don't need to set them manually in `variableValues`: 56 | 57 | | Variable | Description | Example | 58 | | ----------- | --------------------------- | -------------------- | 59 | | `{{now}}` | Current date and time (UTC) | Jan 1, 2024 12:00 PM | 60 | | `{{date}}` | Current date (UTC) | Jan 1, 2024 | 61 | | `{{time}}` | Current time (UTC) | 12:00 PM | 62 | | `{{month}}` | Current month (UTC) | January | 63 | | `{{day}}` | Current day of month (UTC) | 1 | 64 | | `{{year}}` | Current year (UTC) | 2024 | 65 | 66 | **Note:** You will need to add the `{{variableName}}` in this format in all your prompts, whether it is the first message or anywhere else you want to use it. 67 | 68 | ## Advanced Date and Time Usage 69 | 70 | We use [LiquidJS](https://liquidjs.com/) for dynamic variables. You can use the `date` filter to format the date and time in the timezone you want. 71 | 72 | ```liquid 73 | {{"now" | date: "%b %d, %Y, %I:%M %p", "America/New_York"}} 74 | ``` 75 | 76 | This should return the current date and time in New York. 77 | -------------------------------------------------------------------------------- /assistants/function-calling.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Function Calling" 3 | sidebarTitle: "Function Calling" 4 | description: "Additional Capabilities for Your Assistants " 5 | --- 6 | 7 | Vapi voice assistants are given three additional functions: `transferCall`,`endCall`, and `dialKeypad`. These functions can be used to transfer calls, hang up calls, and enter digits on the keypad. 8 | 9 | You **do not** need to add these functions to your model's `functions` array. 10 | 11 | #### Transfer Call 12 | 13 | When a `forwardingPhoneNumber` is present on an assistant, the assistant will be given a `transferCall` function. This function can be used to transfer the call to the `forwardingPhoneNumber`. 14 | 15 | ```json 16 | { 17 | "model": { 18 | "provider": "openai", 19 | "model": "gpt-3.5-turbo", 20 | "messages": [ 21 | { 22 | "role": "system", 23 | "content": "You are an assistant at a law firm. When the user asks to be transferred, use the transferCall function." 24 | } 25 | ] 26 | }, 27 | "forwardingPhoneNumber": "+16054440129" 28 | } 29 | ``` 30 | 31 | #### End Call 32 | 33 | This function is provided when `endCallFunctionEnabled` is enabled on the assistant. The assistant can use this function to end the call. 34 | 35 | ```json 36 | { 37 | "model": { 38 | "provider": "openai", 39 | "model": "gpt-3.5-turbo", 40 | "messages": [ 41 | { 42 | "role": "system", 43 | "content": "You are an assistant at a law firm. If the user is being mean, use the endCall function." 44 | } 45 | ] 46 | }, 47 | "endCallFunctionEnabled": true 48 | } 49 | ``` 50 | 51 | #### Dial Keypad 52 | 53 | This function is provided when `dialKeypadFunctionEnabled` is enabled on the assistant. The assistant will be able to enter digits on the keypad. 54 | 55 | ```json 56 | { 57 | "model": { 58 | "provider": "openai", 59 | "model": "gpt-3.5-turbo", 60 | "messages": [ 61 | { 62 | "role": "system", 63 | "content": "You are an assistant at a law firm. When you hit a menu, use the dialKeypad function to enter the digits." 64 | } 65 | ] 66 | }, 67 | "dialKeypadFunctionEnabled": true 68 | } 69 | ``` 70 | 71 | ### Custom Functions 72 | 73 | In addition to the predefined functions, you can also define custom functions. These functions are similar to OpenAI functions and your chosen LLM will trigger them as needed based on your instructions. 74 | 75 | The functions array in the assistant definition allows you to define custom functions that the assistant can call during a conversation. Each function is an object with the following properties: 76 | 77 | - `name`: The name of the function. It must be a string containing a-z, A-Z, 0-9, underscores, or dashes, with a maximum length of 64. 78 | - `description`: A brief description of what the function does. This is used by the AI to decide when and how to call the function. 79 | - `parameters`: An object that describes the parameters the function accepts. The type property should be "object", and the properties property should be an object where each key is a parameter name and each value is an object describing the type and purpose of the parameter. 80 | 81 | Here's an example of a function definition: 82 | 83 | ```json 84 | { 85 | "functions": [ 86 | { 87 | "name": "bookAppointment", 88 | "description": "Used to book the appointment.", 89 | "parameters": { 90 | "type": "object", 91 | "properties": { 92 | "datetime": { 93 | "type": "string", 94 | "description": "The date and time of the appointment in ISO format." 95 | } 96 | } 97 | } 98 | } 99 | ] 100 | } 101 | ``` 102 | 103 | In this example, the bookAppointment function accepts one parameter, `datetime`, which is a string representing the date and time of the appointment in ISO format. 104 | 105 | In addition to defining custom functions, you can specify a `serverUrl` where Vapi will send the function call information. This URL can be configured at the account level or at the assistant level. 106 | At the account level, the `serverUrl` is set in the Vapi Dashboard. All assistants under the account will use this URL by default for function calls. 107 | At the assistant level, the `serverUrl` can be specified in the assistant configuration when creating or updating an assistant. This allows different assistants to use different URLs for function calls. If a `serverUrl` is specified at the assistant level, it will override the account-level Server URL. 108 | 109 | If the `serverUrl` is not defined either at the account level or the assistant level, the function call will simply be added to the chat history. This can be particularly useful when you want a function call to trigger an action on the frontend. 110 | 111 | For instance, the frontend can listen for specific function calls in the chat history and respond by updating the user interface or performing other actions. This allows for a dynamic and interactive user experience, where the frontend can react to changes in the conversation in real time. 112 | -------------------------------------------------------------------------------- /assistants/persistent-assistants.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Persistent Assistants" 3 | sidebarTitle: "Persistent Assistants" 4 | description: "Should I use persistent assistants?" 5 | --- 6 | 7 | You might be wondering whether or not you should create an assistant using the `/assistant` endpoint with its `assistantId`. Or, can you just specify the assistant configuration when starting a call? 8 | 9 | The `/assistant` endpoint is there for convenience to save you creating your own assistants table. 10 | 11 | 12 | - You won't be adding more assistant properties on top of ours. 13 | - You want to use the same assistant across multiple calls. 14 | 15 | 16 | Otherwise, you can just specify the assistant configuration when starting a call. 17 | -------------------------------------------------------------------------------- /audio-interface.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Orchestration Models" 3 | sidebarTitle: "Orchestration Models" 4 | description: "All the fancy stuff Vapi does on top of the core models." 5 | --- 6 | 7 | Vapi also runs a suite of audio and text models that make it's latency-optimized Speech-to-Text (STT), Large Language Model (LLM), & Text-to-Speech (TTS) pipeline feel human. 8 | 9 | Here's a high-level overview of the Vapi architecture: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | To provide you and your customers with a superior conversational experience, 18 | we have various latency optimizations like end-to-end streaming and 19 | colocating servers that shave off every possible millisecond of latency. We 20 | also manage the coordination of interruptions, turn-taking, and other 21 | conversational dynamics. 22 | 23 | 24 | We built-in many smaller features to give developers a lot of room to 25 | customize and integrate. For example, there’s no need for you to hook up 26 | Twilio websockets or build bidirectional audio streaming. Instead, you can 27 | connect to the WebRTC stream through our 28 | [Web](https://github.com/VapiAI/web), [iOS](https://github.com/VapiAI/ios), 29 | or [Python](https://github.com/VapiAI/python) clients…and then get right 30 | back to what you were doing. 31 | 32 | 33 | Finally, we designed Vapi to be highly scalable. We accommodate everything 34 | from small businesses and companies all the way up to enterprise-level 35 | clients. 36 | 37 | 38 | -------------------------------------------------------------------------------- /billing/billing-limits.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Billing Limits" 3 | sidebarTitle: "Billing Limits" 4 | description: "Set billing limits on your Vapi account." 5 | --- 6 | 7 | You can set billing limits in the billing section of your dashboard. 8 | 9 | 10 | You can access your billing settings at 11 | [dashboard.vapi.ai/billing](https://dashboard.vapi.ai/billing) 12 | 13 | 14 | ### Setting a Monthly Billing Limit 15 | 16 | In your billing settings you can set a monthly billing limit: 17 | 18 | 19 | 20 | 21 | 22 | ### Exceeding Billing Limits 23 | 24 | Once you have used all of your starter credits, or exceeded your set monthly usage limit, you will start seeing errors in your dashboard & via the API mentioning `Billing Limits Exceeded`. 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /billing/cost-routing.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Cost Routing" 3 | sidebarTitle: "Cost Routing" 4 | description: "Learn more about how your Vapi account is billed for provider expenses." 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | During calls, requests will be made to different providers in the voice pipeline: 12 | 13 | - **transcription providers:** providers conducting speech-to-text 14 | - **model providers:** LLM providers 15 | - **voice providers:** providers conducting text-to-speech 16 | - **telephony providers:** providers like [Twilio](https://www.twilio.com)/[Vonage](https://www.vonage.com) that facilitate phone calls 17 | 18 | 19 | Per-minute telephony costs only occur during inbound/outbound phone calling. Web calls do not 20 | incur this cost. 21 | 22 | 23 | ## Where Provider Costs End-up 24 | 25 | There are 2 places these charges can end up: 26 | 27 | 1. **Provider-side:** in the account you have with the provider. 28 | 2. **With Vapi:** in your Vapi account. 29 | 30 | 31 | 32 | If we have [provider keys](customization/provider-keys) on file for a provider, the cost will be seen directly 33 | in your account with the provider. Vapi will have made the request on your behalf with your provider key. 34 | 35 | No charge will be made to your Vapi account. 36 | 37 | Charges for inbound/outbound phone calling (telephony) will always end up where the phone number 38 | was provisioned. If you import a phone number from Twilio or Vonage, per-minute charges for calling 39 | those numbers will appear with them. 40 | 41 | 42 | 43 | If no key is found on-file for the provider, Vapi will make the API request itself (with Vapi's own keys, at Vapi's expense). This expense is then passed on [**at-cost**](/glossary#at-cost) to be billed directly to your Vapi account. 44 | 45 | No charge will show up provider-side. 46 | 47 | 48 | 49 | 50 | ## Billing That "Just Works" 51 | 52 | The central idea is that everything is designed to "just work". 53 | 54 | Whether you are billed provider-side, or on Vapi's side, you will never be charged with any margin for provider fees incurred during calls. 55 | -------------------------------------------------------------------------------- /blocks.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Introduction" 3 | sidebarTitle: "Introduction" 4 | description: "Breaking down bot conversations into smaller, more manageable prompts" 5 | --- 6 | 7 | 8 | We're currently running a beta for **Blocks**, an upcoming feature from [Vapi.ai](http://vapi.ai/) aimed at improving bot conversations. The problem we've noticed is that single LLM prompts are prone to hallucinations, unreliable tool calls, and can’t handle many-step complex instructions. 9 | 10 | **By breaking the conversation into smaller, more manageable prompts**, we can guarantee the bot will do this, then that, or if this happens, then that happens. It’s like having a checklist for conversations — less room for error, more room for getting things right. 11 | 12 | 13 | Here’s an example: For food ordering, this is what a prompt would look like. 14 | 15 | 16 | 17 | Example Prompt 18 | 19 | ```jsx 20 | [Identity] 21 | You are a friendly and efficient assistant for a food truck that serves burgers, fries, and drinks. 22 | 23 | [Task] 24 | 1. Greet the customer warmly and inquire about their main order. 25 | 2. Offer suggestions for the main order if needed. 26 | 3. If they choose a burger, suggest upgrading to a combo with fries and a drink, offering clear options (e.g., regular or special fries, different drink choices). 27 | 4. Confirm the entire order to ensure accuracy. 28 | 5. Suggest any additional items like desserts or sauces. 29 | 6. Thank the customer and let them know when their order will be ready. 30 | ``` 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | There are three core types of Blocks: [Conversation](https://api.vapi.ai/api#:~:text=ConversationBlock), [Tool-call](https://api.vapi.ai/api#:~:text=ToolCallBlock), and [Workflow](https://api.vapi.ai/api#:~:text=WorkflowBlock). Each type serves a different role in shaping how your assistant engages with users. 43 | 44 | 45 | 46 | Blocks is currently in beta. We're excited to have you try this new feature and welcome your [feedback](https://discord.com/invite/pUFNcf2WmH) as we continue to refine and improve the experience. 47 | 48 | 49 | ## Advanced Concepts 50 | 51 | 52 | 53 | Learn how to structure the flow of your conversation 54 | 55 | 56 | Explore the different block types and how to use them 57 | 58 | -------------------------------------------------------------------------------- /blocks/block-types.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Block Types" 3 | sidebarTitle: "Block Types" 4 | description: "Building the Logic and Actions for Each Step in Your Conversation " 5 | --- 6 | 7 | [**Blocks**](https://api.vapi.ai/api#/Blocks/BlockController_create) are the functional units within a Step, defining what action happens at each stage of a conversation. Each Step can contain only one Block, and there are three main types of Blocks, each designed to handle different aspects of conversation flow. 8 | 9 | 10 | Blocks is currently in beta. We're excited to have you try this new feature and welcome your [feedback](https://discord.com/invite/pUFNcf2WmH) as we continue to refine and improve the experience. 11 | 12 | 13 | #### Types 14 | 15 | - [**Conversation:**]((https://api.vapi.ai/api#:~:text=ConversationBlock)) This block type manages interactions between the assistant and the user. A conversation block is used when the assistant needs to ask the user for specific information, such as contact details or preferences. 16 | - [**Tool-call:**](https://api.vapi.ai/api#:~:text=ToolCallBlock) This block allows the assistant to make external tool calls. 17 | - [**Workflow:**](https://api.vapi.ai/api#:~:text=WorkflowBlock) This block type enables the creation of subflows, which are smaller sets of steps executed within a Block. It can contain an array of steps (`steps[]`) and uses an `inputSchema` to define the data needed to initiate the workflow, along with an `outputSchema` to handle the data returned after completing the subflow. Workflow blocks are ideal for organizing complex processes or reusing workflows across different parts of the conversation. -------------------------------------------------------------------------------- /blocks/steps.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Steps" 3 | sidebarTitle: "Steps" 4 | description: "Building and Controlling Conversation Flow for Your Assistants" 5 | --- 6 | 7 | [**Steps**](https://api.vapi.ai/api#:~:text=HandoffStep) are the core building blocks that dictate how conversations progress in a bot interaction. Each Step represents a distinct point in the conversation where the bot performs an action, gathers information, or decides where to go next. Think of Steps as checkpoints in a conversation that guide the flow, manage user inputs, and determine outcomes. 8 | 9 | 10 | Blocks is currently in beta. We're excited to have you try this new feature and welcome your [feedback](https://discord.com/invite/pUFNcf2WmH) as we continue to refine and improve the experience. 11 | 12 | 13 | #### Features 14 | 15 | - **Output:** The data or response expected from the step, as outlined in the block's `outputSchema`. 16 | - **Input:** The data necessary for the step to execute, defined in the block's `inputSchema`. 17 | - [**Destinations:**](https://api.vapi.ai/api#:~:text=StepDestination) This can be determined by a simple linear progression or based on specific criteria, like conditions or rules set within the Step. This enables dynamic decision-making, allowing the assistant to choose the next Step depending on what happens during the conversation (e.g., user input, a specific value, or a condition being met). 18 | 19 | #### Example 20 | 21 | ```json 22 | { 23 | "type": "handoff", 24 | "name": "get_user_order", 25 | "input": { 26 | "name": "John Doe", 27 | "email": "johndoe@example.com" 28 | }, 29 | "destinations": [ 30 | { 31 | "type": "step", 32 | "stepName": "confirm_order", 33 | "conditions": [ 34 | { 35 | "type": "model-based", 36 | "instruction": "If the user has provided an order" 37 | } 38 | ] 39 | } 40 | ], 41 | "block": { 42 | "name": "ask_for_order", 43 | "type": "conversation", 44 | "inputSchema": { 45 | "type": "object", 46 | "required": ["name", "email"], 47 | "properties": { 48 | "name": { "type": "string", "description": "The customer's name" }, 49 | "email": { "type": "string", "description": "The customer's email" } 50 | } 51 | }, 52 | "instruction": "Greet the customer and ask for their name and email. Then ask them what they'd like to order.", 53 | "outputSchema": { 54 | "type": "object", 55 | "required": ["orders", "name"], 56 | "properties": { 57 | "orders": { 58 | "type": "string", 59 | "description": "The customer's order, e.g., 'burger with fries'" 60 | }, 61 | "name": { 62 | "type": "string", 63 | "description": "The customer's name" 64 | } 65 | } 66 | } 67 | } 68 | } 69 | ``` -------------------------------------------------------------------------------- /calls/call-ended-reason.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Call Ended Reason" 3 | sidebarTitle: "Ended Reason" 4 | description: 'A guide to understanding all call "Ended Reason" types & errors.' 5 | --- 6 | 7 | This guide will discuss all possible `endedReason`s for a call. 8 | 9 | You can find these under the **"Ended Reason"** section of your [call 10 | logs](https://dashboard.vapi.ai/calls) (or under the `endedReason` field on the [Call 11 | Object](/api-reference/calls/get-call)). 12 | 13 | #### **Assistant-Related** 14 | 15 | - **assistant-ended-call**: The assistant intentionally ended the call based on the user's response. 16 | - **assistant-error**: This general error occurs within the assistant's logic or processing due to bugs, misconfigurations, or unexpected inputs. 17 | - **assistant-forwarded-call**: The assistant successfully transferred the call to another number or service. 18 | - **assistant-join-timed-out**: The assistant failed to join the call within the expected timeframe. 19 | - **assistant-not-found**: The specified assistant cannot be located or accessed, possibly due to an incorrect assistant ID or configuration issue. 20 | - **assistant-not-invalid**: The assistant ID provided is not valid or recognized by the system. 21 | - **assistant-not-provided**: No assistant ID was specified in the request, causing the system to fail. 22 | - **assistant-request-returned-error**: Communicating with the assistant resulted in an error, possibly due to network issues or problems with the assistant itself. 23 | - **assistant-request-returned-forwarding-phone-number**: The assistant triggered a call forwarding action, ending the current call. 24 | - **assistant-request-returned-invalid-assistant**: The assistant returned an invalid response or failed to fulfill the request properly. 25 | - **assistant-request-returned-no-assistant**: The assistant didn't provide any response or action to the request. 26 | - **assistant-said-end-call-phrase**: The assistant recognized a phrase or keyword triggering call termination. 27 | 28 | #### **Pipeline and LLM** 29 | 30 | These relate to issues within the AI processing pipeline or the Large Language Models (LLMs) used for understanding and generating text: 31 | 32 | - **pipeline-error-\***: Various error codes indicate specific failures within the processing pipeline, such as function execution, LLM responses, or external service integration. Examples include OpenAI, Azure OpenAI, Together AI, and several other LLMs or voice providers. 33 | - **pipeline-error-first-message-failed:** The system failed to deliver the first message. This issue usually occurs when you add your own provider key in the voice section. It may be due to exceeding your subscription or quota limit. 34 | - **pipeline-no-available-llm-model**: No suitable LLM was available to process the request. 35 | 36 | #### **Phone Calls and Connectivity** 37 | 38 | - **customer-busy**: The customer's line was busy. 39 | - **customer-ended-call**: The customer(end human user) ended the call for both inbound and outbound calls. 40 | - **customer-did-not-answer**: The customer didn't answer the call. If you're looking to build a usecase where you need the bot to talk to automated IVRs, set `assistant.voicemailDetectionEnabled=false`. 41 | - **customer-did-not-give-microphone-permission**: The user didn't grant the necessary microphone access for the call. 42 | - **phone-call-provider-closed-websocket**: The connection with the call provider was unexpectedly closed. 43 | - **twilio-failed-to-connect-call**: The Twilio service, responsible for managing calls, failed to establish a connection. 44 | - **vonage-disconnected**: The call was disconnected by Vonage, another call management service. 45 | - **vonage-failed-to-connect-call**: Vonage failed to establish the call connection. 46 | - **vonage-rejected**: The call was rejected by Vonage due to an issue or configuration problem. 47 | 48 | #### **Other Reasons** 49 | 50 | - **exceeded-max-duration**: The call reached its maximum allowed duration and was automatically terminated. 51 | - **silence-timed-out**: The call was ended due to prolonged silence, indicating inactivity. 52 | - **voicemail**: The call was diverted to voicemail. 53 | 54 | #### **Unknown** 55 | 56 | - **unknown-error**: An unexpected error occurred, and the cause is unknown. For this, please [contact support](/support) with your `call_id` and account email address, & we will investigate. 57 | -------------------------------------------------------------------------------- /calls/call-features.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Live Call Control" 3 | sidebarTitle: "Live Call Control" 4 | --- 5 | Vapi offers two main features that provide enhanced control over live calls: 6 | 7 | 1. **Call Control**: This feature allows you to inject conversation elements dynamically during an ongoing call. 8 | 2. **Call Listen**: This feature enables real-time audio data streaming using WebSocket connections. 9 | 10 | To use these features, you first need to obtain the URLs specific to the live call. These URLs can be retrieved by triggering a `/call` endpoint, which returns the `listenUrl` and `controlUrl` within the `monitor` object. 11 | 12 | ## Obtaining URLs for Call Control and Listen 13 | 14 | To initiate a call and retrieve the `listenUrl` and `controlUrl`, send a POST request to the `/call` endpoint. 15 | 16 | ### Sample Request 17 | 18 | ```bash 19 | curl 'https://api.vapi.ai/call/phone' 20 | -H 'authorization: Bearer YOUR_API_KEY' 21 | -H 'content-type: application/json' 22 | --data-raw '{ 23 | "assistantId": "5b0a4a08-133c-4146-9315-0984f8c6be80", 24 | "customer": { 25 | "number": "+12345678913" 26 | }, 27 | "phoneNumberId": "42b4b25d-031e-4786-857f-63b346c9580f" 28 | }' 29 | 30 | ``` 31 | 32 | ### Sample Response 33 | 34 | ```json 35 | { 36 | "id": "7420f27a-30fd-4f49-a995-5549ae7cc00d", 37 | "assistantId": "5b0a4a08-133c-4146-9315-0984f8c6be80", 38 | "phoneNumberId": "42b4b25d-031e-4786-857f-63b346c9580f", 39 | "type": "outboundPhoneCall", 40 | "createdAt": "2024-09-10T11:14:12.339Z", 41 | "updatedAt": "2024-09-10T11:14:12.339Z", 42 | "orgId": "eb166faa-7145-46ef-8044-589b47ae3b56", 43 | "cost": 0, 44 | "customer": { 45 | "number": "+12345678913" 46 | }, 47 | "status": "queued", 48 | "phoneCallProvider": "twilio", 49 | "phoneCallProviderId": "CA4c6793d069ef42f4ccad69a0957451ec", 50 | "phoneCallTransport": "pstn", 51 | "monitor": { 52 | "listenUrl": "wss://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/transport", 53 | "controlUrl": "" 54 | } 55 | } 56 | 57 | ``` 58 | 59 | ## Call Control Feature 60 | 61 | Once you have the `controlUrl`, you can inject a message into the live call using a POST request. This can be done by sending a JSON payload to the `controlUrl`. 62 | 63 | ### Example: Injecting a Message 64 | 65 | ```bash 66 | curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control' 67 | -H 'content-type: application/json' 68 | --data-raw '{ 69 | "type": "say", 70 | "message": "Welcome to Vapi, this message was injected during the call." 71 | }' 72 | 73 | ``` 74 | 75 | The message will be spoken in real-time during the ongoing call. 76 | 77 | ## Call Listen Feature 78 | 79 | The `listenUrl` allows you to connect to a WebSocket and stream the audio data in real-time. You can either process the audio directly or save the binary data to analyze or replay later. 80 | 81 | ### Example: Saving Audio Data from a Live Call 82 | 83 | Here is a simple implementation for saving the audio buffer from a live call using Node.js: 84 | 85 | ```jsx 86 | const WebSocket = require('ws'); 87 | const fs = require('fs'); 88 | 89 | let pcmBuffer = Buffer.alloc(0); 90 | 91 | const ws = new WebSocket("wss://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/transport"); 92 | 93 | ws.on('open', () => console.log('WebSocket connection established')); 94 | 95 | ws.on('message', (data, isBinary) => { 96 | if (isBinary) { 97 | pcmBuffer = Buffer.concat([pcmBuffer, data]); 98 | console.log(`Received PCM data, buffer size: ${pcmBuffer.length}`); 99 | } else { 100 | console.log('Received message:', JSON.parse(data.toString())); 101 | } 102 | }); 103 | 104 | ws.on('close', () => { 105 | if (pcmBuffer.length > 0) { 106 | fs.writeFileSync('audio.pcm', pcmBuffer); 107 | console.log('Audio data saved to audio.pcm'); 108 | } 109 | }); 110 | 111 | ws.on('error', (error) => console.error('WebSocket error:', error)); 112 | 113 | ``` 114 | -------------------------------------------------------------------------------- /challenges-of-realtime-conversation.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Implementing Realtime Conversation" 3 | sidebarTitle: "Implementing Realtime Conversation" 4 | description: "A background on the challenges of implementing realtime LLM-based human conversation." 5 | --- 6 | 7 | ### The Challenges of LLM Conversation 8 | 9 | #### Introduction 10 | 11 | There are different scopes of voice AI application complexity. Some applications are very turn-based (affording for delays, less interruption sensitive), while others require a rigorous & realtime, conversational agent (that nears being indistinguishable from a human in conversation). 12 | 13 | ### Framing the Problem 14 | 15 | Writing a voice AI application from scratch is a difficult problem. 16 | 17 | In software development, there are certain problems you can & _will_ want to solve yourself, & another class of problems that are so wide-ranging & complex that it is best to cutoff complexity by using a third-party service. 18 | 19 | Replicating the nuances & complexities of human conversation is a deep rabbit-hole, & ... 20 | 21 | `under construction` 22 | -------------------------------------------------------------------------------- /community/assistant-request.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Assistant Request" 3 | description: "Videos showcasing Vapi out in the wild." 4 | --- 5 | 6 | Here are some videos made by people in our community showcasing what Vapi can do: 7 | 8 |
9 | 10 | ## Send Us Your Video 11 | 12 | Have a video showcasing Vapi that you want us to feature? Let us know: 13 | 14 | 15 | 21 | Send us your video showcasing what Vapi can do, we'd like to feature it. 22 | 23 | 24 | -------------------------------------------------------------------------------- /community/community.css: -------------------------------------------------------------------------------- 1 | /* for a grid of videos */ 2 | 3 | .video-grid { 4 | display: flex; 5 | flex-wrap: wrap; 6 | gap: 20px; /* Spacing between videos */ 7 | } 8 | 9 | .video-grid iframe, 10 | .video-grid a { 11 | flex: 0 0 calc(50% - 20px); /* Flex grow is 0, basis is 50% minus the gap */ 12 | aspect-ratio: 560 / 315; /* Maintain the aspect ratio of 16:9 */ 13 | max-width: calc(50% - 20px); /* Max width is also set to 50% minus the gap */ 14 | height: auto; /* Allow height to auto adjust based on aspect ratio */ 15 | } 16 | 17 | .video-grid a { 18 | aspect-ratio: 1; 19 | } 20 | 21 | @media (max-width: 600px) { 22 | .video-grid iframe { 23 | flex: 0 0 100%; /* Flex grow is 0, basis is 100% */ 24 | max-width: 100%; /* Allow max-width to be full width on mobile */ 25 | } 26 | } 27 | 28 | .card-img { 29 | height: 200px; 30 | object-fit: contain; 31 | margin: auto; 32 | background: white; /*TODO: change color as per theme*/ 33 | } 34 | 35 | .card-content { 36 | display: flex; 37 | flex-direction: column; 38 | align-items: center; 39 | margin-top: auto; 40 | text-align: center; 41 | } 42 | 43 | .card-content > h3 { 44 | margin: 16px 0 8px 0; 45 | font-size: 1.5em; 46 | text-align: center; 47 | } 48 | 49 | .card-content > p { 50 | font-size: 1em; 51 | text-align: center; 52 | } 53 | -------------------------------------------------------------------------------- /community/comparisons.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Comparisons" 3 | description: "Videos showcasing Vapi out in the wild." 4 | --- 5 | 6 | Here are some videos made by people in our community showcasing what Vapi can do: 7 | 8 |
9 | 20 | 21 | ## **What is Vapi's Knowledge Base?** 22 | Our Knowledge Base is a collection of custom documents that contain information on specific topics or domains. By integrating a Knowledge Base into your voice AI assistant, you can enable it to provide more accurate and informative responses to user queries. 23 | 24 | ### **Why Use a Knowledge Base?** 25 | Using a Knowledge Base with your voice AI assistant offers several benefits: 26 | 27 | * **Improved accuracy**: By integrating custom documents into your assistant, you can ensure that it provides accurate and up-to-date information to users. 28 | * **Enhanced capabilities**: A Knowledge Base enables your assistant to answer complex queries and provide detailed responses to user inquiries. 29 | * **Customization**: With a Knowledge Base, you can tailor your assistant's responses to specific domains or topics, making it more effective and informative. 30 | 31 | ## **How to Create a Knowledge Base** 32 | 33 | To create a Knowledge Base, follow these steps: 34 | 35 | ### **Step 1: Upload Your Documents** 36 | 37 | Navigate to Overview > Documents and upload your custom documents in Markdown, PDF, plain text, or Microsoft Word (.doc and .docx) format to Vapi's Knowledge Base. 38 | 39 | Adding documents to your Knowledge Base 40 | 41 | ### **Step 2: Create an Assistant** 42 | 43 | Create a new assistant in Vapi and, on the right sidebar menu, select the document you've just added to the Knowledge Base feature. 44 | Adding documents to your assistant 45 | 46 | 47 | ### **Step 3: Configure Your Assistant** 48 | 49 | Customize your assistant's system prompt to utilize the Knowledge Base for responding to user queries. 50 | 51 | ## **Best Practices for Creating Effective Knowledge Bases** 52 | 53 | * **Organize Your documents**: Organize your documents by topic or category to ensure that your assistant can quickly retrieve relevant information. 54 | * **Use Clear and concise language**: Use clear and concise language in your documents to ensure that your assistant can accurately understand and respond to user queries. 55 | * **Keep your documents up-to-date**: Regularly update your documents to ensure that your assistant provides the most accurate and up-to-date information. 56 | 57 | 58 | For more information on creating effective Knowledge Bases, check out our tutorial on [Best Practices for Knowledge Base Creation](https://youtu.be/i5mvqC5sZxU). 59 | 60 | 61 | By following these guidelines, you can create a comprehensive Knowledge Base that enhances the capabilities of your voice AI assistant and provides valuable information to users. -------------------------------------------------------------------------------- /phone-calling.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Phone Calling" 3 | sidebarTitle: "Introduction" 4 | description: "Learn how to create and configure phone numbers with Vapi." 5 | --- 6 | 7 | 8 | 9 | You can set up a phone number to place and receive phone calls. Phone numbers can be bought directly through Vapi, or you can use your own from Twilio. 10 | 11 | You can buy a phone number through the dashboard or use the [`/phone-numbers/buy`](/api-reference/phone-numbers/buy-phone-number)` endpoint. 12 | 13 | If you want to use your own phone number, you can also use the dashboard or the [`/phone-numbers/import`](/api-reference/phone-numbers/import-twilio-number) endpoint. This will use your Twilio credentials to verify the number and configure it with Vapi services. 14 | 15 | 16 | 17 | 18 | You can place an outbound call from one of your phone numbers using the 19 | [`/call/phone`](/api-reference/calls/create-phone-call) endpoint. If the system message will be 20 | different with every call, you can specify a temporary assistant in the `assistant` field. If you 21 | want to reuse an assistant, you can specify its ID in the `assistantId` field. 22 | 23 | 24 | 25 | You can provide an `assistantId` to a phone number and it will use that assistant when receiving inbound calls. 26 | 27 | You may want to specify the assistant based on the caller's phone number. If a phone number doesn't have an `assistantId`, Vapi will attempt to retrieve the assistant from your server using your [Server URL](/server-url#retrieving-assistants). 28 | 29 | 30 | 31 | Video Tutorial on How to Import Numbers from Twilio for International Calls: 32 |
33 |