chatgpt-api  by zhuweiyou

Free ChatGPT API wrapper

created 2 years ago
357 stars

Top 79.4% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a free, API-key-less wrapper around the web version of ChatGPT, targeting developers and users who want to integrate ChatGPT functionality without incurring API costs or managing API keys. It offers a local server that exposes endpoints for interacting with ChatGPT.

How It Works

The project leverages Node.js to create a local server that mimics the requests made by the official ChatGPT web interface. It bypasses the need for OpenAI API keys by using a user's web session access_token, obtained either through email/password login or by extracting it from browser developer tools after a manual web login. This approach allows for free usage of ChatGPT models, including GPT-4 for Plus subscribers, by essentially automating the web client interaction.

Quick Start & Requirements

  • Docker: docker run -d -p 3000:3000 zhuweiyou/chatgpt-api:20230424
  • Node.js: Requires Node.js 18.x. Install dependencies with npm install --production and start with npm start.
  • Prerequisites: OpenAI account (email/password login supported; Google/Microsoft OAuth login not supported for token retrieval).
  • Deployment: Can be deployed on platforms like Vercel, though free tiers have a 10-second timeout limit.
  • Documentation: https://chat.openai.com/chat

Highlighted Details

  • No API key required, uses web session authentication.
  • Supports both gpt-3.5-turbo and gpt-4 (for Plus users).
  • Allows for conversational context using conversation_id and parent_message_id.
  • Includes options for reverse proxies to bypass Cloudflare challenges.

Maintenance & Community

The project's README states it is not actively maintained due to the author's lack of time. It recommends alternative projects like acheong08/OpenAIAuth, pengzhile/pandora, and others for similar functionalities.

Licensing & Compatibility

The licensing is not explicitly stated in the provided README text. Compatibility for commercial use or closed-source linking would depend on the actual license.

Limitations & Caveats

The project is explicitly stated as not actively maintained. The method of obtaining access_token might be fragile and subject to change by OpenAI. Vercel's free tier deployment has a 10-second timeout, limiting its utility for longer responses. Accessing the official website for token retrieval might be blocked by network restrictions ("墙了").

Health Check
Last commit

2 years ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.