mse_ai_api  by MohamedElsayed-debug

ChatGPT automation via a free OpenAI-compatible API

Created 2 months ago
253 stars

Top 99.3% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a free, OpenAI-compatible API by automating ChatGPT's web interface, targeting developers and users of tools like n8n who need to integrate AI capabilities without incurring API costs. It offers a seamless drop-in replacement for standard OpenAI API calls, enabling advanced AI agent features like reliable tool calling.

How It Works

The core of mse_ai_api is a FastAPI proxy server that utilizes Playwright to automate a detached Chrome browser instance. This AsyncBrowserThread runs in the background, employing anti-bot bypass techniques to mimic a real user session. It intelligently injects prompts and system instructions to ensure ChatGPT outputs valid JSON, which is then parsed using regex to conform to OpenAI's function calling schema. This approach allows for robust tool execution and avoids the strict JSON validation errors common in other methods.

Quick Start & Requirements

  • Primary install / run command: Docker is recommended. Clone the repository, navigate to the directory, and run docker-compose up --build -d. The server starts on http://localhost:7777. Manual installation requires Python 3.10+; run pip install -r requirements.txt followed by python main.py.
  • Non-default prerequisites: Docker installation. Manual installation requires Python 3.10+.
  • Configuration: The API_SECRET_KEY can be configured (default: change-secret-key-2026).
  • Links: Full tutorial available on YouTube.

Highlighted Details

  • Zero API Costs: Leverages ChatGPT's free web interface, eliminating per-request charges.
  • OpenAI-Compatible: Functions as a drop-in replacement for OpenAI API clients.
  • Advanced n8n Agent Support: Reliably handles ChatGPT tool calling and JSON parsing for n8n workflows.
  • Dockerized Deployment: Simplifies setup and dependency management with a single command.

Maintenance & Community

The project is maintained by Mohamed Elsayed. Contact information for inquiries, including the PRO version, is available via Telegram, LinkedIn, Facebook, and GitHub. Sponsorships are acknowledged.

Licensing & Compatibility

  • License type: MIT License.
  • Compatibility notes: Designed for compatibility with OpenAI API clients and n8n. The project disclaimer advises that usage must comply with the terms of service of the underlying platforms (ChatGPT).

Limitations & Caveats

This version is primarily for personal and educational use and lacks features found in the PRO version, such as image analysis, an admin dashboard, multi-user management, and usage statistics. Usage must adhere to the terms of service of the automated web platforms.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

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

Explore Similar Projects

Feedback? Help us improve.