one-api  by songquanpeng

LLM API management/redistribution system for OpenAI, Gemini, Claude, etc

created 2 years ago
26,440 stars

Top 1.5% on sourcepulse

GitHubView on GitHub
Project Summary

One API is a comprehensive LLM API management and distribution system designed for developers and power users. It unifies access to numerous large language models, including OpenAI, Azure, Anthropic Claude, Google Gemini, and many others, under a single, standard OpenAI-compatible API format. This system simplifies key management, enables redistribution, and offers features like load balancing, token management, and user/group management, providing a flexible and scalable solution for accessing diverse LLM providers.

How It Works

One API acts as a central proxy, abstracting the complexities of different LLM providers' APIs. It supports a wide array of models by mapping their specific APIs to a unified OpenAI-like interface. Key features include load balancing across multiple channels (providers or API keys), stream mode for real-time responses, and robust token management for controlling access, quotas, and IP restrictions. This approach allows users to interact with various LLMs seamlessly through a single endpoint, simplifying integration and management.

Quick Start & Requirements

  • Install/Run: Docker is the primary deployment method.
    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
    
  • Prerequisites: Docker, optionally MySQL/PostgreSQL for persistent storage.
  • Setup: Quick setup via Docker. Persistent data requires volume mounting.
  • Docs: 部署教程

Highlighted Details

  • Supports over 30 LLM providers, including OpenAI, Azure, Claude, Gemini, and many Chinese domestic models.
  • Features comprehensive token management (expiration, quota, IP restrictions) and exchange code system for top-ups.
  • Offers multi-server deployment capabilities for scalability and high availability.
  • Provides extensive customization options for UI, branding, and API behavior, including model mapping and custom HTML/Markdown pages.

Maintenance & Community

The project is actively maintained by songquanpeng and has a growing community. Links to feedback channels and related projects are available in the README.

Licensing & Compatibility

  • License: MIT License.
  • Restrictions: Requires retaining attribution and a link to the project on the footer. Modifications also require the same. Commercial use is permitted under these conditions.

Limitations & Caveats

  • Users must adhere to OpenAI's terms of use and relevant laws.
  • The project's online demo is not for public service.
  • Some advanced features or specific model integrations might require careful configuration or may be subject to change.
Health Check
Last commit

2 weeks ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
15
Star History
1,654 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.