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.

Geek Labs
Geek Labs
Geek Labs
DS2API: Turning DeepSeek into an OpenAI‑Compatible API

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 API

PromptCompat 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 -d

Configuration : 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
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DockerReactGoDeepSeekOpenAI APIAPI compatibilityDS2API
Geek Labs
Written by

Geek Labs

Daily shares of interesting GitHub open-source projects. AI tools, automation gems, technical tutorials, open-source inspiration.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.