自定义 provider 双重计费 + 兜底高价:一笔 ¥18.46 应为 ¥0.26
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
**提交人**: 用户6252
**客户端版本**: 0.1.33
---
## 现象
充值 100 元后余额变成 94 元,扣了约 6 元;但每次对话界面只显示 1 分/几分钱,金额严重不符。
## 复现步骤
1. 配置自定义 provider `deep`(baseUrl: https://api.deepseek.com/anthropic,鉴权走用户自己的 DeepSeek key),模型 ID 填裸名 `deepseek-v4-flash`
2. 用该自定义模型对话,累计约 17.5 万 token(输入 136,722 / 输出 43,826 / 缓存 1,952,384)
3. 查看 daily_model_usage / 余额,发现该笔被记 ¥18.46
## 期望行为
- 自定义模型鉴权走用户自己的 key,不应计入 Cindy 账户;
- 即使计入,应按模型实际报价分项计费(官方价应收 ¥0.26)
## 实际行为
- 该笔被记 ¥18.46,是官方价(输入¥1/M、输出¥2/M、缓存¥0.02/M)的 70 倍;
- 自定义模型用量同时计入 daily_model_usage(¥18.46)和会话 total_cost_amount(¥18.55),疑似双重计费;
- 根因:模型 ID 为裸名 `deepseek-v4-flash`,不在 Cindy 价格表(`deepseek/deepseek-v4-flash`)内,计费引擎走了兜底高价 ¥8.66/百万。
## 诉求
1. 撤销/更正 ¥18.46 中多扣的 ¥18.20
2. 核查自定义模型双重计费,确认后续自定义模型不再计入 Cindy 账户
3. 修复自定义 provider 计费逻辑:模型 ID 不在价格表时应按实际 provider 报价或报错,而非走兜底高价
---
**版本区域**: CN
**OS**: win32 x64 (10.0.22621)
**界面语言**: zh-CN
Contributor guide
Research direction
Start by tracing custom provider billing from the model ID and provider key handling through the pricing table, then compare daily_model_usage with session total_cost_amount for this reproduction. Done means custom-provider usage is not charged to the Cindy account, unknown model IDs do not receive an unexplained fallback price, and the reported charge is corrected or clearly rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, payments
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100