ANYTHING HAPPENING TO YOUR ACCOUNT ISN'T MY LIABILITY, ALSO PLS CONTRIBUTE LIKE I M SO LAZY SKIPPED MULTIPLE STUFF.
A reverse-engineered Python client for DeepSeek AI that bypasses the web interface and provides direct API access with advanced features like deep thinking and web search capabilities.
- Direct API Access: Bypass the web interface and communicate directly with DeepSeek's backend
- Authentication Management: Automated login with session persistence and token management
- Interactive Chat Mode: Real-time conversation with streaming responses
- Single Prompt Mode: Execute one-off queries from command line
- Deep Thinking: Enable DeepSeek's advanced reasoning mode for complex problems
- Web Search Integration: Allow the AI to search the web for current information
- Session Persistence: Maintain conversation context across multiple interactions
- Proof of Work Solving: Automatically handle DeepSeek's anti-bot challenges using WebAssembly
- Rich Console Output: Beautiful terminal interface with colored status messages
- Headless Browser Automation: Seamless credential extraction without GUI interference
- Enhanced CLI Interface: Improved command-line experience with better argument parsing and help system
- FastAPI Web Server: RESTful API server for integrating DeepSeek into other applications
- File Upload Support: Upload and analyze documents, images, and other files
- Conversation History: Save and load previous chat sessions
- Multiple Model Support: Access different DeepSeek model variants
- Batch Processing: Process multiple prompts in sequence
- Configuration Management: Advanced settings and preferences system
final.mp4
- Clone the repository:
git clone https://github.com/aryaniiil/deepseek-reverse-api.git
cd deepseek-reverse-api- Install dependencies:
pip install -r requirements.txt- Set up your credentials:
- Copy your DeepSeek email and password to
data/.env:
- Copy your DeepSeek email and password to
DEEPSEEK_EMAIL=your_email@example.com
DEEPSEEK_PASSWORD=your_passwordStart an interactive chat session:
python main.pyAvailable commands during chat:
/think- Toggle deep thinking mode on/off/search- Toggle web search on/off/exit,/quit,/q- Exit the program
Execute a single query and exit:
python main.py "What is the capital of France?"Enable deep thinking for complex problems:
python main.py
> /think
> Explain quantum computing in simple termsUse web search for current information:
python main.py
> /search
> What are the latest developments in AI this week?Combine features:
python main.py
> /think
> /search
> Analyze the current state of renewable energy technologyreverse/
├── data/ # Data storage directory
│ ├── .env # Environment variables (credentials)
│ ├── auth_token.txt # Stored authentication token
│ ├── deepseek_cookies.json # Browser cookies
│ ├── last_login.txt # Last login timestamp
│ └── sha3_wasm_bg.wasm # WebAssembly module for PoW solving
├── src/ # Source code
│ ├── __init__.py
│ ├── auth.py # Authentication and credential extraction
│ ├── client.py # Main DeepSeek API client
│ ├── config.py # Configuration management
│ └── display.py # Terminal UI and formatting
├── main.py # Entry point
├── requirements.txt # Python dependencies
└── README.md # This file
- Checks for existing valid session
- If expired, launches headless browser
- Automatically fills login form
- Extracts cookies and auth token
- Stores credentials for future use
DeepSeek uses a WebAssembly-based proof of work system to prevent abuse. This client:
- Automatically requests PoW challenges
- Solves them using the included WASM module
- Includes solutions in API requests
- Sessions expire after 1 hour
- Automatic re-authentication when needed
- Conversation context maintained within sessions
- Graceful handling of network interruptions
- Setup and Installation - Step-by-step guide to get the client running
- Basic Usage Tutorial - Learn interactive and single prompt modes
- Authentication Troubleshooting - Fix common login issues
- Deep Thinking Mode - When and how to use advanced reasoning
- Web Search Integration - Leveraging real-time information
- Session Management - Understanding conversation persistence
- Code Architecture Overview - Understanding the codebase structure
- Adding New Features - Contributing to the project
- Debugging Common Issues - Troubleshooting guide for developers
Note: Video guides will be added as the project develops and reaches stable milestones.
- Python 3.8+
- Valid DeepSeek account
- Chrome/Chromium browser (for authentication)
- Internet connection
rich- Terminal formatting and colorsnodriver- Headless browser automationpython-dotenv- Environment variable managementrequests- HTTP client for API callswasmtime- WebAssembly runtime for PoW solving
Login Failed
- Verify credentials in
data/.env - Check internet connection
- Ensure DeepSeek account is active
Session Expired
- Delete
data/last_login.txtto force re-authentication - Check if DeepSeek changed their login process
PoW Challenge Failed
- Ensure
data/sha3_wasm_bg.wasmfile exists - Try restarting the client
Browser Issues
- Install/update Chrome or Chromium
- Check if browser automation is blocked by antivirus
- Credentials are stored locally in plain text
- Use environment variables for production deployments
- This tool is for educational and research purposes
- Respect DeepSeek's terms of service
Contributions are welcome! Focus areas:
- CLI improvements and user experience
- FastAPI integration for web services
- File upload functionality
- Bug fixes and performance optimizations
This project is for educational and research purposes. Please respect DeepSeek's terms of service and use responsibly.
This is a reverse-engineered client and is not officially supported by DeepSeek. Use at your own risk. The authors are not responsible for any issues that may arise from using this software.