Seefs
5f37a1e97c
fix: fix the proxyURL is empty, not using the default HTTP client configuration && the AWS calling side did not apply the relay timeout.
2026-01-05 17:56:24 +08:00
t0ng7u
8e3f9b1faa
🛡️ 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
zdwy5
e1bee48152
fix: 支持aws 通过全局参数透传或者渠道参数透传来 调用 ( #2423 )
...
* fix: 支持aws 通过全局参数透传或者渠道参数透传来 调用
* fix(aws): replace json.Unmarshal with common.Unmarshal for request body processing
---------
Co-authored-by: r0 <liangchunlei@01.ai >
Co-authored-by: CaIon <i@caion.me >
2025-12-12 17:09:27 +08:00
jason.mei
c6a8e4c252
fix(aws): simplify HTTP status code extraction from AWS errors
2025-11-28 18:03:53 +08:00
jason.mei
f2e51963dc
fix(aws): extract HTTP status code from AWS SDK errors
2025-11-28 17:43:37 +08:00
Papersnake
79682dc542
feat: add claude-opus-4-5-20251101
2025-11-25 10:53:01 +08:00
CaIon
62edac7c7f
fix: aws
2025-11-18 16:56:46 +08:00
creamlike1024
9e80e4e7e5
fix(relay/channel/aws): 修复AnthropicBeta字段的omitempty处理
2025-11-14 15:54:12 +08:00
CaIon
e1a52f1d5a
feat(aws): Add support for anthropic-beta header in AwsClaudeRequest
2025-11-14 12:01:20 +08:00
Seefs
687e455051
Merge pull request #2098 from HynoR/chore/c1
...
chore: Update AWS claude 4.5 haiku model's information
2025-10-28 18:32:23 +09:00
iwu
3dbe0c2067
feat: aws client supports proxy settings
...
Signed-off-by: iwu <iwu@tencent.com >
2025-10-27 15:00:20 +08:00
HynoR
b7896585fd
chore: update aws claude 4.5 haiku model's information
2025-10-24 14:21:17 +08:00
CaIon
d4749ba388
refactor: rename AWS model ID and region prefix functions for clarity
2025-10-16 12:10:55 +08:00
CaIon
82e21972ec
feat: 修复aws渠道-thinking后缀不生效的问题
2025-10-15 18:49:27 +08:00
CaIon
dce00141ce
feat: 临时兼容aws使用链接媒体
2025-10-15 18:21:19 +08:00
CaIon
f023efdbfc
feat: support aws bedrock api-keys-use
2025-10-15 17:29:10 +08:00
CaIon
8b65623726
refactor: aws
2025-10-15 16:44:33 +08:00
Seefs
e1c7a4f41f
format: package name -> github.com/QuantumNous/new-api ( #2017 )
2025-10-11 15:30:09 +08:00
CaIon
01469aa01c
refactor(adaptor): extract common header operations into a separate function
2025-10-02 15:28:09 +08:00
Seefs
933ab4340b
Merge pull request #1925 from seefs001/feature/claude-context-editing
...
feat: claude context editing
2025-09-30 09:48:32 +08:00
Seefs
30cb3b8bc2
feat: claude context editing
2025-09-30 09:22:40 +08:00
papersnake
d7db30a23e
feat: support claude-sonnet-4-5-20250929
2025-09-30 09:14:12 +08:00
huanghejian
127029d62d
feat: amazon nova model
2025-09-26 15:55:00 +08:00
huanghejian
6c5181977d
feat: amazon nova model
2025-09-26 15:32:59 +08:00
huanghejian
70c27bc662
feat: improve nova config
2025-09-11 12:31:43 +08:00
huanghejian
e3bc40f11b
pref: support amazon nova
2025-09-11 12:17:16 +08:00
huanghejian
684caa3673
feat: amazon.nova-premier-v1:0
2025-09-11 10:01:54 +08:00
huanghejian
47aaa695b2
feat: support amazon nova
2025-09-10 20:30:00 +08:00
creamlike1024
c40a4f5444
fix: claude header was not set correctly
2025-09-09 23:18:07 +08:00
CaIon
0bb43aa464
refactor: update function signatures to include context and improve file handling #1599
2025-08-15 18:40:54 +08:00
CaIon
ea8cac7c10
feat: add AWS invoke error handling and new error code
2025-08-09 19:26:41 +08:00
Calcium-Ion
6616bb4048
Merge pull request #1508 from wzxjohn/feature/aws_new_apikey_support
...
feat: support aws bedrock apikey
2025-08-06 12:04:28 +08:00
Calcium-Ion
587888a688
Merge pull request #1511 from neotf/feat-05
...
feat: add support for claude-opus-4-1 model and update ratios
2025-08-06 12:03:33 +08:00
neotf
24aa29598a
feat: add support for claude-opus-4-1 model and update ratios
2025-08-06 00:58:46 +08:00
wzxjohn
d247f90571
feat: support aws bedrock apikey
2025-08-05 23:01:30 +08:00
creamlike1024
d2183af23f
feat: convert gemini format to openai chat completions
2025-08-01 22:23:35 +08:00
CaIon
98952198bb
refactor: Introduce standardized API error
...
This commit refactors the application's error handling mechanism by introducing a new standardized error type, `types.NewAPIError`. It also renames common JSON utility functions for better clarity.
Previously, internal error handling was tightly coupled to the `dto.OpenAIError` format. This change decouples the internal logic from the external API representation.
Key changes:
- A new `types.NewAPIError` struct is introduced to serve as a canonical internal representation for all API errors.
- All relay adapters (OpenAI, Claude, Gemini, etc.) are updated to return `*types.NewAPIError`.
- Controllers now convert the internal `NewAPIError` to the client-facing `OpenAIError` format at the API boundary, ensuring backward compatibility.
- Channel auto-disable/enable logic is updated to use the new standardized error type.
- JSON utility functions are renamed to align with Go's standard library conventions (e.g., `UnmarshalJson` -> `Unmarshal`, `EncodeJson` -> `Marshal`).
2025-07-10 15:02:40 +08:00
daggeryu
0595636ceb
fix aws claude-sonnet-4-20250514
2025-05-24 01:21:14 +08:00
CaIon
d95c2436d7
feat: add support for new regions in Claude Sonnet 4 and Claude Opus 4 models in AWS constants
2025-05-23 21:11:00 +08:00
CaIon
1644b7b15d
feat: add new model entries for Claude Sonnet 4 and Claude Opus 4 across multiple components, including constants and cache settings
2025-05-23 15:20:16 +08:00
creamlike1024
425feb88d8
feat: support /v1/responses API
2025-05-02 13:59:46 +08:00
1808837298@qq.com
7143b0f160
feat: Add support for cross-region AWS model handling in awsStreamHandler
2025-03-17 23:41:00 +08:00
1808837298@qq.com
19935ee8ac
feat: Enhance ConvertClaudeRequest method to set request model and handle vertex-specific request conversion
2025-03-17 17:13:33 +08:00
Calcium-Ion
b5aa3c129b
Merge pull request #872 from neotf/main
...
feat: support AWS Model CrossRegion
2025-03-17 16:18:11 +08:00
1808837298@qq.com
53b3599827
refactor: Enhance Claude response handling
2025-03-16 19:11:58 +08:00
1808837298@qq.com
ee302c063c
refactor: Enhance error handling in AWS and Claude response processing by updating function signatures and improving error propagation
2025-03-16 16:47:16 +08:00
1808837298@qq.com
2c81a5f0cc
refactor: Streamline AWS and Claude response handling by consolidating logic and improving error management
2025-03-16 16:07:51 +08:00
neotf
892d014c26
feat: support AWS Model CrossRegion
2025-03-15 01:42:24 +08:00
1808837298@qq.com
7e46d4217d
feat: 初步兼容流模式下openai渠道类型转为claude格式访问 #862
2025-03-13 19:32:08 +08:00
1808837298@qq.com
bd48f43410
feat: claude relay
2025-03-12 21:31:46 +08:00