Issues with invalid api key

I would suggest using some of the very simple python examples in the API reference for chat completion to make calls on a local machine before moving to and diagnosing use on another platform or unknown code.

  1. Review that the API key you are using is one that is in your funded OpenAI account. They start with “sk-…”

  2. install Python 3.8-3.11 from an official download installer or your OS package manager

  3. try out a chatbot demo I posted needing no further libraries. Can't get openai python package working... please help! - #11 by _j - saving it to and running.

For the last, you either set the OS environment variable OPENAI_API_KEY to the key value, or you can replace the whole of {os.environ.get('OPENAI_API_KEY')} with the actual key text.

Then you can help us figure out what “even the document uploaded on replit is visible on the OpenAI platform” could possibly mean or where you see such a thing. Don’t put your API keys into other’s untrusted sites or software…

1 Like