Status: [UNTESTED] Endpoints found: http://localhost:4000/api/chat http://localhost:4000/api/chat` Source: https://github.com/pranavsaykar8209/chatgpt-free-api # ChatGPT Free API (Web Flow Client) A simple Node.js / TypeScript project that lets you interact with ChatGPT without needing an API key or account by simulating the unauthenticated ChatGPT web application flow. --- ## 📌 What is this project? This project is a **Free ChatGPT API Server & Client**. It works by simulating how the ChatGPT web browser application communicates behind the scenes. You can run it locally to: - Send prompts and get AI answers completely **free** without an official API key. - Stream responses in real-time right in your terminal. - Host a local REST API server (`http://localhost:4000/api/chat`) for your own frontend or backend projects. - Test and analyze the underlying network communication protocol. --- ## 🚀 How to Use ### 1. Installation Clone the repository and install dependencies: ```bash # Clone the repository git clone https://github.com/pranavsaykar8209/chatgpt-free-api.git cd chatgpt-web-flow # Install Node.js dependencies npm install # Build the project npm run build ``` --- ### 2. Run as a Local REST API Server Start the REST API server on port 4000: ```bash npm run api ``` Now you can send prompt requests from any frontend, backend, Python script, or cURL! #### Example Request (cURL): ```bash curl -X POST http://localhost:4000/api/chat \ -H "Content-Type: application/json" \ -d '{"prompt": "What is Python?"}' ``` #### Example Response (JSON): ```json { "prompt": "What is Python?", "answer": "Python is a high-level, interpreted programming language known for its clear syntax and versatility.", "status": "completed" } ``` #### Example Request (JavaScript / Fetch): ```javascript const res = await fetch("http://localhost:4000/api/chat", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ prompt: "Explain recursion in simple terms." }) }); const data = await res.json(); console.log(data.answer); ``` --- ### 3. Run directly in Terminal (CLI) You can ask