#Authentication Error, but my key is correct. Any help appreciated.

3 messages · Page 1 of 1 (latest)

autumn sun
#

Here's the error I'm getting. I am running ngrok, flask, and running it in a virtual environment locally. I'm new to programming and I'm using this tutorial: https://www.twilio.com/blog/openai-gpt-3-chatbot-python-twilio-sms

I'm near the end of it with everything working so far until now. I know the key is correct because another simpler bot I made with the same key is working. I tried inputting the key directly into the code as well rather than having is pulled from the .env and it still came back as invalid. It's quoting the correct and current key in the error below.

I'm at this step: "Send another SMS to your Twilio phone number and you will now get the response that comes from the Flask application:" in the tutorial. There were a lot of issues I had to overcome along the way. I'm trying to create a chatbot to conversate via sms to potential customers about my company with the goal of making appointments. Any guidance is very much appreciated. I had to shorten the error response to meet the character limit in discord. please let me know if I need to add more of it.

```
openai.error.AuthenticationError: Incorrect API key provided: <sk-9OUP*****************************************fKP>. You can find your API key at https://beta.openai.com.
127.0.0.1 - - [09/Jan/2023 10:42:15] "POST /bot HTTP/1.1" 500 -
```

Twilio Blog

Learn how to use the OpenAI API powered by the GPT-3 engine with Python to build a Programmable SMS chatbot.

dry pecan
#

I would try that api key again and make the same request in like postman, it seems to be a pretty clear error that it thinks it is the incorrect apikey?

#

are you sure there are no typos etc?