
One API
Self-hosted gateway that exposes many LLM providers through one OpenAI-style API with key management.
- Stars
- 37.3k
- Forks
- 6.9k
- Licence
- MIT
- Language
- JavaScript
- Last update
- 10 months ago
- Type
- App
What it is
One API is a self-hosted web service that sits between your apps and many large language model providers such as OpenAI, Azure, Claude, Gemini and DeepSeek. Clients send requests in the standard OpenAI API format, and One API translates them to each provider. It also includes a web admin panel for issuing tokens, setting quotas, and managing channels.
- Point an existing OpenAI-compatible app at One API and switch between providers without code changes
- Create separate API tokens with expiry dates, quotas, and allowed models for different users
- Spread requests across several provider channels with automatic retry on failure
- Show usage detail and balances per user or group
Great for
- Developers who want one OpenAI-compatible endpoint for several model providers
- Small teams or groups who need to issue and limit API keys to members
- Operators who want load balancing or retries across multiple provider channels
- People comfortable running a Docker container or a Go binary on a server
Not ideal for
- Users who only call one provider and do not need a gateway, since it adds a service to run
- Anyone who needs a fully managed hosted service, because this is software you deploy and maintain yourself
- Those who cannot verify compliance with local AI service rules, since the README asks users to follow OpenAI terms and applicable law and warns about unregistered public services in China
How to get it
- 1
Run with Docker
You'll need: Docker
Run with SQLite using Docker
docker run --name one-api -d --restart always -p 3000:3000 -e TZ=Asia/Shanghai -v /home/ubuntu/data/one-api:/data justsong/one-api - 2
Run it
- Run the Docker command from the README to start the container on port 3000.
- Open http://localhost:3000/ in a browser.
- Log in as root with password 123456 and change the password immediately.
- Add a provider channel and then create a token for your app.
- 3
Get the most out of it
- Set SQL_DSN to a MySQL database when expecting higher concurrency, as the README advises
- Enable Redis with REDIS_CONN_STRING for multi-server deployments to reduce database load
- Use the system access token and the API documentation in docs/API.md to automate administration
- Configure a Cloudflare AI Gateway proxy URL on a channel if you use that service
- Use Message Pusher to send alert messages to apps
Downloads
Strengths
- Single OpenAI-format interface across many listed providers
- Ships as a single executable or Docker image, per the README
- Includes token, quota, channel, and user-group management in one admin UI
Trade-offs
- The README warns to change the default root password (123456) immediately after first login
- Some features such as model mapping can change request bodies and drop fields not yet supported
- High concurrency requires setting SQL_DSN, so a production setup likely involves a database beyond the default
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| one-api (this) | 37.3k | App | intermediate | 10 months ago | Developers who want one OpenAI-compatible endpoint for several model providers |
| GPT_API_free | 45.3k | Other | beginner | 7 days ago | Students and researchers doing non-commercial experiments with LLM APIs |
| LibreChat | 46.6k | App | intermediate | 4 days ago | Teams that want one shared chat interface across several AI providers |
| repomix | 29.1k | CLI | beginner | 4 days ago | Developers who want to ask an AI assistant questions about a whole project |
| watermarks-remover | 25.9k | AI model / agent | intermediate | 5 days ago | Developers who use AI coding agents and want written files scrubbed of provenance metadata |
| opencodex | 18.2k | Dev tool | intermediate | 4 days ago | Developers who already use Codex or Claude Code and want to try other model providers |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.