First, you need to get the API Key from ChatGPT. Make sure you have a paid account and added credits to it before you do this step.
Hover your cursor to the left side of the browser. A list of options will appear. Click API keys.
Your secret API keys will be listed in the page. If it is your first time generating an API key in ChatGPT, you should get the You currently do not have any API keys message in the page.
To generate an API key, click Create new secret key. You can give it a nickname, but it is optional. Click Create secret key afterwards.
You may be asked to verify the action as not automated. Complete the puzzle.
Once done, the secret key will be displayed to you. Copy it and store it somewhere safe. Once you got a copy of the key, click Done.
We prepared a Google Sheets template with ChatGPT function added to it.
After clicking it, you will be asked if you want to copy the template. Click Make a copy.
You will get a copy of the template with two sheets:
The two sheets are named Instructions and Sheet1.
The first sheet named Instructions includes the cell B8 to be used for storing the API key for accessing ChatGPT. Paste the copy of the API key to that cell.
The ChatGPT function in the sheet is called AskGPT. The syntax of the formul ais straightforward:
=AskGPT(question)
The question may be typed inside the formula enclosed in double quotes or is stored in another cell, which is referenced inside the function.
For our example, we store the question in A1, and reference it in the formula:
Press Enter. It takes a few seconds to load the answer. Enjoy!