You
do not need to create a new public key for every assistant. Instead, you must update your existing public key to allow access to each new assistant you create—otherwise, you'll see the "Key doesn't allow assistantId" error.
Action:
After creating a new assistant, go to your Vapi Dashboard and add the assistant to your public key's allowed list.
Example workflow:
1. Create assistant via API.
2. In the dashboard, edit your public key and add the new assistant's ID to its permissions.
Tip: This step is required for every new assistant you want to use with the same public key ([documentation](
https://docs.vapi.ai/chat/web-widget)).
Source:
- [Web Widget documentation](
https://docs.vapi.ai/chat/web-widget)