Python API for unofficial ChatGPT access
Top 95.2% on sourcepulse
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
pip install re-gpt
__Secure-next-auth.session-token
cookie from the chat.openai.com website.Highlighted Details
SyncChatGPT
) and asynchronous (AsyncChatGPT
) usage.conversation_id
.Maintenance & Community
Licensing & Compatibility
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.
1 year ago
1 day