All Collections
OpenAI API
API Error Codes Explained
Error Code 401 - Invalid Authentication
Error Code 401 - Invalid Authentication
Joshua J. avatar
Written by Joshua J.
Updated over a week ago

This error message indicates that your authentication credentials are invalid. This could happen for several reasons, such as:

- You are using a revoked API key.

- You are using a different API key than one under the requesting organization.

- You are using an API key that does not have the required permissions for the endpoint you are calling.

To resolve this error, please follow these steps:

- Check that you are using the correct API key and organization ID in your request header. You can find your API key and organization ID in your account settings here.

- If you are unsure whether your API key is valid, you can generate a new one here. Make sure to replace your old API key with the new one in your requests and follow our best practices.

Did this answer your question?