huangzhenpc
c41ca95a43
fix: 管理员自定义价格的任务模型自动按次计费,不再乘 OtherRatios
...
当管理员为任务模型(如 sora_video2)设置了固定价格时,
之前会错误地将价格乘以 seconds/size 等 OtherRatios,
导致设置 $2/次 实际收费 $8($2 × 4秒)。
新增 IsTaskPerCallBilling() 判断逻辑:
- 模型在 TASK_PRICE_PATCH 环境变量中 → 按次(兼容旧逻辑)
- 模型有管理员配置的价格且不在默认价格表中 → 自动按次
默认价格表中的模型(如 sora-2: $0.3)仍按原逻辑乘 OtherRatios。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-24 17:01:12 +08:00
CaIon
deff59a5be
fix: increase StreamScannerMaxBufferMB limit and add handling for gpt-5.4-nano prefix
2026-03-22 13:55:10 +08:00
CaIon
c0a0285f74
fix: update language settings and improve model pricing editor for better clarity and functionality
2026-03-06 21:36:51 +08:00
CaIon
5372d9ba55
fix: add support for gpt-5.4 model in model_ratio.go
2026-03-06 11:43:05 +08:00
CaIon
32d9ae1f83
feat(gemini): implement video generation configuration and billing estimation
...
- Added Gemini video generation configuration structures and payloads.
- Introduced functions for parsing and resolving video duration and resolution from metadata.
- Enhanced the Vertex adaptor to support Gemini video generation requests and billing estimation based on duration and resolution.
- Updated model pricing settings for new Gemini video models.
2026-02-28 17:37:08 +08:00
RedwindA
b2898b392a
fix: adjust default Gemini cache ratios
2026-02-20 12:28:30 +08:00
CaIon
aed8c07cd7
refactor(ratio): replace maps with RWMap for improved concurrency handling
2026-02-08 00:48:21 +08:00
Seefs
8ef6089bf7
feat: make 5m cache-creation ratio configurable
2026-02-06 19:46:59 +08:00
Papersnake
e194b747c3
feat: support adaptive thinking
2026-02-06 11:01:23 +08:00
Papersnake
7ca072b1b0
feat: add claude-opus-4-6
2026-02-06 09:12:45 +08:00
CaIon
330e1e6395
remove: drop support for claude-2 and claude-1 series models
...
- Remove claude-instant-1.2, claude-2, claude-2.0, claude-2.1 from model lists
- Remove /v1/complete endpoint support (legacy completion API)
- Remove RequestModeCompletion and related code paths
- Simplify handler functions by removing requestMode parameter
- Update all channel adaptors that referenced claude handlers
2026-02-05 17:20:46 +08:00
RedwindA
3985d10ae1
feat(gemini): support cached token billing
2026-02-01 22:50:47 +08:00
Seefs
4f6d92ce7b
fix: /v1/responses/compact default billing
2026-01-28 14:22:34 +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
CaIon
87a75b0565
feat(ratio): add functions to check for audio ratios and clean up unused code
2025-12-31 21:29:10 +08:00
CaIon
7bbb7f8114
feat(model): add audio ratios for new TTS models and adjust default values
2025-12-31 21:22:33 +08:00
Seefs
0edef97413
fix: revert model ratio
2025-12-25 15:37:54 +08:00
CaIon
06d1bd404b
feat(model_ratio): add default ratios for gpt-4o-mini-tts
2025-12-13 19:14:27 +08:00
CaIon
be2a863b9b
feat(audio): enhance audio request handling with token type detection and streaming support
2025-12-13 17:24:23 +08:00
FlowerRealm
a655801017
feat: add claude-haiku-4-5-20251001 model support
...
- Add model to Claude ModelList
- Add model ratio (0.5, $1/1M input tokens)
- Add completion ratio support (5x, $5/1M output tokens)
- Add cache read ratio (0.1, $0.10/1M tokens)
- Add cache write ratio (1.25, $1.25/1M tokens)
Model specs:
- Context window: 200K tokens
- Max output: 64K tokens
- Release date: October 1, 2025
2025-12-05 18:54:20 +08:00
Seefs
607f7305b7
feat: gemini 3 thinking level gemini-3-pro-preview-high
2025-12-01 16:40:46 +08:00
Papersnake
766b6bc795
feat: add claude-opus-4-5-20251101
2025-11-25 10:53:01 +08:00
Papersnake
113ca72ae9
feat: add claude-opus-4-5-20251101 ratio
2025-11-25 10:49:34 +08:00
CaIon
c8bbf7bed8
feat: Add ContextKeyLocalCountTokens and update ResponseText2Usage to use context in multiple channels
2025-11-21 18:17:01 +08:00
Xyfacai
a4bfec164e
fix: 未设置价格模型不会被拉取,除非设置自用模式
2025-11-13 18:44:18 +08:00
Sh1n3zZ
af671d34c3
feat: replicate channel flux model
2025-11-08 01:24:45 +08:00
CaIon
6aec088693
feat: add special user usable group setting
2025-10-28 23:25:43 +08:00
Seefs
5010f2d004
format: package name -> github.com/QuantumNous/new-api ( #2017 )
2025-10-11 15:30:09 +08:00
Xyfacai
09495c8ef6
feat: sora 增加参数校验与计费
2025-10-10 23:56:36 +08:00
creamlike1024
eeef719f3a
feat: 支持 gemini-robotics-er-1.5-preview
2025-10-01 17:33:54 +08:00
Seefs
740c46102b
Merge pull request #1924 from prnake/claude-4-5
...
feat: support claude-sonnet-4-5-20250929
2025-09-30 09:26:34 +08:00
papersnake
112ab0b17c
feat: support claude-sonnet-4-5-20250929
2025-09-30 09:14:12 +08:00
dd
f9399e279c
Merge branch 'QuantumNous:main' into main
2025-09-29 19:15:43 +08:00
RedwindA
71b3c90bc9
解锁deepseek补全倍率;允许deepseek渠道获取模型
2025-09-29 18:32:44 +08:00
dd
40a6d957b5
Merge branch 'QuantumNous:main' into main
2025-09-29 14:13:50 +08:00
CaIon
552d795742
Merge branch 'alpha'
2025-09-19 14:20:15 +08:00
creamlike1024
5cae6be108
feat: 支持 gemini-embedding-001
2025-09-19 00:24:01 +08:00
DD
71d41d6eaa
Merge branch 'main' of github.com:danding5/new-api
...
# Conflicts:
# relay/relay_adaptor.go
2025-09-15 14:31:06 +08:00
creamlike1024
d21886b9fb
Merge branch 'alpha' into imageratio-and-audioratio-edit
2025-09-15 14:12:24 +08:00
CaIon
1a8d781721
Revert "feat: gemini-2.5-flash-image-preview 文本和图片输出计费"
...
This reverts commit a45513a7a6 .
2025-09-13 12:53:28 +08:00
DD
68d30225e5
merge
2025-09-10 19:11:58 +08:00
DD
2fb5fc231d
Merge branches 'main' and 'main' of github.com:danding5/new-api
...
# Conflicts:
# common/api_type.go
# constant/api_type.go
# constant/channel.go
# relay/relay_adaptor.go
# web/src/constants/channel.constants.js
2025-09-10 18:33:42 +08:00
DD
cfbc2df3f8
add submodel.ai
2025-09-08 16:21:21 +08:00
Seefs
80cfa0d0df
Merge pull request #1677 from QuantumNous/gemini-2.5-flash-image-preview-billing
...
feat: gemini-2.5-flash-image-preview 文本和图片输出计费
2025-09-07 14:15:24 +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
creamlike1024
ff4b5b3fd2
feat: improve ratio update
2025-08-30 23:53:46 +08:00
creamlike1024
2875dbba10
feat: 图像倍率,音频倍率和音频补全倍率配置
2025-08-30 23:28:09 +08:00
creamlike1024
a45513a7a6
feat: gemini-2.5-flash-image-preview 文本和图片输出计费
2025-08-27 21:30:52 +08:00
CaIon
a102bed25a
fix(model_ratio): update return value logic for gemini-2.5-flash-lite
2025-08-26 23:01:00 +08:00
CaIon
79c7d8f477
fix: improve model ratio handling for reserved models in getHardcodedCompletionModelRatio
2025-08-25 11:59:55 +08:00