Skip to main content

An unofficial API allowing free interaction with ChatGPT in Python

Reason this release was yanked:

Broken release

Project description

pyGPT

Tag Downloads

An (unofficial) ChatGPT API made by yoinking code from revChatGPT and adapting it to use tls-client.

Installation

pip install pyGPT_api

Getting started

An access token is required for this package to run correctly. You can get yours here or open the chat.openai.com webpage, access the developer console, and get the token from Application -> Cookies -> __Secure-next-auth.session-token.

Below is a basic example that will create an infinitely looping conversation.

from pyGPT-api import AI
from uuid import uuid4

ai = AI("your_token_here")
while True:
    message = ""
    for data in ai.send_message(input(" > "), None, str(uuid4())):
        message = data["message"]
    print("\nChatGPT:", message, "\n")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyGPT-api-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyGPT_api-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pyGPT-api-0.1.0.tar.gz.

File metadata

  • Download URL: pyGPT-api-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for pyGPT-api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1e8e08dc3e90b7e0f2ec2fcac1700950dd71f9b57c0484533fb1d4e375d3bd60
MD5 3e6c0772177260b2c66ddf13254d8940
BLAKE2b-256 7cfaefb6d2a1d4cce508e77b8a535999958cb1911cfea34f020c3861f92dd236

See more details on using hashes here.

File details

Details for the file pyGPT_api-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyGPT_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for pyGPT_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82ebb664ee6440e0234eb917145b4b46bbff3597b0acdf59140cff8958fd48d7
MD5 107bcb3f12a1b137068b4aef6dd76599
BLAKE2b-256 54b8897a969d5207b05c04108a6d7405e6d733c1752ea40d24a8c882ff6f1ad7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page