ChatGPT: Prompt Engineering- Error code: 401 function not working

I’m attempting to use the example on a local machine, specifically using Spyder on Win 11, however the effort has been major.
After going through the process of getting an account from openai website, installing all the libraries including openai, corrected the call from the class example, which is outdated, and a few other minor changes.
I’m still getting an error. The error is "Error code: 429 — which is evidently, ‘You exceeded your current quota’, which is impossible.
This was the first time it was used.
The ChatGPT log pages show no activity. The open ai key was checked and double checked.
I tried:

  1. Changing name of the environmental variable for the key,
  2. Used a variable and stripped any leading white spaces,
  3. used the key as a literal in the openai.api.key function.
    none of this worked any differently.
    Can anyone point to why this would be?

Discovered the problem. Turns out one must pay in advance for using the model. It looked like they gave up to $5 usage without charging but that isn’t the case. I also gave them my payment details when I first signed up for ChatGpt awhile back, but using the prompt outlines in the ChapGPT Prompt course may be different.
Anyway, after an advance payment of $10 for the usage, I now get different errors because the functions have changed, but I’m sure I can work that out. Changing API’s in AI is nothing new.