CaIon
9fdb0bc248
feat: comment out notify endpoint in relay router
2026-03-12 19:05:30 +08:00
CaIon
094ac54609
feat(middleware): add RouteTag middleware for enhanced logging and routing
...
- Introduced RouteTag middleware to set route tags for different API endpoints.
- Updated logger to include route tags in log output.
- Applied RouteTag middleware across various routers including API, dashboard, relay, video, and web routers for consistent logging.
2026-02-25 00:11:24 +08:00
CaIon
7d5fc3ff51
refactor(relay): rename RelayTask to RelayTaskFetch and update routing
...
- Renamed RelayTask function to RelayTaskFetch for clarity.
- Updated routing in relay-router.go and video-router.go to use RelayTaskFetch for fetch operations.
- Enhanced error handling in RelayTaskFetch function.
- Adjusted task data conversion in TaskAdaptor to include task ID.
2026-02-22 16:01:19 +08:00
CaIon
5e71ef98d9
feat(performance): implement system performance monitoring with configurable thresholds
2026-02-04 21:26:07 +08:00
Calcium-Ion
d7c55b92b2
feat: disk request body cache ( #2780 )
...
* feat: 引入通用 HTTP BodyStorage/DiskCache 缓存配置与管理
- 新增 common/body_storage.go 提供 HTTP 请求体存储抽象和文件缓存能力
- 增加 common/disk_cache_config.go 支持全局磁盘缓存配置
- main.go 挂载缓存初始化流程
- 新增和补充 controller/performance.go (及 unix/windows) 用于缓存性能监控接口
- middleware/body_cleanup.go 自动清理缓存文件
- router 挂载相关接口
- 前端 settings 页面新增性能监控设置 PerformanceSetting
- 优化缓存开关状态和模块热插拔能力
- 其他相关文件同步适配缓存扩展
* fix: 修复 BodyStorage 并发安全和错误处理问题
- 修复 diskStorage.Close() 竞态条件,先获取锁再执行 CAS
- 为 memoryStorage 添加互斥锁和 closed 状态检查
- 修复 CreateBodyStorageFromReader 在磁盘存储失败时的回退逻辑
- 添加缓存命中统计调用 (IncrementDiskCacheHits/IncrementMemoryCacheHits)
- 修复 gin.go 中 Seek 错误被忽略的问题
- 在 api-router 添加 BodyStorageCleanup 中间件
- 修复前端 formatBytes 对异常值的处理
Co-authored-by: Cursor <cursoragent@cursor.com >
---------
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-01-30 01:00:49 +08:00
Seefs
cf114ca7d6
feat: openai response /v1/response/compact ( #2644 )
...
* feat: openai response /v1/response/compact
* feat: /v1/response/compact bill
* feat: /v1/response/compact
* feat: /v1/responses/compact -> codex channel
* feat: /v1/responses/compact -> codex channel
* feat: /v1/responses/compact -> codex channel
* feat: codex channel default models
* feat: compact model price
* feat: /v1/responses/comapct test
2026-01-26 20:20:16 +08:00
Seefs
5010f2d004
format: package name -> github.com/QuantumNous/new-api ( #2017 )
2025-10-11 15:30:09 +08:00
CaIon
97ea8b6560
refactor: Introduce pre-consume quota and unify relay handlers
...
This commit introduces a major architectural refactoring to improve quota management, centralize logging, and streamline the relay handling logic.
Key changes:
- **Pre-consume Quota:** Implements a new mechanism to check and reserve user quota *before* making the request to the upstream provider. This ensures more accurate quota deduction and prevents users from exceeding their limits due to concurrent requests.
- **Unified Relay Handlers:** Refactors the relay logic to use generic handlers (e.g., `ChatHandler`, `ImageHandler`) instead of provider-specific implementations. This significantly reduces code duplication and simplifies adding new channels.
- **Centralized Logger:** A new dedicated `logger` package is introduced, and all system logging calls are migrated to use it, moving this responsibility out of the `common` package.
- **Code Reorganization:** DTOs are generalized (e.g., `dalle.go` -> `openai_image.go`) and utility code is moved to more appropriate packages (e.g., `common/http.go` -> `service/http.go`) for better code structure.
2025-08-14 20:05:06 +08:00
nekohy
4cf1ffa801
✨ feat: Enhance model listing and retrieval with support for Anthropic and Gemini models; refactor routes for better API key handling
2025-08-10 11:44:38 +08:00
CaIon
cf11a22c3a
🔧 refactor(auth, channel, context): improve context setup and validation for multi-key channels
2025-07-06 12:37:56 +08:00
Calcium-Ion
aa0edd8dce
Merge pull request #1321 from iszcz/main
...
支持Midjourney视频任务和图片编辑
2025-07-05 15:28:33 +08:00
iszcz
d4f2f4dbbe
支持Midjourney视频任务和图片编辑
2025-06-30 22:31:12 +08:00
CaIon
04d525e317
🚀 feat(auth): support new model API paths in authentication and routing
...
- Updated TokenAuth middleware to handle requests for both `/v1beta/models/` and `/v1/models/`.
- Adjusted distributor middleware to recognize the new model path.
- Enhanced relay mode determination to include the new model path.
- Added route for handling POST requests to `/models/*path`.
These changes ensure compatibility with the new model API structure, improving the overall routing and authentication flow.
2025-06-25 00:19:38 +08:00
CaIon
ad4d3efd2e
✨ feat(middleware): add HTTP statistics middleware
2025-06-10 19:29:32 +08:00
creamlike1024
75d859dce2
gemini text generation
2025-05-26 13:34:41 +08:00
creamlike1024
8ea4c76f2b
feat: support /v1/responses API
2025-05-02 13:59:46 +08:00
xyfacai
873ebcf0c7
feat: support /images/edit
...
(cherry picked from commit 1c0a1238787d490f02dd9269b616580a16604180)
2025-04-26 15:44:56 +08:00
1808837298@qq.com
78fc3a191c
feat: claude relay
2025-03-12 21:31:46 +08:00
1808837298@qq.com
1763145fea
feat: Add model request rate limiting functionality
2025-02-24 16:20:55 +08:00
CalciumIon
270857e370
feat: support br
2024-12-04 23:53:02 +08:00
CalciumIon
407d03a0ba
feat: support gzip
2024-12-04 23:24:46 +08:00
1808837298@qq.com
698b6ed7d7
Update dto
...
(cherry picked from commit 030187ff75c64c40017cda2fa98ef2b3c01f0bd5)
2024-11-05 19:23:56 +08:00
1808837298@qq.com
07fa9205cb
feat: playground
2024-09-26 00:59:09 +08:00
kakingone
442a2f0f4d
addupload
2024-07-31 15:48:51 +08:00
CalciumIon
c7ba4a245b
feat: support cohere rerank
2024-07-06 17:09:22 +08:00
Xiangyuan Liu
05a4646b44
feat: suno api 支持
...
feat: 调试 suno
feat: 补充suno 文档
2024-06-13 10:35:48 +08:00
Xiangyuan Liu
d30187e24f
feat: 支持 /mj-{mode} 路径
2024-03-29 16:48:50 +08:00
CaIon
afa1748591
feat: support InsightFace ( close #60 )
2024-03-14 18:09:57 +08:00
CaIon
8a632b7825
feat: 兼容自定义变焦,完善modal操作
2024-03-14 16:42:37 +08:00
CaIon
62bca310e3
feat: support shorten
2024-03-13 17:46:34 +08:00
CaIon
259c7fcdb0
feat: 初步兼容midjourney-proxy-plus
2024-03-13 15:37:01 +08:00
1808837298@qq.com
1735981217
feat: 初步重构
2024-02-29 01:08:18 +08:00
CaIon
f8b7286341
fix: delete RelayPanicRecover
2024-01-12 13:48:13 +08:00
CaIon
d9107379e9
fix: fix gemini panic
2024-01-07 21:27:28 +08:00
Xyfacai
825f59e162
optimize: MJ 部分调整、优化
...
MJ
增加simple-change、list接口,
变换和重试操作区别出来,价格与绘图一样
优化图片返回
2024-01-01 22:46:05 +08:00
CaIon
a7bac4f1fd
Merge branch 'main' into latest
2023-11-15 21:07:37 +08:00
CaIon
9d68527654
support tts
2023-11-15 21:05:14 +08:00
luxl-1379
227711b263
Update relay-router.go
2023-11-14 08:55:45 +08:00
CaIon
23d9554415
Merge remote-tracking branch 'origin/main'
...
# Conflicts:
# controller/log.go
# controller/relay-audio.go
# controller/relay-image.go
# controller/relay-text.go
# controller/relay.go
# middleware/distributor.go
# model/log.go
# web/src/components/OperationSetting.js
2023-09-17 20:59:12 +08:00
JustSong
437b35e161
fix: only enable cors for relay routers to avoid csrf attack
2023-09-17 11:44:38 +08:00
CaIon
59b4bc37ea
feat: 改为转发的方式获取midjourney图片
2023-09-12 03:46:05 +08:00
CaIon
c0636950c0
Merge remote-tracking branch 'origin/main'
...
# Conflicts:
# controller/relay.go
# main.go
# middleware/distributor.go
2023-09-09 03:15:55 +08:00
JustSong
1966eb712e
feat: supper whisper now ( close #197 )
2023-08-27 15:28:23 +08:00
CaIon
68b24da6a6
add epay
2023-08-14 22:16:32 +08:00
mrhaoji
292a3d8037
fix: relay router typo for List models ( #320 )
...
via: https://platform.openai.com/docs/api-reference/models/list
2023-07-24 22:28:16 +08:00
ckt
b1cb2602dc
feat: initial support of Dall-E ( #148 , #266 )
...
* feat: initial support of Dall-E
* fix: fix N not timed
---------
Co-authored-by: JustSong <songquanpeng@foxmail.com >
Co-authored-by: JustSong <39998050+songquanpeng@users.noreply.github.com >
2023-07-15 12:30:06 +08:00
玩牛牛
ab437eb663
feat: add support for /v1/engines/text-embedding-ada-002/embeddings ( #224 , close #222 )
2023-07-15 12:03:23 +08:00
JustSong
44a78a755f
feat: support /v1/edits now ( close #196 )
2023-06-25 11:46:23 +08:00
JustSong
e479f43c52
feat: support /v1/moderations now ( close #117 )
2023-06-11 09:37:36 +08:00
JustSong
33cb8e4b8c
feat: support /v1/completions ( close #115 )
2023-06-08 14:54:02 +08:00