Skip to main content

UnlimitedGPT

PyPi License

This is a maintained, modified and improved package of the original pyChatGPT package. The original package is in slow development and has many issues. This package is actively maintained and updated.

An unofficial Python wrapper for OpenAI's ChatGPT API

Features

Getting Started

This library is using only the undetected_chromedriver package to bypass Cloudflare's anti-bot protection. requests module is not used due to the complexity of the protection. Please make sure you have Google Chrome / Chromium before using this wrapper.

Installation

pip install -U UnlimitedGPT

Usage

Obtaining session_token

  1. Go to https://chat.openai.com/chat and open the developer tools by F12.
  2. Find the __Secure-next-auth.session-token cookie in Application > Storage > Cookies > https://chat.openai.com.
  3. Copy the value in the Cookie Value field.

image

Interactive mode

Currently, interactive mode is not supported in this package. But it will be added in the future.

Import as a module

from UnlimitedGPT import ChatGPT

session_token = 'abc123'  # `__Secure-next-auth.session-token` cookie from https://chat.openai.com/chat
api = ChatGPT(session_token)  # auth with session token
api = ChatGPT(session_token, conversation_id='some-random-uuid')  # specify conversation id
api = ChatGPT(session_token, proxy='https://proxy.example.com:8080')  # specify proxy
api = ChatGPT(session_token, chrome_args=['--window-size=1920,768'])  # specify chrome args
api = ChatGPT(session_token, disable_moderation=True)  # disable moderation
api = ChatGPT(session_token, verbose=True)  # verbose mode (print debug messages)

message = api.send_message('Hello, world!')
print(message.response, message.conversation_id)

api.reset_conversation()  # reset the conversation

Frequently Asked Questions

How do I get it to work on headless linux server?

# install chromium & X virtual framebuffer
sudo apt install chromium-browser xvfb

# start your script
python3 your_script.py

How do I get it to work on Google Colab?

It is normal for the seession to be crashed when installing dependencies. Just ignore the error and run your script.

# install dependencies
!apt install chromium-browser xvfb
!pip install -U selenium_profiles UnlimitedGPT

# install chromedriver
from selenium_profiles.utils.installer import install_chromedriver
install_chromedriver()
# start your script as normal
!python3 -m UnlimitedGPT

Insipration

This project is inspired by

Disclaimer

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.

License

This project is licensed under the GPLv3 License - see the LICENSE file for details.

Metadata

Release files for UnlimitedGPT 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for UnlimitedGPT 0.0.7
File Size Uploaded
UnlimitedGPT-0.0.7.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for UnlimitedGPT 0.0.7
File Interpreter ABI Platform
UnlimitedGPT-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / UnlimitedGPT-0.0.7.tar.gz

Download URL UnlimitedGPT-0.0.7.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c0b8e39f03ae0a9e11b8c8cf23d4cbbf852bef22e4984835cc8c3214bab51fb5
BLAKE2b-256 checksum
How to use checksums
839d7638f64e13e9833d641e4152d3d3cf6931747aa6e53e764eb764c3fa749b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / UnlimitedGPT-0.0.7-py3-none-any.whl

Download URL UnlimitedGPT-0.0.7-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fcebdb7f12f0e3b394a56fc02963b1b836d333ea2e0df6fa09ace29bbb7282e
BLAKE2b-256 checksum
How to use checksums
1822c061157289ba2211e4429ac8b65d493a556e798be37efc320a1c5784d53e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

This release

0.0.7 This release

2 release files

0.0.6

3 release files

0.0.5

2 release files

0.0.4

3 release files

0.0.3

1 release file

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page