Create an OpenAI API key
Create an OpenAI API key to gain access to the ChatGPT API. This key allows OpenAI to track your usage and generate accurate billing.
Log in or sign up to the OpenAI platform.
Click Create new secret key.
You can check that your key is working by running a prompt in the playground. If your free trial is expired, inactive, or not working, you must set up a paid account in the billing dashboard.
Copy your key to your clipboard.