Open Source · MIT License · GitHub

Chinese AI Models,
One API.

Self-hosted OpenAI-compatible gateway for DeepSeek, Qwen, GLM, and Kimi. Deploy on your server. Use your own keys. No third-party middleman.

Demo Endpoint https://scdqigate.xyz/v1/chat/completions

5-Minute Deploy

One command. Your server. Your keys.

Terminal
# Clone and start
git clone https://github.com/AAAjczz/chinai-gateway.git
cd chinai-gateway
cp .env.example .env
# Add your DeepSeek API key to .env
docker compose up -d

# That's it. Your gateway is live at localhost:4000
curl -X POST http://localhost:4000/v1/chat/completions \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-chat","messages":[{"role":"user","content":"Hi"}]}'

Why Self-Host?

🔑

Your Keys, Your Data

API keys never leave your server. No third party sees your requests or responses.

💰

Massive Cost Savings

Chinese models cost ¥1–20 per million tokens. Western models? $5–15. That's 10–50x cheaper.

🔌

OpenAI-Compatible

Drop-in replacement. Works with any OpenAI SDK, LangChain, AutoGPT, or ChatGPT client.

🖥️

Admin Dashboard

Built-in UI for usage tracking, virtual keys, rate limiting, and cost monitoring.

🌐

10+ Models, One Endpoint

Switch between DeepSeek, Qwen, GLM, and Kimi by changing one model name. No code changes.

📦

Runs on a $2 VPS

~400 MB RAM. Fits alongside your other services. No GPU needed.

Supported Models

DeepSeek-V3
deepseek-chat
¥1 / ¥2 per 1M tokens
General Chat 64K Context
DeepSeek-R1
deepseek-reasoner
¥4 / ¥16 per 1M tokens
Math & Logic Chain-of-Thought
Qwen-Plus
qwen-plus
¥2 / ¥6 per 1M tokens
Chinese Text 128K Context
Qwen-Max
qwen-max
¥20 / ¥60 per 1M tokens
Best Chinese Flagship
GLM-4-Plus
glm-4-plus
¥1 / ¥4 per 1M tokens
Tool Calling 128K Context
GLM-4-Flash
glm-4-flash
Free
Speed Free Tier
Kimi
kimi
¥12 / ¥12 per 1M tokens
File Reading 8K Context
Kimi-128K
kimi-128k
¥60 / ¥60 per 1M tokens
Long Docs 128K Context

Clients & SDKs

Python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_MASTER_KEY",
    base_url="http://localhost:4000/v1"
)

response = client.chat.completions.create(
    model="deepseek-chat",
    messages=[{"role": "user", "content": "Hello!"}]
)

Works with any OpenAI-compatible client: ChatGPT desktop apps, Cursor, LangChain, LlamaIndex, AutoGPT, and more.