One API (36,211 Stars) LLM Gateway Setup 2026: One Key for OpenAI, Claude, Gemini and DeepSeek
one-api (36,211 stars) is the most-starred LLM API gateway: it unifies OpenAI, Azure, Claude, Gemini, DeepSeek and Doubao behind one key. Here is the full self-host setup.
💡 What You Will Learn
one-api (36,211 stars) is the most-starred LLM API gateway: it unifies OpenAI, Azure, Claude, Gemini, DeepSeek and Doubao behind one key. Here is the full self-host setup.
📜 Table of Contents
The short answer
songquanpeng/one-api (36,211 stars, JavaScript) is an LLM API management and distribution system. It aggregates dozens of providers - OpenAI, Azure, Anthropic Claude, Google Gemini, DeepSeek, ByteDance Doubao, Zhipu, and more - behind a single OpenAI-compatible endpoint. You hand your team one key, and one-api routes, meters, and rate-limits every request.
Why teams run it
- One base URL for all models:
http://your-server:3000/v1 - Per-user quotas and tokens: create keys per member, cap spending per day
- Cost tracking: logs every request with model, token count and price
- Model fallback: if one provider fails, requests fail over to a backup
Deploy in 10 minutes
- Run the container (SQLite mode is fine for small teams):
docker run --name one-api -d --restart always \n -p 3000:3000 -v /data/one-api:/data \n ghcr.io/songquanpeng/one-api:latest
- Open http://localhost:3000, default admin is
root/123456(change it immediately). - Go to Channels - Add Channel: pick provider (e.g. OpenAI), paste the API key.
- Go to Tokens - create a token; that is the single key your apps will use.
- Point any OpenAI SDK at
http://localhost:3000/v1with the new token.
Practical notes
- Enable Model Ratio settings to control price multipliers per model.
- Use the Logs page to catch abuse - you can see each user token spend in real time.
- For production, back up
/data(the SQLite DB or MySQL) daily.
FAQ
Is it compatible with the OpenAI SDK? Yes - it exposes /v1/chat/completions exactly like OpenAI, so LangChain, Open WebUI and most tools work unchanged.
Can it route to local models? Yes, add a channel pointing at Ollama or vLLM and serve local and cloud models through the same key.
Does it support Chinese providers? Yes - DeepSeek, Doubao, Qwen, Zhipu and others are built-in presets.
❓ FAQ
Is it compatible with the OpenAI SDK?
Yes - it exposes `/v1/chat/completions` exactly like OpenAI, so LangChain, Open WebUI and most tools work unchanged.
Can it route to local models?
Yes, add a channel pointing at Ollama or vLLM and serve local and cloud models through the same key.
Does it support Chinese providers?
Yes - DeepSeek, Doubao, Qwen, Zhipu and others are built-in presets.
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only โ no paid placements.
