Fly143/deepseek-free-api
将 DeepSeek 网页端免费对话(chat.deepseek.com)转换为 OpenAI + Anthropic 兼容 API(Chat Completions / Responses / Anthropic Messages)支持工具调用(Function Calling)、动态模型发现、PoW 自动求解、Token 自动刷新。
What it solves
This project provides a proxy that converts the free web-based chat interface of DeepSeek (chat.deepseek.com) into a standard OpenAI-compatible API. This allows users to integrate DeepSeek's free models into third-party LLM clients (like ChatBox or LobeChat) without needing an official paid API key.
How it works
The proxy is built with FastAPI and uses curl_cffi to simulate Chrome TLS fingerprints, avoiding the need for heavy browser automation. It handles the complex requirements of the DeepSeek web API, including:
- PoW (Proof of Work) Solving: Automatically solves challenges using a Node.js WASM solver or a Python fallback to authorize requests.
- Token Management: Automatically refreshes session tokens using stored credentials when a 401 error is detected.
- Dynamic Model Discovery: Periodically probes the official API to update the list of available models and their capabilities (e.g., reasoning, search).
- Protocol Translation: Maps OpenAI-style requests to DeepSeek's internal API and converts responses (including reasoning tags) back into OpenAI-compatible formats.
Who it’s for
- Developers and AI enthusiasts who want to use DeepSeek's free web models via an API.
- Users of third-party LLM interfaces who prefer the DeepSeek ecosystem but lack API access.
- Those looking for a lightweight alternative to browser-automation-based proxies.
Highlights
- Broad API Compatibility: Supports OpenAI
/v1/chat/completions, the new OpenAI Responses API, and the Anthropic Messages API. - Multimodal Support: Handles image uploads for Vision models and text file uploads for standard models.
- Automated Account Management: Includes a web-based admin panel for login and a bulk account registration system to mitigate the risk of account bans.
- Deep Reasoning Integration: Specifically handles
<thought>tags, separating reasoning content from the final answer in streaming responses. - Tool Use Emulation: Implements tool calling via DSML prompt injection and multiple extraction strategies since the web API does not natively support function calling.
Related
- Project
- Project
- Project
- Project