AI模型聚合管理中转分发系统,一个应用管理您的所有AI模型,支持将多种大模型转为统一格式调用,支持OpenAI、Claude、Gemini等格式,可供个人或者企业内部管理与分发渠道使用。
|
|
3 miesięcy temu | |
|---|---|---|
| .github | 3 miesięcy temu | |
| bin | 2 lat temu | |
| common | 3 miesięcy temu | |
| constant | 4 miesięcy temu | |
| controller | 3 miesięcy temu | |
| docs | 3 miesięcy temu | |
| dto | 3 miesięcy temu | |
| examples | 3 miesięcy temu | |
| logger | 4 miesięcy temu | |
| middleware | 3 miesięcy temu | |
| model | 3 miesięcy temu | |
| relay | 3 miesięcy temu | |
| router | 3 miesięcy temu | |
| service | 3 miesięcy temu | |
| setting | 3 miesięcy temu | |
| src | 3 miesięcy temu | |
| types | 3 miesięcy temu | |
| web | 3 miesięcy temu | |
| .dockerignore | 5 miesięcy temu | |
| .env.example | 3 miesięcy temu | |
| .gitignore | 5 miesięcy temu | |
| Dockerfile | 5 miesięcy temu | |
| LICENSE | 5 miesięcy temu | |
| README.en.md | 4 miesięcy temu | |
| README.md | 3 miesięcy temu | |
| VERSION | 2 lat temu | |
| docker-compose.yml | 4 miesięcy temu | |
| go.mod | 3 miesięcy temu | |
| go.sum | 3 miesięcy temu | |
| main.go | 3 miesięcy temu | |
| makefile | 6 miesięcy temu | |
| one-api.service | 2 lat temu |
中文 | English
No particular order
For detailed documentation, please visit our official Wiki: https://docs.newapi.pro/
You can also access the AI-generated DeepWiki:
New API offers a wide range of features, please refer to Features Introduction for details:
-high suffix for high reasoning effort (e.g.: o3-mini-high)-medium suffix for medium reasoning effort (e.g.: o3-mini-medium)-low suffix for low reasoning effort (e.g.: o3-mini-low)-thinking suffix to enable thinking mode (e.g.: claude-3-7-sonnet-20250219-thinking)Prompt Cache Ratio option in System Settings-Operation SettingsPrompt Cache Ratio in the channel, range 0-1, e.g., setting to 0.5 means billing at 50% when cache is hitThis version supports multiple models, please refer to API Documentation-Relay Interface for details:
For detailed configuration instructions, please refer to Installation Guide-Environment Variables Configuration:
GENERATE_DEFAULT_TOKEN: Whether to generate initial tokens for newly registered users, default is falseSTREAMING_TIMEOUT: Streaming response timeout, default is 300 secondsDIFY_DEBUG: Whether to output workflow and node information for Dify channels, default is trueFORCE_STREAM_OPTION: Whether to override client stream_options parameter, default is trueGET_MEDIA_TOKEN: Whether to count image tokens, default is trueGET_MEDIA_TOKEN_NOT_STREAM: Whether to count image tokens in non-streaming cases, default is trueUPDATE_TASK: Whether to update asynchronous tasks (Midjourney, Suno), default is trueCOHERE_SAFETY_SETTING: Cohere model safety settings, options are NONE, CONTEXTUAL, STRICT, default is NONEGEMINI_VISION_MAX_IMAGE_NUM: Maximum number of images for Gemini models, default is 16MAX_FILE_DOWNLOAD_MB: Maximum file download size in MB, default is 20CRYPTO_SECRET: Encryption key used for encrypting database contentAZURE_DEFAULT_API_VERSION: Azure channel default API version, default is 2025-04-01-previewNOTIFICATION_LIMIT_DURATION_MINUTE: Notification limit duration, default is 10 minutesNOTIFY_LIMIT_COUNT: Maximum number of user notifications within the specified duration, default is 2ERROR_LOG_ENABLED=true: Whether to record and display error logs, default is falseFor detailed deployment guides, please refer to Installation Guide-Deployment Methods:
[!TIP] Latest Docker image:
calciumion/new-api:latest
SESSION_SECRET must be set, otherwise login status will be inconsistent across multiple machinesCRYPTO_SECRET must be set, otherwise Redis content cannot be accessed across multiple machines/data directory)Install BaoTa Panel (version 9.2.0 or above), find New-API in the application store and install it. Tutorial with images
# Download the project
git clone https://github.com/Calcium-Ion/new-api.git
cd new-api
# Edit docker-compose.yml as needed
# Start
docker-compose up -d
# 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
# Using MySQL
docker run --name new-api -d --restart always -p 3000:3000 -e SQL_DSN="root:123456@tcp(localhost:3306)/oneapi" -e TZ=Asia/Shanghai -v /home/ubuntu/data/new-api:/data calciumion/new-api:latest
Channel retry functionality has been implemented, you can set the number of retries in Settings->Operation Settings->General Settings. It is recommended to enable caching.
REDIS_CONN_STRING: Set Redis as cacheMEMORY_CACHE_ENABLED: Enable memory cache (no need to set manually if Redis is set)For detailed API documentation, please refer to API Documentation:
Other projects based on New API:
If you have any questions, please refer to Help and Support: