go-chatgpt-api  by linweiyuan

Reverse-proxy for ChatGPT, bypassing Cloudflare

created 2 years ago
1,407 stars

Top 29.5% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Go-based server that attempts to bypass Cloudflare protection to access OpenAI's ChatGPT API. It targets developers and users who need to integrate ChatGPT functionality into their applications or use it with clients that expect an OpenAI-compatible API, offering a "free" API endpoint using a ChatGPT access token.

How It Works

The core approach involves simulating browser interactions to obtain an accessToken from chat.openai.com or an apiKey from platform.openai.com. It then exposes these credentials via a local HTTP server, mimicking the official OpenAI API structure. This allows applications configured for the standard API to connect to the local server, which in turn forwards requests to OpenAI, effectively bypassing Cloudflare challenges for the end-user.

Quick Start & Requirements

  • Install/Run: Docker is the primary method. A sample docker-compose.yaml is provided.
  • Prerequisites: Docker, Docker Compose. For GPT-4, arkose_token generation is required, with community solutions linked. Proxy configuration (via PROXY environment variable) is supported for network access.
  • Setup Time: Minimal if Docker is installed.
  • Links: Example Usage, Configuration Video

Highlighted Details

  • Supports GPT-3.5 and GPT-4 models.
  • Offers a /imitate/v1/chat/completions endpoint to mimic the official API using accessToken.
  • Can be integrated with various third-party clients like ChatGPT-Next-Web, Pandora, and QQ bots.
  • Supports proxy configuration, including SOCKS5 and authentication.

Maintenance & Community

The project explicitly states it is "dead" and "may not be supported" as of October 24, 2023. Discussions are preferred over Issues for questions. A community chat link is provided.

Licensing & Compatibility

The license is not explicitly stated in the provided README snippet. Compatibility for commercial use or closed-source linking is not specified, and given the project's nature of bypassing restrictions, caution is advised.

Limitations & Caveats

The project is marked as "dead" and documentation is outdated. GPT-4 requires manual arkose_token generation, which can be complex. The service is not guaranteed to be highly available, and account security issues are disclaimed.

Feedback? Help us improve.