1434 Commits

Author SHA1 Message Date
Seefs
274307b0a9
fix(ali): accept string usage values in task polling 2026-04-09 12:48:17 +08:00
forsakenyang
c734db34e8
feat: add minimax image generation relay support (#4103) 2026-04-08 16:57:44 +08:00
Calcium-Ion
9ffb85a36b
Merge pull request #4068 from feitianbubu/seedance-support-duration
Seedance support duration
2026-04-08 15:01:25 +08:00
zuiho
c66636a0c7 fix: 采纳 CodeRabbit 建议,!Done 时也用 fallback 覆盖占位 CompletionTokens
message_start 阶段可能给 CompletionTokens 非零占位值,
只检查 == 0 不够,加上 !Done && fallback > current 条件。
2026-04-07 17:52:11 +08:00
zuiho
f7cdc727df fix: Claude 流式断流时不再整份覆盖 usage,保留 cache 计费字段
HandleStreamFinalResponse 在 !Done 时调用 ResponseText2Usage 整份覆盖
claudeInfo.Usage,导致 message_start 已获取的 CacheReadInputTokens、
CacheCreationInputTokens 等字段丢失,prompt 退化为占位值 1。

修复:
- 只补缺失的 CompletionTokens/PromptTokens,保留已有 cache 数据
- PromptTokens 兜底改用 info.GetEstimatePromptTokens()(与其他渠道对齐)

Fixes #4127
2026-04-07 17:41:08 +08:00
CaIon
03758a4a85
refactor(file-source): unify file source creation and enhance caching mechanisms 2026-04-06 15:54:55 +08:00
CaIon
8fc0eb78e2
feat(billing): enhance task billing process with video input detection and updated pricing logic
- Added `EstimateBilling` function to check for video input in request metadata and return corresponding discount ratios.
- Updated `ModelPriceHelperPerCall` to incorporate new pricing logic based on model ratios and video input.
- Enhanced task billing logs to include model ratio information and adjusted calculations for actual quota based on additional multipliers.
- Introduced `renderTaskBillingProcess` to improve rendering of task billing information in the UI.
2026-04-06 15:54:55 +08:00
Seefs
82c2008d2c fix: emit claude message_delta for usage-only final stream chunk 2026-04-04 20:21:13 +08:00
CaIon
bb5b9eaca2 fix(relay-claude): set TopP to nil in Claude request to align with API requirements 2026-04-03 20:18:28 +08:00
feitianbubu
b713e277cd feat: metadata correct parse 2026-04-03 15:28:08 +08:00
feitianbubu
08a5243bbc feat: TaskSubmitReq support Duration 2026-04-03 15:00:23 +08:00
Calcium-Ion
9816ad87e3
feat: add HEIC/HEIF image format support for Gemini channel (#4049)
* feat: add HEIC/HEIF image format support

Add detection, MIME type mapping, and dimension parsing for HEIC/HEIF
images via ISOBMFF ftyp brand inspection and ispe box parsing. Update
Gemini relay to accept these formats and refactor getImageConfig to
properly retry decoders using buffered data.

* fix: handle ISOBMFF extended sizes in HEIF dimension parser

parseHEIFDimensions now correctly handles boxSize==1 (64-bit extended
size) and boxSize==0 (box-to-EOF), preventing the parser from breaking
out of the loop when encountering these valid ISOBMFF box headers
before reaching the meta box.
2026-04-02 21:32:42 +08:00
Calcium-Ion
0193018af6
Merge pull request #4042 from feitianbubu/pr/fe9713dcbf8795e127fbea2fcb1f3011da86ad54
新增seedance2.0视频接口支持
2026-04-02 21:30:31 +08:00
RedwindA
79527c0ab1 feat: add HEIC/HEIF image format support
Add detection, MIME type mapping, and dimension parsing for HEIC/HEIF
images via ISOBMFF ftyp brand inspection and ispe box parsing. Update
Gemini relay to accept these formats and refactor getImageConfig to
properly retry decoders using buffered data.
2026-04-02 16:40:45 +08:00
Calcium-Ion
41cd051ea9
Merge pull request #3505 from seefs001/fix/claude-media-support
fix: add basic inline file support for Claude relay
2026-04-02 13:29:21 +08:00
Seefs
c04f82bfb5 TODO: fix chat -> messages file type 2026-04-02 13:16:58 +08:00
feitianbubu
dafc7618c3 feat: add seedance fail reason 2026-04-02 12:26:44 +08:00
feitianbubu
22692b3f87 feat: seedance support seconds 2026-04-02 12:26:37 +08:00
feitianbubu
d36e892905 fix: seedance only one text 2026-04-02 12:26:33 +08:00
feitianbubu
3cd1ba4673 fix: seedance metadata override prompt 2026-04-02 12:26:27 +08:00
feitianbubu
b7c0f754ad feat: add seedance2.0 video api 2026-04-02 12:24:24 +08:00
Calcium-Ion
7efb1922fe
Merge pull request #3526 from feitianbubu/pr/e560265b6e57aa7b95bc98cb53397ef0a3082d9d
支持wan2.7生图-wan2.7-image
2026-04-02 00:15:04 +08:00
Calcium-Ion
89fe99f3bd
Merge pull request #3512 from imlhb/patch-2
fix: prevent double-counting of image count n in billing
2026-04-02 00:14:39 +08:00
feitianbubu
e5b5331d3b feat: wan 2.7 support N for gen images number 2026-04-01 17:39:50 +08:00
feitianbubu
18373c6eac feat: add wan 2.7 2026-04-01 17:39:11 +08:00
CaIon
ab99c30884 fix: move image count n to OtherRatio to prevent double-counting
The previous commit commented out AddOtherRatio("n") in the Ali
adaptor to fix double-counting but this could cause billing evasion
when n is specified via extra["parameters"] instead of request.N.

Root cause: ImagePriceRatio in GetTokenCountMeta() already included
n, AND channel adaptors added OtherRatio("n"), resulting in n²
billing.

Proper fix:
- Remove n from ImagePriceRatio (keep sizeRatio * qualityRatio only)
- In ImageHelper, add default OtherRatio("n") when adaptor hasn't
  set one; set fallback tokens to 1 (base unit)
- Restore Ali adaptor's AddOtherRatio("n") — it uses actual upstream
  parameters/response count, preventing billing evasion
2026-03-31 23:58:10 +08:00
CaIon
d22f889e5d fix(xAI): set MaxTokens to nil when MaxCompletionTokens is 0 for grok-3-mini model 2026-03-31 19:16:16 +08:00
CaIon
20399d3c8f fix: harden SSRF protection for unauthenticated and user-level endpoints
- Add ValidateURLWithFetchSetting check before fetching MJ image URLs
  in RelayMidjourneyImage (unauthenticated endpoint)
- Add ValidateURLWithFetchSetting check before fetching video URLs
  in VideoProxy (upstream-controlled URL)
- Enable ApplyIPFilterForDomain by default to prevent DNS rebinding
  bypass of SSRF protection
- Elevate FetchModels endpoint from AdminAuth to RootAuth
- Update frontend: mark domain IP filtering as recommended, update
  description and i18n translations (zh-CN/zh-TW/en/fr/ja/ru/vi)
2026-03-31 17:57:47 +08:00
刘泓宾
53aeee4ff7
Comment out price data adjustment logic
Comment out code that modifies price data based on image count.
测试发现,如果是接入阿里百炼平台的qwen-image-2.0系列模型,这边计费的时候会出现 0.2*n*倍率*n的情况,最前面的0.2*n会直接显示为模型价格。
例如:
日志详情	模型价格 $0.600000,专属倍率 0.3
其他详情	大小 1080*1920, 品质 standard, 生成数量 3, 其他倍率 n: 3.000000
计费过程	模型价格:$0.600000 * 专属倍率:0.3 = $0.180000
2026-03-31 17:12:06 +08:00
CaIon
5238f279db feat: record stream interruption reasons via StreamStatus
Some checks failed
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
- Add StreamStatus type (relay/common) to track stream end reason
  (done/timeout/client_gone/scanner_error/eof/panic/ping_fail) and
  accumulate soft errors during streaming via sync.Once + sync.Mutex.
- Add StreamResult (relay/helper) as the callback interface: adapters
  call sr.Error() for soft errors, sr.Stop() for fatal, sr.Done() for
  normal completion. No early-return problem — multiple errors per chunk
  are naturally supported.
- Refactor StreamScannerHandler callback from func(string) bool to
  func(string, *StreamResult). All 9 channel adapters updated.
- Write stream_status into log other JSON field (admin-only) with
  status ok/error, end_reason, error_count, and error messages.
- Frontend: display stream status in log detail expansion for admins.
2026-03-31 16:54:39 +08:00
Seefs
263b9bc695 fix: add basic inline file support for Claude relay 2026-03-30 19:37:21 +08:00
feitianbubu
62b9aaa520 feat: prevent metadata from overriding model fields 2026-03-27 15:31:41 +08:00
Calcium-Ion
0191a68d4e
Merge pull request #3400 from seefs001/fix/openai-usage
refactor: optimize billing flow for OpenAI-to-Anthropic convert
2026-03-23 15:03:57 +08:00
Calcium-Ion
763c3ff709
Merge pull request #3331 from seefs001/fix/claude-beta-query
fix: apply forced beta query at final upstream URL stage
2026-03-23 15:03:36 +08:00
Seefs
9ecad90652 refactor: optimize billing flow for OpenAI-to-Anthropic convert 2026-03-23 14:22:12 +08:00
wenyifan
2c3ae32c8e fix map 2026-03-20 16:48:04 +08:00
wenyifan
498199b37d fix code quality 2026-03-20 16:38:48 +08:00
wenyifan
ff29900f30 feat: Add support for counting cache-hit tokens in llama.cpp OpenAI-Compatible API 2026-03-20 16:10:18 +08:00
Seefs
e520977efc fix: apply forced beta query at final upstream URL stage 2026-03-19 15:49:50 +08:00
Seefs
8aa8b81e03 fix: original_model && upstream_model paramOverrideKeyAuditPaths 2026-03-17 17:00:01 +08:00
Seefs
bc80477b1a feat: simplify param override audit UI and operation labels 2026-03-17 17:00:01 +08:00
Seefs
5db25f47f1 feat: add param override audit modal for usage logs 2026-03-17 17:00:01 +08:00
CaIon
da8a52f50a feat: add conditional setting for HTTP headers in OpenRouter channel type 2026-03-12 19:05:30 +08:00
Seefs
24ec27f844 Merge pull request #3221 from RedwindA/chore/updateModelList
Some checks failed
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
chore: update model lists for frequently used channels
2026-03-12 15:13:03 +08:00
CaIon
5e9cc681f5 feat: update header title for OpenRouter channel type 2026-03-12 15:05:58 +08:00
RedwindA
7e68e1b36a chore: update model lists for frequently used channels 2026-03-11 23:39:18 +08:00
Calcium-Ion
45a59d32fb Merge pull request #3182 from seefs001/feature/params-override-beta-header-append
Some checks failed
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:support $keep_only_declared and deduped $append for header override
2026-03-10 02:03:02 +08:00
Calcium-Ion
3b5d1daf39 Merge pull request #3148 from feitianbubu/pr/d8a25d36204224f8a4248b0ab3b03ba703796ea3
fix: kling risk fail return openAIVideo error
2026-03-09 22:19:04 +08:00
Seefs
d087cc5025 feat:support $keep_only_declared and deduped $append for header token overrides 2026-03-09 00:12:53 +08:00
CaIon
fb76abb329 fix: update OpenAI request fields to use json.RawMessage for dynamic data handling 2026-03-06 19:10:42 +08:00