This is a fun project, aim to provides a chat API that is compatible with OpenAI API endpoint, based on UnlimitedGPT
- Python, pip installed
- Chrome browser
git clone https://github.com/hieunc229/UnlimitedGPT-API
# Windows
pip install UnlimitedGPT -U python-dotenv
# Linux/macOS
pip3 install UnlimitedGPT -U python-dotenv
There are 4 options available
- session_token=(your ChatGPT session token, see Get your session_token below)
- conversation_id=(your ChatGPT conversation id, see Get your conversation_id below)
- host=(your host address,
localhost
) - port=(your server port,
8080
)
Note that your server will be available as http://host:port
(or http://localhost:8080
if you leave it as default)
Run the following command to start the server
# Windows
python main.py
# Linux/macOS
python3 main.py
It'll take sometimes to start and connect with ChatGPT website.
Wait until you see Server started at http://host:port
- Go to https://chat.openai.com/chat and open the developer tools by
F12
. - Find the
__Secure-next-auth.session-token
cookie inApplication
>Storage
>Cookies
>https://chat.openai.com
. - Copy the value in the
Cookie Value
field.
- Go to https://chat.openai.com/chat
- Click on any conversation, then take the part of the URL that comes after https://chat.openai.com/c/
Example: The conversation ID in the URL https://chat.openai.com/c/aa4f2349-8090-42a8-b8dc-0d116ce6b712 is aa4f2349-8090-42a8-b8dc-0d116ce6b712
When the server has started, a POST
method is available.
Example request
curl http://localhost:8080 \
-X POST
-d '{ "messages": [{ "content": "Hello!" }] }'
Note that it'll only take the content from the last item of messages
In case you want to try it on GasbyAI.com, complete setting up the server step above. Then:
- Choose
Custom Service
fromProvider
option - Enter your server endpoint (http://localhost:8080 by default), leave API Key empty
- Click test to see if it's good
This project is not affiliated with OpenAI in any way. Use at your own risk. I am not responsible for any damage caused by this project. Please read the OpenAI Terms of Service before using this project.
This project is licensed under the GPLv3 License - see the LICENSE file for details.