CaIon
b311d482e3
fix: update abortWithOpenAiMessage function to use types.ErrorCode
2026-01-19 17:35:28 +08:00
Hackerxiao
815bc61c67
Merge branch 'QuantumNous:main' into main
2025-12-30 11:44:15 +08:00
Seefs
7e1ad4bdff
fix: 支持小写bearer和Bearer后带多个空格 && 修复 WSS预扣费错误提取key的问题
2025-12-24 15:52:56 +08:00
t0ng7u
fa814b80fe
🧹 fix: harden request-body size handling and error unwrapping
...
Tighten oversized request handling across relay paths and make error matching reliable.
- Align `MAX_REQUEST_BODY_MB` fallback to `32` in request body reader and decompression middleware
- Stop ignoring `GetRequestBody` errors in relay retry paths; return consistent **413** on oversized bodies (400 for other read errors)
- Add `Unwrap()` to `types.NewAPIError` so `errors.Is/As` can match wrapped underlying errors
- `go test ./...` passes
2025-12-16 18:10:00 +08:00
t0ng7u
c2ed76ddfd
🛡️ fix: prevent OOM on large/decompressed requests; skip heavy prompt meta when token count is disabled
...
Clamp request body size (including post-decompression) to avoid memory exhaustion caused by huge payloads/zip bombs, especially with large-context Claude requests. Add a configurable `MAX_REQUEST_BODY_MB` (default `32`) and document it.
- Enforce max request body size after gzip/br decompression via `http.MaxBytesReader`
- Add a secondary size guard in `common.GetRequestBody` and cache-safe handling
- Return **413 Request Entity Too Large** on oversized bodies in relay entry
- Avoid building large `TokenCountMeta.CombineText` when both token counting and sensitive check are disabled (use lightweight meta for pricing)
- Update READMEs (CN/EN/FR/JA) with `MAX_REQUEST_BODY_MB`
- Fix a handful of vet/formatting issues encountered during the change
- `go test ./...` passes
2025-12-16 17:00:19 +08:00
CaIon
692b5ff5ac
feat(auth): refactor IP restriction handling to use clearer variable naming
2025-12-15 20:13:09 +08:00
CaIon
947a763a1a
feat(auth): enhance IP restriction handling with CIDR support
2025-12-15 17:24:09 +08:00
CaIon
6175f254a2
refactor(channel_select): enhance retry logic and context key usage for channel selection
2025-12-13 16:43:38 +08:00
CaIon
e0a79e853d
refactor(auth): replace direct token group setting with context key retrieval
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (amd64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (arm64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Create multi-arch manifests (Docker Hub) (push) Has been cancelled
2025-12-13 01:38:12 +08:00
Calcium-Ion
3c5edc54b7
Merge pull request #2426 from QuantumNous/feat/auto-cross-group-retry
...
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (amd64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (arm64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Create multi-arch manifests (Docker Hub) (push) Has been cancelled
feat(token): add cross-group retry option for token processing
2025-12-12 20:45:54 +08:00
CaIon
c87deaa7d9
feat(token): add cross-group retry option for token processing
2025-12-12 17:59:21 +08:00
hackerxiao
8257438499
feat: 支持仅使用x-api-key获取anthropic格式的模型列表 注释增加
2025-12-12 17:27:24 +08:00
hackerxiao
f9c2e1fbf2
feat: 支持仅使用x-api-key获取anthropic格式的模型列表
2025-12-12 16:53:10 +08:00
Seefs
ee53a7b6bf
Merge pull request #2412 from seefs001/pr-2372
...
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (amd64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (arm64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Create multi-arch manifests (Docker Hub) (push) Has been cancelled
Build Electron App / build (windows-latest) (push) Has been cancelled
Build Electron App / release (push) Has been cancelled
Release (Linux, macOS, Windows) / Linux Release (push) Has been cancelled
Release (Linux, macOS, Windows) / macOS Release (push) Has been cancelled
Release (Linux, macOS, Windows) / Windows Release (push) Has been cancelled
feat: add openai video remix endpoint
2025-12-11 23:35:23 +08:00
Leon
71c26a5843
feat: add environment variable switch for critical rate limit
2025-11-06 15:23:34 +08:00
CaIon
758cd2c15f
refactor(group): update user group handling to utilize userUsableGroups directly and add GetUserGroupRatio function
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (amd64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (arm64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Create multi-arch manifests (Docker Hub) (push) Has been cancelled
Release (Linux, macOS, Windows) / Linux Release (push) Has been cancelled
Release (Linux, macOS, Windows) / macOS Release (push) Has been cancelled
Release (Linux, macOS, Windows) / Windows Release (push) Has been cancelled
2025-10-30 21:16:42 +08:00
Seefs
b26333b2cd
Merge pull request #2121 from QuantumNous/feat/special_group
...
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (amd64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (arm64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Create multi-arch manifests (Docker Hub) (push) Has been cancelled
Build Electron App / build (windows-latest) (push) Has been cancelled
Build Electron App / release (push) Has been cancelled
Release (Linux, macOS, Windows) / Linux Release (push) Has been cancelled
Release (Linux, macOS, Windows) / macOS Release (push) Has been cancelled
Release (Linux, macOS, Windows) / Windows Release (push) Has been cancelled
feat: add special user usable group setting
2025-10-29 18:54:51 +09:00
CaIon
6aec088693
feat: add special user usable group setting
2025-10-28 23:25:43 +08:00
CaIon
a00c6393c5
feat: implement audio duration retrieval without ffmpeg dependencies
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (amd64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (arm64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Create multi-arch manifests (Docker Hub) (push) Has been cancelled
Build Electron App / build (windows-latest) (push) Has been cancelled
Build Electron App / release (push) Has been cancelled
Release (Linux, macOS, Windows) / Linux Release (push) Has been cancelled
Release (Linux, macOS, Windows) / macOS Release (push) Has been cancelled
Release (Linux, macOS, Windows) / Windows Release (push) Has been cancelled
2025-10-28 15:50:45 +08:00
feitianbubu
86cd2802d5
fix: fail get moel by
...
multipart/form-data; boundary
2025-10-23 22:15:02 +08:00
feitianbubu
fe9b092b0b
feat: doubao-seedream support image edit
2025-10-23 21:19:33 +08:00
CaIon
9ab5df9398
fix: remove redundant error message details for channel retrieval failures
2025-10-14 13:53:33 +08:00
Seefs
5010f2d004
format: package name -> github.com/QuantumNous/new-api ( #2017 )
2025-10-11 15:30:09 +08:00
feitianbubu
06ae3efa19
feat: add openai sdk create
2025-10-11 02:44:01 +08:00
feitianbubu
94b68c2b63
feat: add sora video fetch task
2025-10-10 15:25:29 +08:00
feitianbubu
0d0e4f5333
fix: avoid get model consuming body
2025-10-10 14:19:49 +08:00
feitianbubu
1d1759aaae
feat: add sora video submit task
2025-10-09 15:00:02 +08:00
Seefs
f8c9763a64
Merge branch 'alpha' into pr/fix-video-get-task
2025-10-02 14:43:11 +08:00
Seefs
8eace6bb62
feat: 通用二步验证
2025-09-30 12:12:50 +08:00
Seefs
8d32b08d44
Merge branch 'alpha' into feat-vertex-veo
2025-09-13 13:10:39 +08:00
feitianbubu
8da06d5473
fix: get video task err when Content-Type=json
2025-09-11 12:53:19 +08:00
t0ng7u
ed71c9fcf3
🎨 style(go): format entire codebase
...
- Apply canonical Go formatting to all .go files
- No functional changes; whitespace/import/struct layout only
- Improves consistency, reduces diff noise, and aligns with standard tooling
2025-08-31 13:08:34 +08:00
Sh1n3zZ
cf8b021b61
feat: vertex veo ( #1450 )
2025-08-27 18:06:47 +08:00
creamlike1024
d6fcc7a51d
feat: add disable cache middleware
2025-08-27 01:30:01 +08:00
CaIon
781a708173
feat: support qwen-image-edit
2025-08-25 14:33:12 +08:00
Nekohy
2d1512096a
feats:add custom headers override
2025-08-24 01:02:23 +08:00
CaIon
893104a173
refactor: move anthropicKey retrieval to improve authorization handling
2025-08-15 16:08:55 +08:00
CaIon
e0f256506f
Merge branch 'alpha' into refactor_relay
...
# Conflicts:
# dto/openai_image.go
2025-08-15 13:46:34 +08:00
CaIon
013b30c228
refactor: enhance error handling and masking for model not found scenarios
2025-08-15 12:41:05 +08:00
CaIon
c9e9a24e99
refactor: centralize logging and update resource initialization
...
This commit refactors the logging mechanism across the application by replacing direct logger calls with a centralized logging approach using the `common` package. Key changes include:
- Replaced instances of `logger.SysLog` and `logger.FatalLog` with `common.SysLog` and `common.FatalLog` for consistent logging practices.
- Updated resource initialization error handling to utilize the new logging structure, enhancing maintainability and readability.
- Minor adjustments to improve code clarity and organization throughout various modules.
This change aims to streamline logging and improve the overall architecture of the codebase.
2025-08-14 21:10:04 +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
CaIon
b850f94139
fix(auth): refine authorization header setting for messages endpoint #1575
Publish Docker image (Multi Registries) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled
2025-08-12 20:42:44 +08:00
IcedTangerine
9717af7dcd
Merge pull request #1553 from feitianbubu/pr/add-jimeng-officail-api
...
Publish Docker image (Multi Registries) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled
feat: add jimeng video official api
2025-08-12 16:32:49 +08:00
Calcium-Ion
23d4100fe3
Merge pull request #1556 from QuantumNous/fix-register-mail-verifycode-waiting-time
...
fix: 注册时发送邮件验证码没有等待时间
2025-08-12 14:20:09 +08:00
creamlike1024
46cd3f4071
feat(middleware): redis atomic incr, show waiting time
2025-08-10 23:18:09 +08:00
Seefs
3b6d0d0291
Merge pull request #1547 from seefs001/feature/model_list
...
✨ feat: Enhance model listing and retrieval with support for Anthropic and Gemini models; refactor routes for better API key handling
2025-08-10 22:57:20 +08:00
creamlike1024
ff2e0dbc26
feat(middleware): add email verification rate limit
2025-08-10 21:22:53 +08:00
CaIon
8907e5cf6d
✨ feat: Add ChannelOtherSettings to manage additional channel configurations
Publish Docker image (Multi Registries) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled
2025-08-10 20:21:30 +08:00
feitianbubu
73609f50d0
feat: add jimeng video official api
2025-08-10 16:54:44 +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