new-api  by QuantumNous

LLM gateway & AI asset manager for unified API access

created 1 year ago
9,136 stars

Top 5.6% on sourcepulse

GitHubView on GitHub
Project Summary

New API is an AI model gateway and asset management system designed to unify access to various large language models, supporting OpenAI, Claude, and other formats. It's built for individuals and enterprises to manage and distribute AI model channels, offering a modern UI and enhanced features over its predecessor, One API.

How It Works

This system acts as a central proxy, translating requests for different LLM providers into a unified format. It supports features like channel weighting, load balancing, and model-specific configurations (e.g., reasoning effort via suffixes). The architecture allows for flexible deployment with various database backends (SQLite, MySQL, PostgreSQL) and includes caching mechanisms for improved performance and billing.

Quick Start & Requirements

  • Install/Run: Docker Compose is recommended.
    git clone https://github.com/Calcium-Ion/new-api.git
    cd new-api
    # Edit docker-compose.yml as needed
    docker-compose up -d
    
    Alternatively, use direct Docker images:
    # Using SQLite
    docker run --name new-api -d --restart always -p 3000:3000 -e TZ=Asia/Shanghai -v /home/ubuntu/data/new-api:/data calciumion/new-api:latest
    
  • Prerequisites: Docker, Docker Compose. For multi-instance deployments, SESSION_SECRET and CRYPTO_SECRET environment variables are crucial. Supports MySQL >= 5.7.8, PostgreSQL >= 9.6.
  • Resources: Requires a server environment for Docker. Database storage depends on usage.
  • Docs: https://docs.newapi.pro/

Highlighted Details

  • Features a new UI with multi-language support.
  • Supports online payment (YiPay) and key-based usage quota queries.
  • Includes data dashboards, token grouping, model rate limiting, and enhanced authentication (LinuxDO, Telegram, OIDC).
  • Supports Rerank models (Cohere, Jina), OpenAI Realtime API, Claude Messages format, and custom channel URLs.

Maintenance & Community

The project is a fork of One API. Community support is available via links provided in the README for feedback and common issues.

Licensing & Compatibility

The project is open-source, but the README states it's for personal learning use only and does not guarantee stability or provide technical support. Users must comply with OpenAI's terms and relevant laws. The specific license is not explicitly stated in the provided text, but the disclaimer suggests potential restrictions on commercial use.

Limitations & Caveats

The project explicitly states it is for personal learning use only, does not guarantee stability, and offers no technical support. Users are responsible for adhering to OpenAI's terms of service and legal regulations, particularly regarding the provision of AI services in China.

Health Check
Last commit

18 hours ago

Responsiveness

1 day

Pull Requests (30d)
79
Issues (30d)
92
Star History
2,164 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.