Go to https://platform.openai.com/signup to create an OpenAI account.
Then go to https://platform.openai.com/account/api-keys
And create a new secret key !
Make sure to activate a paid account :
https://platform.openai.com/account/billing/overview
Otherwise it will look like it does not work because of rate limiting.
On top of that, you need to make a first payment to activate GPT-4.