pyChatGPT  by terry3041

Python wrapper for OpenAI's ChatGPT API

created 2 years ago
1,352 stars

Top 30.4% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides an unofficial Python wrapper for OpenAI's ChatGPT API, designed for developers and researchers needing programmatic access to ChatGPT. It aims to bypass Cloudflare's anti-bot protection and supports various authentication methods, including session tokens and direct login with Google, Microsoft, or OpenAI accounts, with options for captcha solving.

How It Works

The library leverages undetected_chromedriver to circumvent Cloudflare's anti-bot measures, a significant advantage over simpler request-based wrappers. It supports direct login via Google, Microsoft, or OpenAI credentials, with experimental features for captcha solving using services like 2Captcha or PyPasser. The architecture allows for proxy usage, custom Chrome arguments, and session token management for authentication.

Quick Start & Requirements

  • Install: pip install -U pyChatGPT
  • Prerequisites: Google Chrome or Chromium browser.
  • Setup: Requires obtaining a __Secure-next-auth.session-token cookie from the ChatGPT web interface or using login credentials. Running on headless Linux requires xvfb and chromium-browser.
  • Docs: https://github.com/terry3041/pyChatGPT

Highlighted Details

  • Bypasses Cloudflare's anti-bot protection using undetected_chromedriver.
  • Supports OpenAI, Google, and Microsoft login methods.
  • Integrates with captcha solvers (2Captcha, PyPasser) and offers manual solving options.
  • Enables proxy support and custom Chrome arguments for advanced configurations.

Maintenance & Community

The project's original author has stopped maintenance, recommending users switch to the official OpenAI API. The repository is open for forking and continued development.

Licensing & Compatibility

  • License: GPLv3.
  • Compatibility: The GPLv3 license may impose copyleft restrictions on derivative works, potentially impacting commercial or closed-source integrations.

Limitations & Caveats

The project is explicitly marked as unmaintained by its original author, who directs users to the official OpenAI API. The experimental login methods and captcha solvers may be unstable or break with API changes.

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.