TLS-based API (Python) logo

TLS-based API (Python)

Free

Python client for the ChatGPT API with conversation tracking, proxy support and more.

FreeFree tier
Inputs: textOutputs: text
Type
Open Source

About TLS-based API (Python)

PyChatGPT is an open-source Python client for the unofficial ChatGPT API, offering features like automatic login, conversation tracking, proxy support, and the ability to save and resume conversations. It provides both a programmatic interface via the Chat object and a CLI chat mode. The client automatically manages access tokens, refreshes them when expired, and includes a web demo built with Gradio hosted on HuggingFace Spaces.

Key Features

Automatic login without involving a browser
Automatic access token retrieval and refresh
Proxy support for diverse network setups
Conversation tracking and saving to file
Resume conversations after program restart
CLI chat mode for interactive use
Web demo integrated with Gradio on Hugging Face
Colorama output for colored console text
Customizable session options (moderation, logging, proxies)

Pros & Cons

Pros
  • Open-source and free to use
  • Easy installation via `pip install chatgptpy`
  • Automatic token management bypasses captcha and re-login
  • Supports proxies for privacy and network flexibility
  • Conversation history persistence across sessions
  • Dual interface: programmatic API and interactive CLI
  • Web demo available for quick testing without coding
Cons
  • Requires ChatGPT account credentials (email/password)
  • Uses an unofficial API that may break unexpectedly
  • Reverse-engineered approach may violate OpenAI's terms of service
  • No built-in rate limiting or request scheduling
  • Limited to ChatGPT model; not compatible with other OpenAI APIs
  • Not intended for production use due to instability

Best For

Building conversational agents and chatbots with ChatGPTAutomating ChatGPT interactions for experimentation or testingIntegrating ChatGPT into Python applicationsEducational projects exploring ChatGPT API behaviorProxy-protected or anonymous usage of ChatGPT

FAQ

How do I install PyChatGPT?
Install via pip: pip install chatgptpy --upgrade
Can I resume a conversation after closing the program?
Yes, pass the conversation_id and previous_convo_id when creating the Chat object to resume a previous conversation.
Does PyChatGPT support proxies?
Yes, you can set a proxy using the options.proxies parameter in the Options object.
Is there a graphical interface for PyChatGPT?
Yes, a web demo built with Gradio is hosted on HuggingFace Spaces at the provided link.
How does PyChatGPT handle login and authentication?
It automatically logs in without a browser, retrieves the access token, saves it to a file, and refreshes it when it expires.