Recently ChatGPT shake internet with its amazing results. This repository is a simple API for ChatGPT, where you can query many questions and get answers from ChatGPT. I created this repository to make it easier for people who wants to see the ChatGPT response for their many questions.
- Query many questions and get answers from ChatGPT
- Save the questions and answers in a file ie.
qna.txt
- Python 3.6+
- requests and json libraries
- OpenAI API key
Go to OpenAI API and sign up for an account. You can create an API key by clicking on the Create new secret key
button. Copy the API key and paste it in the chatgpt.py
file. Note that the API key is a secret key, so don't share it with anyone and once created you can't see the same key again. So, make sure you copy the key and paste it in the chatgpt.py
file.
Enter your questions in the questions.txt
file. Each question should be in a new line. Every question should end within a line. For example, if you want to ask two questions, then your questions.txt
file should look like this:
How to send get request in python?
Transverse waves can propagate: (a) Both in a gas and in a metal (b) In a gas but not in a metal (c) Not in a gas but in a metal (d) Neither in a gas nor in a metal
git clone https://github.com/KisanThapa/ChatGPT-API.git
cd ChatGPT-API
If you are on Mac or Linux, run the following command
python3 chatgpt.py
If you are on Windows, run the following command
python chatgpt.py
You will see the questions and answers in the qna.txt
file.
If you want to contribute to this repository, feel free to create a pull request. I will review the pull request and merge it if it is good.
This project is licensed under the MIT License.
If you have any questions, feel free to contact me at
- LinkedIn: Kisan Thapa