DEV Community

TokenHub
TokenHub

Posted on

How I built an OpenAI-compatible API relay for Chinese AI models

I wanted to use DeepSeek V3's API but found out you need a Chinese phone number (+86) and Alipay. Same problem with Qwen, GLM, Kimi — basically all top Chinese LLMs.

So I built a relay service that makes these models accessible through a standard OpenAI-compatible API.

The stack:

One API (open source) — routing, auth, quota, model mapping
Nginx — reverse proxy with rate limiting and auth gate
4 upstream channels — Aliyun, Zhipu, MiniMax, Qiniu
50+ models behind one endpoint
How to use:

from openai import OpenAI
client = OpenAI(
base_url="https://t-hub.cc/v1",
api_key="your_token"
)
response = client.chat.completions.create(
model="deepseek-v3",
messages=[{"role":"user","content":"Hello!"}]
)
Available models:

.DeepSeek V3 ($0.2/M tokens)
.DeepSeek V4 Pro ($0.3/M)
.DeepSeek R1 ($2/M)
.Qwen 3.7 Max ($1.6/M)
.GLM-5.1 ($2/M)
.GLM-4 Flash (FREE)
.Kimi K2.6 ($1.4/M)
.40+ more
Why I built this:
The Chinese AI ecosystem has incredible models at low prices (DeepSeek V3 is 75x cheaper than GPT-4o), but they're locked behind phone verification. This relay breaks down that barrier.

Happy to answer questions about the architecture or implementation.

Top comments (0)