Client-side SDK - Key doesn't allow transient assi...
# support
v
Hi all, I am trying to use the client-side SDK to launch calls from my frontend. I have set up a public key and checked a few times that transient assistants are allowed when doing so. However, when launching the call I get a 403 error: { "message": "Key doesn't allow transient assistant.", "error": "Forbidden", "statusCode": 403 }
v
You cannot use transient assistants with a public API key from the client-side SDK. To enable transient assistants, route your frontend call through a backend proxy that uses your private API key. Here’s a quick example of a proxy endpoint in Node.js:
Copy code
js
// Example: Express route to handle Vapi call with transient assistant
app.post('/call', async (req, res) => {
  const vapi = new VapiClient({ token: process.env.VAPI_API_KEY });
  const call = await vapi.calls.create({ assistant: req.body.assistant, ...req.body });
  res.json(call);
});
Call your backend from the frontend instead of Vapi directly. This keeps your private key secure and allows transient assistant usage. [See proxy server guide](https://docs.vapi.ai/security-and-privacy/proxy-server) Sources: - [Proxy server guide](https://docs.vapi.ai/security-and-privacy/proxy-server) - [Transient vs permanent configurations](https://docs.vapi.ai/assistants/concepts/transient-vs-permanent-configurations)
v
is this true^? seems counter-intuitive to have the transient assistants toggle when creating a public key if so aha.
this would also contradict the docs here: https://github.com/VapiAI/client-sdk-web which suggest you can pass an assistant directly in the client sdk call start. i..e a transient assistant from client-side
c
Hi ViciousDog, Based on your error message "Key doesn't allow transient assistant," here's what's happening: 1. Your public key needs specific permissions to create transient assistants. This requires: - Setting the correct permissions in your key configuration - Enabling transient assistants for your organization 2. To fix this, you need to: - Go to your Vapi dashboard - Check your public key settings - Explicitly enable the "Allow Transient Assistant" permission for the key - Ensure your organization has transient assistants enabled[1](https://docs.vapi.ai/api-reference/webhooks/client-message) The 403 Forbidden error specifically indicates that while your key is valid, it lacks the required permissions for creating transient assistants. Double-check that: - You're using the correct public key - The key has transient assistant permissions enabled - Your organization settings allow for transient assistants If the issue persists after confirming these settings, you may need to generate a new public key with the correct permissions.
v
Yeah I would not have raised this if I had not created a public key with the ability to create transient assistants.
I personally believe it to be a bug on your client side SDK but I imagine you won’t look into it so I implemented a workaround. Thanks
e
hello, how can i see if my organization has transient assitants enabled?
i created an api key with the transient assistant permission but i still see the "Key doesn't allow transient assistant" error
@Vicious Dog sorry to ping you, but i have this same exact issue if you have time, can you please share with me what's the workaround you used? i tried creating my own endpoints and i'm trying to create the call server side, but it is asking me for phoneNumberId / phoneNumber and it is just a webcall im using react widget with a custom apiUrl set to my endpoint
v
Yeah that’s basically what I did. what you wanna do is add a free phone number in Vapi then associate it with an existing (non transients) assistant in Vapi I then pass this phoneNumberId in the server side POST to create a call Then I finally use the messaging feature to ‘inject’ an updated, dynamic system message that I needed a transient assistant for