Step 1: Go to the OpenAI Website

Visit https://platform.openai.com in your browser.

Step 2: Sign In or Create an Account

Log in using your existing OpenAI account. If you don’t have one, sign up using your email, Google, or Microsoft account.


Step 3: Open the API Keys Section

Once logged in, click on your profile icon (top-right corner) and select "View API Keys" or go to **https://platform.openai.com/account/api-keys** directly.


Step 4: Generate a New API Key

Click on the "Create new secret key" button. A new key will be generated.


Step 5: Copy and Save Your Key

Copy the key and store it in a safe place (such as a password manager or .env file). You won’t be able to view it again after closing the popup.