Running AutoGPT with the open ai API

I’ve entered my API key into the autoGPT env file however I get the error

“Please set your OpenAI API key in .env or as an environment variable.
You can get your key from OpenAI API

do I have to buy the subscription for it to work or am i doing something wrong.

I think you have to pay for the use of the API. Did you enter your credit card number for the use of the API?