An enterprise-grade, local Reverse Proxy server that exposes the DeepSeek Chat Web UI as a strictly compliant standard OpenAI/OpenRouter REST API endpoint.
This project orchestrates a hidden Microsoft Edge browser using Playwright to securely solve DeepSeek's Cryptographic WebAssembly Proof-of-Work headers natively. It allows you to use DeepSeek entirely for free inside Cursor, VSCode Extensions, or any standard AI chat client!
- 100% Free & Unlimited: Uses your actual browser session to interact with the UI.
- OpenAI Compatible: Exposes exactly the
/v1/chat/completionsschema so drop-in replacement works anywhere. - Smart Stream AI Detection: No hardcoded waits! Actively monitors the Live DOM for text-generation stability length mapping. Supports 5-paragraph essays seamlessly.
- Anti-Bot Stealth: Automatically deletes
navigator.webdriverexecution flags to inherently bypass Google authentication blocks. - Persistent Sessions: Safely shuts down on
SIGINTso your login cookies are securely flushed to your local hard drive.
- Node.js installed
- Microsoft Edge installed (used by default to bypass strict bot filters).
Clone this repository and install the dependencies: ```bash git clone https://github.com/your-username/deepseek-proxy.git cd deepseek-proxy
npm install ```
Create a `.env` file in the root directory: ```env PORT=3000 PLAYWRIGHT_HEADLESS=false PLAYWRIGHT_CHANNEL=msedge ``` (Tip: Keeping `headless=false` initially helps you log into DeepSeek securely. Once logged in, you can set it to `true` to run silently!)
```bash node server.js ``` (On the very first launch, the Playwright window will open. Please log into Google/DeepSeek manually. The server will keep this session saved forever!)
You can now point any script, Extension, or App to http://localhost:3000/v1 just as if it were OpenAI.
Example cURL: ```bash curl -X POST http://localhost:3000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-web", "messages": [ { "role": "user", "content": "Write a 3-word poem." } ] }' ```
- Request hits Express
chatController.js. - The prompt translates into UI clicks pushed perfectly to a queued
BrowserManager.jsSingleton. - Edge natively solves the
x-ds-pow-responserequirement in the background. - Smart Poller scans for
.ds-markdownDOM changes until consecutive text-length stabilization. - DOM Text scraped -> JSON formatted -> Response returned cleanly.
MIT