Skip to content

Commit e8cab8d

Browse files
chenglucursoragent
andcommitted
merge: sync upstream main into design
Merged 28 commits from QuantumNous/new-api upstream/main, including: Backend: - feat: support request_header key source (QuantumNous#4903) - fix: apply group filter to channel list queries (QuantumNous#4885, QuantumNous#4847) - fix: enforce header nav access control for public modules (QuantumNous#4889) - fix: correct usage logs filtering (QuantumNous#4883) - fix: allow clearing channel remark (QuantumNous#4886) - feat: track upstream request ID and prevent response header override - feat: require compliance confirmation for paid features Frontend: - fix: 修复新 UI 语言与文案显示问题 (QuantumNous#4876) - fix(web): handle unlimited API key quota validation (QuantumNous#4881) - fix(web/default): batch fix new UI issues (QuantumNous#4880, QuantumNous#4893, QuantumNous#4817, QuantumNous#4877, QuantumNous#4898) - fix: prevent combobox from over-filtering options on focus (QuantumNous#4829) - fix(default): support DropdownMenuItem onSelect (QuantumNous#4787) - chore(deps): bump axios to 1.15.2 Conflict resolution: - Locale JSONs: union merge (design overrides preserved, upstream new keys added) - router/api-router.go: kept design /public/session route, accepted upstream HeaderNavModuleAuth - common-logs-filter-bar.tsx: kept design refactor, added upstream upstreamRequestId field - summary-cards.tsx: kept design layout, adapted to new useSummaryCardsConfig interface - _reports/*.untranslated.json: design state kept (fr/vi removed, ja/ru ours) - Other UI conflicts resolved per .gitattributes ours strategy Co-authored-by: Cursor <cursoragent@cursor.com>
2 parents acded34 + 5ec3e64 commit e8cab8d

172 files changed

Lines changed: 10741 additions & 7147 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ docs
99
.eslintcache
1010
.gocache
1111
/web/node_modules
12+
/web/default/node_modules
13+
/web/default/dist
14+
/web/classic/node_modules
15+
/web/classic/dist

README.en.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@
5353
> This is an open-source project developed based on [One API](https://github.com/songquanpeng/one-api)
5454
5555
> [!IMPORTANT]
56-
> - This project is for personal learning purposes only, with no guarantee of stability or technical support
57-
> - 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
58-
> - 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.
56+
> - This project is intended solely for lawful and authorized AI API gateway, organization-level authentication, multi-model management, usage analytics, cost accounting, and private deployment scenarios.
57+
> - Users must lawfully obtain upstream API keys, accounts, model services, and interface permissions, and must comply with upstream terms of service and applicable laws and regulations.
58+
> - Users should ensure their use complies with upstream terms of service and applicable laws and regulations.
59+
> - When providing generative AI services to the public, users should comply with applicable regulatory requirements and fulfill all filing, licensing, content safety, real-name verification, log retention, tax, and upstream authorization obligations required by their jurisdiction.
5960
6061
---
6162

@@ -146,6 +147,9 @@ docker run --name new-api -d --restart always \
146147

147148
🎉 After deployment is complete, visit `http://localhost:3000` to start using!
148149

150+
> [!WARNING]
151+
> When operating this project as a public generative AI service or API resale service, users should first complete all required filing, licensing, content safety, real-name verification, log retention, tax, payment, and upstream authorization obligations.
152+
149153
📖 For more deployment methods, please refer to [Deployment Guide](https://docs.newapi.pro/en/docs/installation)
150154

151155
---
@@ -184,12 +188,12 @@ docker run --name new-api -d --restart always \
184188
| 📈 Data Dashboard | Visual console and statistical analysis |
185189
| 🔒 Permission Management | Token grouping, model restrictions, user management |
186190

187-
### 💰 Payment and Billing
191+
### 💰 Authorized Usage Accounting and Billing
188192

189-
-Online recharge (EPay, Stripe)
190-
-Pay-per-use model pricing
191-
- ✅ Cache billing support (OpenAI, Azure, DeepSeek, Claude, Qwen and all supported models)
192-
- ✅ Flexible billing policy configuration
193+
-Internal top-up and quota allocation for lawful authorized scenarios (EPay, Stripe)
194+
-Organization-level per-request, usage-based, and cache-hit cost accounting
195+
- ✅ Cache billing statistics for OpenAI, Azure, DeepSeek, Claude, Qwen, and supported models
196+
- ✅ Flexible billing policies for internal management or authorized enterprise customers
193197

194198
### 🔐 Authorization and Security
195199

@@ -248,7 +252,7 @@ docker run --name new-api -d --restart always \
248252

249253
## 🤖 Model Support
250254

251-
> For details, please refer to [API Documentation - Relay Interface](https://docs.newapi.pro/en/docs/api)
255+
> For details, please refer to [API Documentation - Gateway Interface](https://docs.newapi.pro/en/docs/api)
252256
253257
| Model Type | Description | Documentation |
254258
|---------|------|------|
@@ -259,7 +263,7 @@ docker run --name new-api -d --restart always \
259263
| 💬 Claude | Messages format | [Documentation](https://docs.newapi.pro/en/docs/api/ai-model/chat/create-message) |
260264
| 🌐 Gemini | Google Gemini format | [Documentation](https://doc.newapi.pro/en/api/google-gemini-chat) |
261265
| 🔧 Dify | ChatFlow mode | - |
262-
| 🎯 Custom | Supports complete call address | - |
266+
| 🎯 Custom upstream | Supports configuring legally authorized upstream endpoints | - |
263267

264268
### 📡 Supported Interfaces
265269

@@ -409,7 +413,7 @@ docker run --name new-api -d --restart always \
409413

410414
| Project | Description |
411415
|------|------|
412-
| [neko-api-key-tool](https://github.com/Calcium-Ion/neko-api-key-tool) | Key quota query tool |
416+
| [new-api-key-tool](https://github.com/Calcium-Ion/new-api-key-tool) | Key quota query tool |
413417
| [new-api-horizon](https://github.com/Calcium-Ion/new-api-horizon) | New API high-performance optimized version |
414418

415419
---

README.fr.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@
5555
## 📝 Description du projet
5656

5757
> [!IMPORTANT]
58-
> - Ce projet est uniquement destiné à des fins d'apprentissage personnel, sans garantie de stabilité ni de support technique.
59-
> - Les utilisateurs doivent se conformer aux [Conditions d'utilisation](https://openai.com/policies/terms-of-use) d'OpenAI et aux **lois et réglementations applicables**, et ne doivent pas l'utiliser à des fins illégales.
60-
> - Conformément aux [《Mesures provisoires pour la gestion des services d'intelligence artificielle générative》](http://www.cac.gov.cn/2023-07/13/c_1690898327029107.htm), veuillez ne fournir aucun service d'IA générative non enregistré au public en Chine.
58+
> - Ce projet est exclusivement destiné aux scénarios de passerelle API d'IA légalement autorisés, d'authentification organisationnelle, de gestion multi-modèles, d'analyse d'utilisation, de comptabilisation des coûts et de déploiement privé.
59+
> - Les utilisateurs doivent obtenir légalement les clés API, comptes, services de modèles et autorisations d'interface en amont, et doivent respecter les conditions d'utilisation en amont et les lois et réglementations applicables.
60+
> - Les utilisateurs doivent s'assurer que leur utilisation est conforme aux conditions d'utilisation en amont et aux lois et réglementations applicables.
61+
> - Lors de la fourniture de services d'IA générative au public, les utilisateurs doivent se conformer aux exigences réglementaires applicables et remplir toutes les obligations d'enregistrement, de licence, de sécurité du contenu, de vérification d'identité, de conservation des journaux, de fiscalité et d'autorisation en amont requises par leur juridiction.
6162
6263
---
6364

@@ -151,6 +152,9 @@ docker run --name new-api -d --restart always \
151152

152153
🎉 Après le déploiement, visitez `http://localhost:3000` pour commencer à utiliser!
153154

155+
> [!WARNING]
156+
> Lorsque vous exploitez ce projet en tant que service public d'IA générative ou service de revente d'API, les utilisateurs doivent d'abord remplir toutes les obligations requises en matière d'enregistrement, de licence, de sécurité du contenu, de vérification d'identité, de conservation des journaux, de fiscalité, de paiement et d'autorisation en amont.
157+
154158
📖 Pour plus de méthodes de déploiement, veuillez vous référer à [Guide de déploiement](https://docs.newapi.pro/en/docs/installation)
155159

156160
---
@@ -189,20 +193,20 @@ docker run --name new-api -d --restart always \
189193
| 📈 Tableau de bord des données | Console visuelle et analyse statistique |
190194
| 🔒 Gestion des permissions | Regroupement de jetons, restrictions de modèles, gestion des utilisateurs |
191195

192-
### 💰 Paiement et facturation
196+
### 💰 Comptabilisation et facturation des usages autorisés
193197

194-
-Recharge en ligne (EPay, Stripe)
195-
-Tarification des modèles de paiement à l'utilisation
196-
-Prise en charge de la facturation du cache (OpenAI, Azure, DeepSeek, Claude, Qwen et tous les modèles pris en charge)
197-
-Configuration flexible des politiques de facturation
198+
-Rechargement interne et allocation de quotas pour les scénarios légalement autorisés (EPay, Stripe)
199+
-Comptabilisation des coûts par requête, par utilisation et par hit de cache au niveau organisationnel
200+
-Statistiques de facturation du cache pour OpenAI, Azure, DeepSeek, Claude, Qwen et les modèles pris en charge
201+
-Politiques de facturation flexibles pour la gestion interne ou les clients entreprise autorisés
198202

199203
### 🔐 Autorisation et sécurité
200204

201205
- 😈 Connexion par autorisation Discord
202206
- 🤖 Connexion par autorisation LinuxDO
203207
- 📱 Connexion par autorisation Telegram
204208
- 🔑 Authentification unifiée OIDC
205-
- 🔍 Requête de quota d'utilisation de clé (avec [neko-api-key-tool](https://github.com/Calcium-Ion/neko-api-key-tool))
209+
- 🔍 Requête de quota d'utilisation de clé (avec [new-api-key-tool](https://github.com/Calcium-Ion/new-api-key-tool))
206210

207211
### 🚀 Fonctionnalités avancées
208212

@@ -254,7 +258,7 @@ docker run --name new-api -d --restart always \
254258

255259
## 🤖 Prise en charge des modèles
256260

257-
> Pour les détails, veuillez vous référer à [Documentation de l'API - Interface de relais](https://docs.newapi.pro/en/docs/api)
261+
> Pour les détails, veuillez vous référer à [Documentation de l'API - Interface de passerelle](https://docs.newapi.pro/en/docs/api)
258262
259263
| Type de modèle | Description | Documentation |
260264
|---------|------|------|
@@ -266,7 +270,7 @@ docker run --name new-api -d --restart always \
266270
| 💬 Claude | Format Messages | [Documentation](https://docs.newapi.pro/en/docs/api/ai-model/chat/createmessage) |
267271
| 🌐 Gemini | Format Google Gemini | [Documentation](https://docs.newapi.pro/en/docs/api/ai-model/chat/gemini/geminirelayv1beta) |
268272
| 🔧 Dify | Mode ChatFlow | - |
269-
| 🎯 Personnalisé | Prise en charge de l'adresse d'appel complète | - |
273+
| 🎯 Amont personnalisé | Configuration des points d'accès amont légalement autorisés | - |
270274

271275
### 📡 Interfaces prises en charge
272276

@@ -416,7 +420,7 @@ docker run --name new-api -d --restart always \
416420

417421
| Projet | Description |
418422
|------|------|
419-
| [neko-api-key-tool](https://github.com/Calcium-Ion/neko-api-key-tool) | Outil de recherche de quota d'utilisation avec une clé |
423+
| [new-api-key-tool](https://github.com/Calcium-Ion/new-api-key-tool) | Outil de recherche de quota d'utilisation avec une clé |
420424
| [new-api-horizon](https://github.com/Calcium-Ion/new-api-horizon) | Version optimisée haute performance de New API |
421425

422426
---

README.ja.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@
5555
## 📝 プロジェクト説明
5656

5757
> [!IMPORTANT]
58-
> - 本プロジェクトは個人学習用のみであり、安定性の保証や技術サポートは提供しません。
59-
> - ユーザーは、OpenAIの[利用規約](https://openai.com/policies/terms-of-use)および**法律法規**を遵守する必要があり、違法な目的で使用してはいけません。
60-
> - [《生成式人工智能服务管理暂行办法》](http://www.cac.gov.cn/2023-07/13/c_1690898327029107.htm)の要求に従い、中国地域の公衆に未登録の生成式AI サービスを提供しないでください。
58+
> - 本プロジェクトは、合法的に許可された AI API ゲートウェイ、組織レベルの認証、マルチモデル管理、利用量分析、コスト管理、プライベートデプロイのシナリオのみを対象としています。
59+
> - ユーザーは、上流の API キー、アカウント、モデルサービス、インターフェース権限を合法的に取得し、上流のサービス利用規約および適用される法律法規を遵守する必要があります。
60+
> - ユーザーは、利用方法が上流のサービス利用規約および適用される法律法規に準拠していることを確認してください。
61+
> - 生成 AI サービスを公衆に提供する場合、ユーザーは適用される規制要件を遵守し、管轄区域で求められる届出、ライセンス、コンテンツセキュリティ、本人確認、ログ保持、税務、上流認可などのすべての義務を履行してください。
6162
6263
---
6364

@@ -151,6 +152,9 @@ docker run --name new-api -d --restart always \
151152

152153
🎉 デプロイが完了したら、`http://localhost:3000` にアクセスして使用を開始してください!
153154

155+
> [!WARNING]
156+
> 本プロジェクトを公衆向け生成 AI サービスまたは API 再販サービスとして運営する場合、ユーザーは届出、コンテンツセキュリティ、本人確認、ログ保持、税務、決済、上流認可などの必要なコンプライアンス義務を先に完了してください。
157+
154158
📖 その他のデプロイ方法については[デプロイガイド](https://docs.newapi.pro/ja/docs/installation)を参照してください。
155159

156160
---
@@ -189,20 +193,20 @@ docker run --name new-api -d --restart always \
189193
| 📈 データダッシュボード | ビジュアルコンソールと統計分析 |
190194
| 🔒 権限管理 | トークングループ化、モデル制限、ユーザー管理 |
191195

192-
### 💰 支払いと課金
196+
### 💰 認可済み利用量とコスト管理
193197

194-
-オンライン充電(EPay、Stripe)
195-
-モデルの従量課金
196-
-キャッシュ課金サポート(OpenAI、Azure、DeepSeek、Claude、Qwenなどすべてのサポートされているモデル)
197-
-柔軟な課金ポリシー設定
198+
-合法的に許可されたシナリオでの内部チャージとクォータ割り当て(EPay、Stripe)
199+
-組織レベルのリクエスト単位、使用量ベース、キャッシュヒットのコスト会計
200+
- ✅ OpenAI、Azure、DeepSeek、Claude、Qwen などのモデルのキャッシュ課金統計
201+
-内部管理または認可済み企業顧客向けの柔軟な課金ポリシー
198202

199203
### 🔐 認証とセキュリティ
200204

201205
- 😈 Discord認証ログイン
202206
- 🤖 LinuxDO認証ログイン
203207
- 📱 Telegram認証ログイン
204208
- 🔑 OIDC統一認証
205-
- 🔍 Key使用量クォータ照会([neko-api-key-tool](https://github.com/Calcium-Ion/neko-api-key-tool)と併用)
209+
- 🔍 Key使用量クォータ照会([new-api-key-tool](https://github.com/Calcium-Ion/new-api-key-tool)と併用)
206210

207211

208212

@@ -256,7 +260,7 @@ docker run --name new-api -d --restart always \
256260

257261
## 🤖 モデルサポート
258262

259-
> 詳細については[APIドキュメント - 中継インターフェース](https://docs.newapi.pro/ja/docs/api)
263+
> 詳細については[APIドキュメント - ゲートウェイインターフェース](https://docs.newapi.pro/ja/docs/api)
260264
261265
| モデルタイプ | 説明 | ドキュメント |
262266
|---------|------|------|
@@ -268,7 +272,7 @@ docker run --name new-api -d --restart always \
268272
| 💬 Claude | Messagesフォーマット | [ドキュメント](https://docs.newapi.pro/ja/docs/api/ai-model/chat/createmessage) |
269273
| 🌐 Gemini | Google Geminiフォーマット | [ドキュメント](https://docs.newapi.pro/ja/docs/api/ai-model/chat/gemini/geminirelayv1beta) |
270274
| 🔧 Dify | ChatFlowモード | - |
271-
| 🎯 カスタム | 完全な呼び出しアドレスの入力をサポート | - |
275+
| 🎯 カスタム上流 | 合法的に許可された上流エンドポイントの設定をサポート | - |
272276

273277
### 📡 サポートされているインターフェース
274278

@@ -416,7 +420,7 @@ docker run --name new-api -d --restart always \
416420

417421
| プロジェクト | 説明 |
418422
|------|------|
419-
| [neko-api-key-tool](https://github.com/Calcium-Ion/neko-api-key-tool) | キー使用量クォータ照会ツール |
423+
| [new-api-key-tool](https://github.com/Calcium-Ion/new-api-key-tool) | キー使用量クォータ照会ツール |
420424
| [new-api-horizon](https://github.com/Calcium-Ion/new-api-horizon) | New API高性能最適化版 |
421425

422426
---

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@
5555
## 📝 Project Description
5656

5757
> [!IMPORTANT]
58-
> - This project is for personal learning purposes only, with no guarantee of stability or technical support
59-
> - 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
60-
> - 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.
58+
> - This project is intended solely for lawful and authorized AI API gateway, organization-level authentication, multi-model management, usage analytics, cost accounting, and private deployment scenarios.
59+
> - Users must lawfully obtain upstream API keys, accounts, model services, and interface permissions, and must comply with upstream terms of service and applicable laws and regulations.
60+
> - Users should ensure their use complies with upstream terms of service and applicable laws and regulations.
61+
> - When providing generative AI services to the public, users should comply with applicable regulatory requirements and fulfill all filing, licensing, content safety, real-name verification, log retention, tax, and upstream authorization obligations required by their jurisdiction.
6162
6263
---
6364

@@ -151,6 +152,9 @@ docker run --name new-api -d --restart always \
151152

152153
🎉 After deployment is complete, visit `http://localhost:3000` to start using!
153154

155+
> [!WARNING]
156+
> When operating this project as a public generative AI service or API resale service, users should first complete all required filing, licensing, content safety, real-name verification, log retention, tax, payment, and upstream authorization obligations.
157+
154158
📖 For more deployment methods, please refer to [Deployment Guide](https://docs.newapi.pro/en/docs/installation)
155159

156160
---
@@ -189,20 +193,20 @@ docker run --name new-api -d --restart always \
189193
| 📈 Data Dashboard | Visual console and statistical analysis |
190194
| 🔒 Permission Management | Token grouping, model restrictions, user management |
191195

192-
### 💰 Payment and Billing
196+
### 💰 Authorized Usage Accounting and Billing
193197

194-
-Online recharge (EPay, Stripe)
195-
-Pay-per-use model pricing
196-
- ✅ Cache billing support (OpenAI, Azure, DeepSeek, Claude, Qwen and all supported models)
197-
- ✅ Flexible billing policy configuration
198+
-Internal top-up and quota allocation for lawful authorized scenarios (EPay, Stripe)
199+
-Organization-level per-request, usage-based, and cache-hit cost accounting
200+
- ✅ Cache billing statistics for OpenAI, Azure, DeepSeek, Claude, Qwen, and supported models
201+
- ✅ Flexible billing policies for internal management or authorized enterprise customers
198202

199203
### 🔐 Authorization and Security
200204

201205
- 😈 Discord authorization login
202206
- 🤖 LinuxDO authorization login
203207
- 📱 Telegram authorization login
204208
- 🔑 OIDC unified authentication
205-
- 🔍 Key quota query usage (with [neko-api-key-tool](https://github.com/Calcium-Ion/neko-api-key-tool))
209+
- 🔍 Key quota query usage (with [new-api-key-tool](https://github.com/Calcium-Ion/new-api-key-tool))
206210

207211
### 🚀 Advanced Features
208212

@@ -254,7 +258,7 @@ docker run --name new-api -d --restart always \
254258

255259
## 🤖 Model Support
256260

257-
> For details, please refer to [API Documentation - Relay Interface](https://docs.newapi.pro/en/docs/api)
261+
> For details, please refer to [API Documentation - Gateway Interface](https://docs.newapi.pro/en/docs/api)
258262
259263
| Model Type | Description | Documentation |
260264
|---------|------|------|
@@ -266,7 +270,7 @@ docker run --name new-api -d --restart always \
266270
| 💬 Claude | Messages format | [Documentation](https://docs.newapi.pro/en/docs/api/ai-model/chat/createmessage) |
267271
| 🌐 Gemini | Google Gemini format | [Documentation](https://docs.newapi.pro/en/docs/api/ai-model/chat/gemini/geminirelayv1beta) |
268272
| 🔧 Dify | ChatFlow mode | - |
269-
| 🎯 Custom | Supports complete call address | - |
273+
| 🎯 Custom upstream | Supports configuring legally authorized upstream endpoints | - |
270274

271275
### 📡 Supported Interfaces
272276

@@ -416,7 +420,7 @@ docker run --name new-api -d --restart always \
416420

417421
| Project | Description |
418422
|------|------|
419-
| [neko-api-key-tool](https://github.com/Calcium-Ion/neko-api-key-tool) | Key quota query tool |
423+
| [new-api-key-tool](https://github.com/Calcium-Ion/new-api-key-tool) | Key quota query tool |
420424
| [new-api-horizon](https://github.com/Calcium-Ion/new-api-horizon) | New API high-performance optimized version |
421425

422426
---

0 commit comments

Comments
 (0)