DS2API: Turning DeepSeek into an OpenAI‑Compatible API
DS2API is an open‑source Go‑based service that converts DeepSeek’s web interface into OpenAI, Claude, and Gemini compatible APIs, offering multi‑API support, account pool management, long‑history handling, PoW verification, and a React admin UI, with simple Docker deployment.
DS2API is a recently popular open‑source project on GitHub that transforms the DeepSeek web interface into APIs compatible with OpenAI, Claude, and Gemini.
Core Features
OpenAI compatibility: chat/completions, responses, files, embeddings
Claude compatibility: /anthropic/* and /v1/messages
Gemini compatibility: /v1beta/models/ and /v1/models/
Account pool management with concurrent slots and a waiting queue for multiple DeepSeek accounts
Long‑history handling that automatically files oversized context to stay within limits
Built‑in Proof‑of‑Work verification, implemented purely in Go
WebUI admin panel built with a React frontend
Technical Architecture
The system uses a Go backend together with a React frontend. The request flow is:
client → chi Router → PromptCompat → Chat Runtime → DeepSeek APIPromptCompat translates OpenAI/Claude/Gemini request formats into the plain‑text context format required by DeepSeek.
Quick Start
Docker deployment :
git clone https://github.com/CJackHwang/ds2api.git
cd ds2api
docker-compose up -dConfiguration : copy the example config and fill in your DeepSeek account credentials. cp config.example.json config.json Usage : after starting the service, open http://localhost:8080/admin for the management UI, or call the API directly with an OpenAI‑compatible SDK. Example in Python:
from openai import OpenAI
client = OpenAI(api_key="your-api-key", base_url="http://localhost:8080/v1")
response = client.chat.completions.create(
model="deepseek-chat",
messages=[{"role": "user", "content": "Hello!"}]
)Applicable Scenarios
Developers needing OpenAI/Claude‑style interfaces to call DeepSeek
Existing applications that want to switch to a DeepSeek backend quickly
Testing and development environments
Disclaimer : the project is intended for learning and research only and must not be used in ways that violate service terms.
GitHub: https://github.com/CJackHwang/ds2api<br/>Stars: 2,477<br/>Language: Go
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Geek Labs
Daily shares of interesting GitHub open-source projects. AI tools, automation gems, technical tutorials, open-source inspiration.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
