reverse-engineered-chatgpt  by Zai-Kun

Python API for unofficial ChatGPT access

created 1 year ago
274 stars

Top 95.2% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides an unofficial, reverse-engineered Python API for interacting with OpenAI's ChatGPT web interface, enabling users to leverage ChatGPT's capabilities in their Python applications without requiring an official API key or a paid ChatGPT Plus subscription. It's designed for developers and users who want to integrate ChatGPT functionality into their projects cost-effectively.

How It Works

The library functions by reverse-engineering the HTTP requests made by the official ChatGPT web interface. It then simulates these requests directly from Python, effectively acting as an automated user of the web application. This approach bypasses the need for an API key, as it mimics the authentication and communication methods used by the browser.

Quick Start & Requirements

  • Primary install: pip install re-gpt
  • Prerequisites: Python >= 3.9
  • Session Token: Requires obtaining the __Secure-next-auth.session-token cookie from the chat.openai.com website.

Highlighted Details

  • Enables ChatGPT usage without an official API key or subscription.
  • Supports both synchronous (SyncChatGPT) and asynchronous (AsyncChatGPT) usage.
  • Allows for creating new conversations or retrieving existing ones via conversation_id.

Maintenance & Community

  • Active development indicated by TODO list.
  • Community support via Discord server.
  • Project is open for contributions.

Licensing & Compatibility

  • License: Apache License 2.0.
  • Compatible with commercial use and closed-source projects.

Limitations & Caveats

This is an unofficial API, meaning it is subject to change or breakage if OpenAI modifies its web interface or authentication mechanisms. Error handling is noted as an area for improvement in the project's TODO list.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.