Skip to content

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
Step-by-step guide: how to use One APIInstall, first run, examples, tips and FAQs

How to get it

  1. 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. 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. 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

ProjectStarsTypeLevelUpdatedBest for
one-api (this)37.3kAppintermediate10 months agoDevelopers who want one OpenAI-compatible endpoint for several model providers
GPT_API_free45.3kOtherbeginner7 days agoStudents and researchers doing non-commercial experiments with LLM APIs
LibreChat46.6kAppintermediate4 days agoTeams that want one shared chat interface across several AI providers
repomix29.1kCLIbeginner4 days agoDevelopers who want to ask an AI assistant questions about a whole project
watermarks-remover25.9kAI model / agentintermediate5 days agoDevelopers who use AI coding agents and want written files scrubbed of provenance metadata
opencodex18.2kDev toolintermediate4 days agoDevelopers 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.