Closed ozfollowoz closed 11 months ago
Have you tried using an API key from the link provided in the error message?
Yes, I have added API key from the link provided
Could you solve the problem? I am facing the same error. I have checked my api_key it is working when I run my API on my computer, but when I put my API in a Docker container and try to use the API it results this error: openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: .....}}
You may need to check that there's no leading or trailing spaces, or other errors with your API Key.
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
When attempting to run the provided code, an openai.AuthenticationError is raised with the error message stating, "Incorrect API key provided." The error code is 401.
To Reproduce
Traceback (most recent call last): File "d:\Chatbot_AzureAI_CSV_Project\open.py", line 23, in
asyncio.run(main())
... (rest of the traceback)
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: 9****p. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
Code snippets
OS
Windows
Python version
3.11.0
Library version
Latest