diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 97c331ad..00000000 --- a/README.en.md +++ /dev/null @@ -1,466 +0,0 @@ -
- 中文 | - English | - Français | - 日本語 -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Quick Start • - Key Features • - Deployment • - Documentation • - Help -
- -- No particular order -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Thanks to JetBrains for providing free open-source development license for this project -
- ---- - -## 🚀 Quick Start - -### Using Docker Compose (Recommended) - -```bash -# Clone the project -git clone https://github.com/QuantumNous/new-api.git -cd new-api - -# Edit docker-compose.yml configuration -nano docker-compose.yml - -# Start the service -docker-compose up -d -``` - -- 中文 | - English | + 中文 | + English | Français | 日本語
@@ -200,9 +200,11 @@ docker run --name new-api -d --restart always \ ### 🔐 Autorisation et sécurité +- 😈 Connexion par autorisation Discord - 🤖 Connexion par autorisation LinuxDO - 📱 Connexion par autorisation Telegram - 🔑 Authentification unifiée OIDC +- 🔍 Requête de quota d'utilisation de clé (avec [neko-api-key-tool](https://github.com/Calcium-Ion/neko-api-key-tool)) ### 🚀 Fonctionnalités avancées @@ -230,10 +232,13 @@ docker run --name new-api -d --restart always \- 中文 | - English | + 中文 | + English | Français | 日本語
@@ -200,9 +200,11 @@ docker run --name new-api -d --restart always \ ### 🔐 認証とセキュリティ +- 😈 Discord認証ログイン - 🤖 LinuxDO認証ログイン - 📱 Telegram認証ログイン - 🔑 OIDC統一認証 +- 🔍 Key使用量クォータ照会([neko-api-key-tool](https://github.com/Calcium-Ion/neko-api-key-tool)と併用) @@ -213,10 +215,6 @@ docker run --name new-api -d --restart always \ - ⚡ [OpenAI Realtime API](https://docs.newapi.pro/ja/docs/api/ai-model/realtime/create-realtime-session)(Azureを含む) - ⚡ [Claude Messages](https://docs.newapi.pro/ja/docs/api/ai-model/chat/create-message) - ⚡ [Google Gemini](https://doc.newapi.pro/ja/api/google-gemini-chat) -- 🔄 [Rerankモデル](https://docs.newapi.pro/ja/docs/api/ai-model/rerank/create-rerank) -- ⚡ [OpenAI Realtime API](https://docs.newapi.pro/ja/docs/api/ai-model/realtime/create-realtime-session) -- ⚡ [Claude Messages](https://docs.newapi.pro/ja/docs/api/ai-model/chat/create-message) -- ⚡ [Google Gemini](https://doc.newapi.pro/ja/api/google-gemini-chat) - 🔄 [Rerankモデル](https://docs.newapi.pro/ja/docs/api/ai-model/rerank/create-rerank)(Cohere、Jina) **インテリジェントルーティング:** diff --git a/README.md b/README.md index b67dc929..e4e39438 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ # New API -🍥 **新一代大模型网关与AI资产管理系统** +🍥 **Next-Generation LLM Gateway and AI Asset Management System**- 中文 | - English | + 中文 | + English | Français | 日本語
@@ -45,31 +45,31 @@- 快速开始 • - 主要特性 • - 部署 • - 文档 • - 帮助 + Quick Start • + Key Features • + Deployment • + Documentation • + Help
-## 📝 项目说明 +## 📝 Project Description > [!NOTE] -> 本项目为开源项目,在 [One API](https://github.com/songquanpeng/one-api) 的基础上进行二次开发 +> This is an open-source project developed based on [One API](https://github.com/songquanpeng/one-api) > [!IMPORTANT] -> - 本项目仅供个人学习使用,不保证稳定性,且不提供任何技术支持 -> - 使用者必须在遵循 OpenAI 的 [使用条款](https://openai.com/policies/terms-of-use) 以及**法律法规**的情况下使用,不得用于非法用途 -> - 根据 [《生成式人工智能服务管理暂行办法》](http://www.cac.gov.cn/2023-07/13/c_1690898327029107.htm) 的要求,请勿对中国地区公众提供一切未经备案的生成式人工智能服务 +> - This project is for personal learning purposes only, with no guarantee of stability or technical support +> - Users must comply with OpenAI's [Terms of Use](https://openai.com/policies/terms-of-use) and **applicable laws and regulations**, and must not use it for illegal purposes +> - According to the [《Interim Measures for the Management of Generative Artificial Intelligence Services》](http://www.cac.gov.cn/2023-07/13/c_1690898327029107.htm), please do not provide any unregistered generative AI services to the public in China. --- -## 🤝 我们信任的合作伙伴 +## 🤝 Trusted Partners- 排名不分先后 + No particular order
@@ -77,13 +77,13 @@
- 感谢 JetBrains 为本项目提供免费的开源开发许可证
+ Thanks to JetBrains for providing free open-source development license for this project
+ 中文 |
+ English |
+ Français |
+ 日本語
+
+ 排名不分先后
+
+
+
+
+
+ 感谢 JetBrains 为本项目提供免费的开源开发许可证
+
-
+
-
+
-
+
@@ -92,7 +92,7 @@
---
-## 🙏 特别鸣谢
+## 🙏 Special Thanks
使用 Docker 命令
+Using Docker Commands
```bash
-# 拉取最新镜像
+# Pull the latest image
docker pull calciumion/new-api:latest
-# 使用 SQLite(默认)
+# Using SQLite (default)
docker run --name new-api -d --restart always \
-p 3000:3000 \
-e TZ=Asia/Shanghai \
-v ./data:/data \
calciumion/new-api:latest
-# 使用 MySQL
+# Using MySQL
docker run --name new-api -d --restart always \
-p 3000:3000 \
-e SQL_DSN="root:123456@tcp(localhost:3306)/oneapi" \
@@ -145,94 +145,94 @@ docker run --name new-api -d --restart always \
calciumion/new-api:latest
```
-> **💡 提示:** `-v ./data:/data` 会将数据保存在当前目录的 `data` 文件夹中,你也可以改为绝对路径如 `-v /your/custom/path:/data`
+> **💡 Tip:** `-v ./data:/data` will save data in the `data` folder of the current directory, you can also change it to an absolute path like `-v /your/custom/path:/data`
查看详细配置
+View detailed configuration
-**OpenAI 系列模型:**
+**OpenAI series models:**
- `o3-mini-high` - High reasoning effort
- `o3-mini-medium` - Medium reasoning effort
- `o3-mini-low` - Low reasoning effort
@@ -240,119 +240,119 @@ docker run --name new-api -d --restart always \
- `gpt-5-medium` - Medium reasoning effort
- `gpt-5-low` - Low reasoning effort
-**Claude 思考模型:**
-- `claude-3-7-sonnet-20250219-thinking` - 启用思考模式
+**Claude thinking models:**
+- `claude-3-7-sonnet-20250219-thinking` - Enable thinking mode
-**Google Gemini 系列模型:**
-- `gemini-2.5-flash-thinking` - 启用思考模式
-- `gemini-2.5-flash-nothinking` - 禁用思考模式
-- `gemini-2.5-pro-thinking` - 启用思考模式
-- `gemini-2.5-pro-thinking-128` - 启用思考模式,并设置思考预算为128tokens
-- 也可以直接在 Gemini 模型名称后追加 `-low` / `-medium` / `-high` 来控制思考力度(无需再设置思考预算后缀)
+**Google Gemini series models:**
+- `gemini-2.5-flash-thinking` - Enable thinking mode
+- `gemini-2.5-flash-nothinking` - Disable thinking mode
+- `gemini-2.5-pro-thinking` - Enable thinking mode
+- `gemini-2.5-pro-thinking-128` - Enable thinking mode with thinking budget of 128 tokens
+- You can also append `-low`, `-medium`, or `-high` to any Gemini model name to request the corresponding reasoning effort (no extra thinking-budget suffix needed).
查看完整接口列表
+View complete interface list
-- [聊天接口 (Chat Completions)](https://docs.newapi.pro/zh/docs/api/ai-model/chat/openai/create-chat-completion)
-- [响应接口 (Responses)](https://docs.newapi.pro/zh/docs/api/ai-model/chat/openai/create-response)
-- [图像接口 (Image)](https://docs.newapi.pro/zh/docs/api/ai-model/images/openai/v1-images-generations--post)
-- [音频接口 (Audio)](https://docs.newapi.pro/zh/docs/api/ai-model/audio/openai/create-transcription)
-- [视频接口 (Video)](https://docs.newapi.pro/zh/docs/api/ai-model/videos/create-video-generation)
-- [嵌入接口 (Embeddings)](https://docs.newapi.pro/zh/docs/api/ai-model/embeddings/create-embedding)
-- [重排序接口 (Rerank)](https://docs.newapi.pro/zh/docs/api/ai-model/rerank/create-rerank)
-- [实时对话 (Realtime)](https://docs.newapi.pro/zh/docs/api/ai-model/realtime/create-realtime-session)
-- [Claude 聊天](https://docs.newapi.pro/zh/docs/api/ai-model/chat/create-message)
-- [Google Gemini 聊天](https://doc.newapi.pro/api/google-gemini-chat)
+- [Chat Interface (Chat Completions)](https://docs.newapi.pro/en/docs/api/ai-model/chat/openai/create-chat-completion)
+- [Response Interface (Responses)](https://docs.newapi.pro/en/docs/api/ai-model/chat/openai/create-response)
+- [Image Interface (Image)](https://docs.newapi.pro/en/docs/api/ai-model/images/openai/v1-images-generations--post)
+- [Audio Interface (Audio)](https://docs.newapi.pro/en/docs/api/ai-model/audio/openai/create-transcription)
+- [Video Interface (Video)](https://docs.newapi.pro/en/docs/api/ai-model/videos/create-video-generation)
+- [Embedding Interface (Embeddings)](https://docs.newapi.pro/en/docs/api/ai-model/embeddings/create-embedding)
+- [Rerank Interface (Rerank)](https://docs.newapi.pro/en/docs/api/ai-model/rerank/create-rerank)
+- [Realtime Conversation (Realtime)](https://docs.newapi.pro/en/docs/api/ai-model/realtime/create-realtime-session)
+- [Claude Chat](https://docs.newapi.pro/en/docs/api/ai-model/chat/create-message)
+- [Google Gemini Chat](https://doc.newapi.pro/en/api/google-gemini-chat)
常用环境变量配置
+Common environment variable configuration
-| 变量名 | 说明 | 默认值 |
-|--------|--------------------------------------------------------------|--------|
-| `SESSION_SECRET` | 会话密钥(多机部署必须) | - |
-| `CRYPTO_SECRET` | 加密密钥(Redis 必须) | - |
-| `SQL_DSN` | 数据库连接字符串 | - |
-| `REDIS_CONN_STRING` | Redis 连接字符串 | - |
-| `STREAMING_TIMEOUT` | 流式超时时间(秒) | `300` |
-| `STREAM_SCANNER_MAX_BUFFER_MB` | 流式扫描器单行最大缓冲(MB),图像生成等超大 `data:` 片段(如 4K 图片 base64)需适当调大 | `64` |
-| `MAX_REQUEST_BODY_MB` | 请求体最大大小(MB,**解压后**计;防止超大请求/zip bomb 导致内存暴涨),超过将返回 `413` | `32` |
-| `AZURE_DEFAULT_API_VERSION` | Azure API 版本 | `2025-04-01-preview` |
-| `ERROR_LOG_ENABLED` | 错误日志开关 | `false` |
-| `PYROSCOPE_URL` | Pyroscope 服务地址 | - |
-| `PYROSCOPE_APP_NAME` | Pyroscope 应用名 | `new-api` |
-| `PYROSCOPE_BASIC_AUTH_USER` | Pyroscope Basic Auth 用户名 | - |
-| `PYROSCOPE_BASIC_AUTH_PASSWORD` | Pyroscope Basic Auth 密码 | - |
-| `PYROSCOPE_MUTEX_RATE` | Pyroscope mutex 采样率 | `5` |
-| `PYROSCOPE_BLOCK_RATE` | Pyroscope block 采样率 | `5` |
-| `HOSTNAME` | Pyroscope 标签里的主机名 | `new-api` |
+| Variable Name | Description | Default Value |
+|--------|------|--------|
+| `SESSION_SECRET` | Session secret (required for multi-machine deployment) | - |
+| `CRYPTO_SECRET` | Encryption secret (required for Redis) | - |
+| `SQL_DSN` | Database connection string | - |
+| `REDIS_CONN_STRING` | Redis connection string | - |
+| `STREAMING_TIMEOUT` | Streaming timeout (seconds) | `300` |
+| `STREAM_SCANNER_MAX_BUFFER_MB` | Max per-line buffer (MB) for the stream scanner; increase when upstream sends huge image/base64 payloads | `64` |
+| `MAX_REQUEST_BODY_MB` | Max request body size (MB, counted **after decompression**; prevents huge requests/zip bombs from exhausting memory). Exceeding it returns `413` | `32` |
+| `AZURE_DEFAULT_API_VERSION` | Azure API version | `2025-04-01-preview` |
+| `ERROR_LOG_ENABLED` | Error log switch | `false` |
+| `PYROSCOPE_URL` | Pyroscope server address | - |
+| `PYROSCOPE_APP_NAME` | Pyroscope application name | `new-api` |
+| `PYROSCOPE_BASIC_AUTH_USER` | Pyroscope basic auth user | - |
+| `PYROSCOPE_BASIC_AUTH_PASSWORD` | Pyroscope basic auth password | - |
+| `PYROSCOPE_MUTEX_RATE` | Pyroscope mutex sampling rate | `5` |
+| `PYROSCOPE_BLOCK_RATE` | Pyroscope block sampling rate | `5` |
+| `HOSTNAME` | Hostname tag for Pyroscope | `new-api` |
-📖 **完整配置:** [环境变量文档](https://docs.newapi.pro/zh/docs/installation/config-maintenance/environment-variables)
+📖 **Complete configuration:** [Environment Variables Documentation](https://docs.newapi.pro/en/docs/installation/config-maintenance/environment-variables)
方式 1:Docker Compose(推荐)
+Method 1: Docker Compose (Recommended)
```bash
-# 克隆项目
+# Clone the project
git clone https://github.com/QuantumNous/new-api.git
cd new-api
-# 编辑配置
+# Edit configuration
nano docker-compose.yml
-# 启动服务
+# Start service
docker-compose up -d
```
方式 2:Docker 命令
+Method 2: Docker Commands
-**使用 SQLite:**
+**Using SQLite:**
```bash
docker run --name new-api -d --restart always \
-p 3000:3000 \
@@ -361,7 +361,7 @@ docker run --name new-api -d --restart always \
calciumion/new-api:latest
```
-**使用 MySQL:**
+**Using MySQL:**
```bash
docker run --name new-api -d --restart always \
-p 3000:3000 \
@@ -371,76 +371,76 @@ docker run --name new-api -d --restart always \
calciumion/new-api:latest
```
-> **💡 路径说明:**
-> - `./data:/data` - 相对路径,数据保存在当前目录的 data 文件夹
-> - 也可使用绝对路径,如:`/your/custom/path:/data`
+> **💡 Path explanation:**
+> - `./data:/data` - Relative path, data saved in the data folder of the current directory
+> - You can also use absolute path, e.g.: `/your/custom/path:/data`
方式 3:宝塔面板
+Method 3: BaoTa Panel
-1. 安装宝塔面板(≥ 9.2.0 版本)
-2. 在应用商店搜索 **New-API**
-3. 一键安装
+1. Install BaoTa Panel (≥ 9.2.0 version)
+2. Search for **New-API** in the application store
+3. One-click installation
-📖 [图文教程](./docs/BT.md)
+📖 [Tutorial with images](./docs/BT.md)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+使用 Docker 命令
+
+```bash
+# 拉取最新镜像
+docker pull calciumion/new-api:latest
+
+# 使用 SQLite(默认)
+docker run --name new-api -d --restart always \
+ -p 3000:3000 \
+ -e TZ=Asia/Shanghai \
+ -v ./data:/data \
+ calciumion/new-api:latest
+
+# 使用 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 ./data:/data \
+ calciumion/new-api:latest
+```
+
+> **💡 提示:** `-v ./data:/data` 会将数据保存在当前目录的 `data` 文件夹中,你也可以改为绝对路径如 `-v /your/custom/path:/data`
+
+查看详细配置
+
+**OpenAI 系列模型:**
+- `o3-mini-high` - High reasoning effort
+- `o3-mini-medium` - Medium reasoning effort
+- `o3-mini-low` - Low reasoning effort
+- `gpt-5-high` - High reasoning effort
+- `gpt-5-medium` - Medium reasoning effort
+- `gpt-5-low` - Low reasoning effort
+
+**Claude 思考模型:**
+- `claude-3-7-sonnet-20250219-thinking` - 启用思考模式
+
+**Google Gemini 系列模型:**
+- `gemini-2.5-flash-thinking` - 启用思考模式
+- `gemini-2.5-flash-nothinking` - 禁用思考模式
+- `gemini-2.5-pro-thinking` - 启用思考模式
+- `gemini-2.5-pro-thinking-128` - 启用思考模式,并设置思考预算为128tokens
+- 也可以直接在 Gemini 模型名称后追加 `-low` / `-medium` / `-high` 来控制思考力度(无需再设置思考预算后缀)
+
+查看完整接口列表
+
+- [聊天接口 (Chat Completions)](https://docs.newapi.pro/zh/docs/api/ai-model/chat/openai/create-chat-completion)
+- [响应接口 (Responses)](https://docs.newapi.pro/zh/docs/api/ai-model/chat/openai/create-response)
+- [图像接口 (Image)](https://docs.newapi.pro/zh/docs/api/ai-model/images/openai/v1-images-generations--post)
+- [音频接口 (Audio)](https://docs.newapi.pro/zh/docs/api/ai-model/audio/openai/create-transcription)
+- [视频接口 (Video)](https://docs.newapi.pro/zh/docs/api/ai-model/videos/create-video-generation)
+- [嵌入接口 (Embeddings)](https://docs.newapi.pro/zh/docs/api/ai-model/embeddings/create-embedding)
+- [重排序接口 (Rerank)](https://docs.newapi.pro/zh/docs/api/ai-model/rerank/create-rerank)
+- [实时对话 (Realtime)](https://docs.newapi.pro/zh/docs/api/ai-model/realtime/create-realtime-session)
+- [Claude 聊天](https://docs.newapi.pro/zh/docs/api/ai-model/chat/create-message)
+- [Google Gemini 聊天](https://doc.newapi.pro/api/google-gemini-chat)
+
+常用环境变量配置
+
+| 变量名 | 说明 | 默认值 |
+|--------|--------------------------------------------------------------|--------|
+| `SESSION_SECRET` | 会话密钥(多机部署必须) | - |
+| `CRYPTO_SECRET` | 加密密钥(Redis 必须) | - |
+| `SQL_DSN` | 数据库连接字符串 | - |
+| `REDIS_CONN_STRING` | Redis 连接字符串 | - |
+| `STREAMING_TIMEOUT` | 流式超时时间(秒) | `300` |
+| `STREAM_SCANNER_MAX_BUFFER_MB` | 流式扫描器单行最大缓冲(MB),图像生成等超大 `data:` 片段(如 4K 图片 base64)需适当调大 | `64` |
+| `MAX_REQUEST_BODY_MB` | 请求体最大大小(MB,**解压后**计;防止超大请求/zip bomb 导致内存暴涨),超过将返回 `413` | `32` |
+| `AZURE_DEFAULT_API_VERSION` | Azure API 版本 | `2025-04-01-preview` |
+| `ERROR_LOG_ENABLED` | 错误日志开关 | `false` |
+| `PYROSCOPE_URL` | Pyroscope 服务地址 | - |
+| `PYROSCOPE_APP_NAME` | Pyroscope 应用名 | `new-api` |
+| `PYROSCOPE_BASIC_AUTH_USER` | Pyroscope Basic Auth 用户名 | - |
+| `PYROSCOPE_BASIC_AUTH_PASSWORD` | Pyroscope Basic Auth 密码 | - |
+| `PYROSCOPE_MUTEX_RATE` | Pyroscope mutex 采样率 | `5` |
+| `PYROSCOPE_BLOCK_RATE` | Pyroscope block 采样率 | `5` |
+| `HOSTNAME` | Pyroscope 标签里的主机名 | `new-api` |
+
+📖 **完整配置:** [环境变量文档](https://docs.newapi.pro/zh/docs/installation/config-maintenance/environment-variables)
+
+方式 1:Docker Compose(推荐)
+
+```bash
+# 克隆项目
+git clone https://github.com/QuantumNous/new-api.git
+cd new-api
+
+# 编辑配置
+nano docker-compose.yml
+
+# 启动服务
+docker-compose up -d
+```
+
+方式 2:Docker 命令
+
+**使用 SQLite:**
+```bash
+docker run --name new-api -d --restart always \
+ -p 3000:3000 \
+ -e TZ=Asia/Shanghai \
+ -v ./data:/data \
+ calciumion/new-api:latest
+```
+
+**使用 MySQL:**
+```bash
+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 ./data:/data \
+ calciumion/new-api:latest
+```
+
+> **💡 路径说明:**
+> - `./data:/data` - 相对路径,数据保存在当前目录的 data 文件夹
+> - 也可使用绝对路径,如:`/your/custom/path:/data`
+
+方式 3:宝塔面板
+
+1. 安装宝塔面板(≥ 9.2.0 版本)
+2. 在应用商店搜索 **New-API**
+3. 一键安装
+
+📖 [图文教程](./docs/BT.md)
+
+