Self-hosted OpenAI-compatible gateway for DeepSeek, Qwen, GLM, and Kimi. Deploy on your server. Use your own keys. No third-party middleman.
One command. Your server. Your keys.
# 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-v4-pro","messages":[{"role":"user","content":"Hi"}]}'
API keys never leave your server. No third party sees your requests or responses.
Chinese models cost ¥1–20 per million tokens. Western models? $5–15. That's 10–50x cheaper.
Drop-in replacement. Works with any OpenAI SDK, LangChain, AutoGPT, or ChatGPT client.
Built-in UI for usage tracking, virtual keys, rate limiting, and cost monitoring.
Switch between DeepSeek, Qwen, GLM, and Kimi by changing one model name. No code changes.
~400 MB RAM. Fits alongside your other services. No GPU needed.
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.