Skip to main content

An unofficial API allowing free interaction with ChatGPT in Python

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 let you converse with ChatGPT as much as you'd like.

from pyGPT_api import AI

ai = AI("your_token_here")
while True:
    message = ""
    for data in ai.send_message(input(" > ")):
        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.2.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.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyGPT-api-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f735b8147c2615a0816d33f927a1262c7f09615fc07d6c350d238335eeab44d1
MD5 0e48b0e7405630853a0d3f37af200c76
BLAKE2b-256 2b92c117ab40bf6a897ad4a74f5f21314f12e4dcae2ee6d6dd137fbe24b74ee6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyGPT_api-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1fdf41232379d55c9652b6ea3f3f9b133c2ccc1aa783628e39d90af07db378f2
MD5 17122b83353ca04d3978dcb465bd5c25
BLAKE2b-256 b9802c14c49b4275d5903017b917dac281aa46f257a9a2a8315f54e98cd4c5ef

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