Invalid Key Issue
# support
w
Hi, I am repeatedly getting a 401 Unauthorized error with the message: "Invalid Key. Hot tip, you may be using the private key instead of the public key, or vice versa." to make an outbound call. I am using server side calls with the right private key. I am also using the proper Authorization header.
c
Hi Wayne, To resolve the 401 Unauthorized error, please check the following: 1. Ensure Key Usage: Double-check that you are using the public key for authentication if required, as private keys are not typically used for public API authentication. 2. Authorization Header: Confirm that the Authorization header includes the correct token format, such as
Bearer your-api-key
. 3. Cross-Check Credentials: Verify that your credentials, including any API keys, are correctly set and correspond to the right assistant and organization. 4. Allowed Assistants & Origins: Make sure that the allowed assistants and origins settings are configured correctly; leaving them blank (unrestricted) might help during troubleshooting. If all these are set correctly and the issue persists, consider regenerating your keys and updating all references in your configuration. Also, make sure that any server-side caching isn't using outdated authentication details. You can refer to the [Server Authentication Guide](https://docs.vapi.ai/server-url/server-authentication) for additional details on setting up authentication.
w
i've tried and verified all these things but still get the same error
c
Hello, Thanks for reaching out to us. We are sorry for the inconvenience. Can you give more details about your concern? Your Org ID, email address and other details that will help us pinpoint your account and to look further into it? We will investigate further and we appreciate your kind understanding and patience.
3 Views