UnitedNotions
04/04/2025, 4:18 PMSven
04/04/2025, 4:19 PMVapi Support Bot
04/04/2025, 4:20 PMhttps://staging-api.vapi.ai/api-extended#/extended/ChatController_chat
, while the production endpoint https://api.vapi.ai/chat
is deprecated and may result in timeout errors.
If you're looking to embed a widget on your website, I can share the code for the Voice Widget as an alternative. Here's how to embed the Vapi Voice Widget:
html
<script>
var vapiInstance = null;
const assistant = "<assistant_id>"; // Substitute with your assistant ID
const apiKey = "<your_public_api_key>"; // Substitute with your Public key from Vapi Dashboard
const buttonConfig = {}; // Modify this as required
(function (d, t) {
var g = document.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src =
"https://cdn.jsdelivr.net/gh/VapiAI/html-script-tag@latest/dist/assets/index.js";
g.defer = true;
g.async = true;
s.parentNode.insertBefore(g, s);
g.onload = function () {
vapiInstance = window.vapiSDK.run({
apiKey: apiKey, // mandatory
assistant: assistant, // mandatory
config: buttonConfig, // optional
});
};
})(document, "script");
</script>
This code should be inserted into your website's HTML, ideally before the closing </body>
tag according to the [Voice Widget Example](https://docs.vapi.ai/examples/voice-widget).
Is there anything else you'd like to know about embedding widgets or using the Vapi Web SDK?
Sources:Vapi Support Bot
04/04/2025, 4:20 PMVapi Support Bot
04/13/2025, 7:00 AMVapi Support Bot
04/13/2025, 7:00 AMSahil
04/14/2025, 6:21 AMSahil
07/09/2025, 6:45 PM