QuantumNous / QuantumNous/new-api
部分模型定价转换异常
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 48.5k
- Forks
- 11.6k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 58
Description
提交前必读
- 文档:https://docs.newapi.ai/
- 使用问题先看或先问:https://deepwiki.com/QuantumNous/new-api
- 开启透传请勿反馈问题;透传会直接发送内容,不会经过 new-api 的逻辑处理。
- 请以简练语言陈述事实与证据。Issue 正文及后续评论均不得直接粘贴未经人工过滤的大段 AI 文本。
- 转发类问题必须先确认问题发生在 new-api 这一层:请使用等价的脱敏请求分别直连上游和经过 new-api,对比响应状态、错误体与服务端日志。未经对比、仅展示上游报错的反馈不接受 issue。
- 不接受 Coding Plan、逆向渠道、第三方封装接口,以及将 Codex 接口反代为通用 API 后产生的兼容性问题;Codex API 自身特有的协议或行为也不应被当作标准 OpenAI API 行为,相关问题请先向渠道或接口提供方确认。
- 本项目不提供官方托管服务,也不为第三方托管站、中转站或 API 服务提供技术支持;此类问题请联系对应运营方。
- 警告:删除本模板、删除小节标题或随意清空内容的 issue,可能会被直接关闭;多次提交未经人工过滤的大段 AI 文本,或重复恶意提交者,可能会被 block。
部署来源
本仓库 Release / 官方镜像(自行部署)
您当前的 newapi 版本
v1.0.0-rc.38
提交确认
- 非重复 issue: 我已搜索现有 Issues,确认目前没有类似 issue。
- 提交前必读: 我已完整阅读上方“提交前必读”,并已查看文档 https://docs.newapi.ai/、项目 README 且向 AI 提问,确认这不是使用、配置或接入类问题。
- 受支持版本: 我已提供准确的版本号、commit 或镜像标签(不是
latest或unknown),并确认问题可在本仓库未修改的受支持版本中复现。 - 非第三方服务: 我确认这不是第三方托管站、中转站、API 服务或未经本仓库原版验证的 fork 所独有的问题;第三方实例问题应联系其运营方。
- 非透传: 我确认相关渠道未开启透传。开启透传会直接发送内容,不会经过 new-api 的逻辑处理,此类问题不接受 issue。
- 问题归属: 我已提供足以区分客户端、new-api 和上游的证据;转发问题已使用等价的脱敏请求对比直连上游与经过 new-api 的结果,确认错误由 new-api 引入或改变,而非仅原样转发上游报错。
- 渠道与协议边界: 我确认问题不是由 Coding Plan、逆向渠道、第三方封装接口、Codex 反代接口,或 Codex API 自身特有行为导致;若问题最初出现于此类接口,我已在本仓库支持的标准 API 协议上复现。
- 维护成本: 我理解项目维护者精力有限。Issue 正文及后续评论均不得直接粘贴未经人工过滤的大段 AI 文本,须先提炼可复核的要点;不遵循模板要求或缺少要点、无法复核的内容可能会被无视或直接关闭。多次提交此类内容可能会被 block。
问题描述
实际现象:更新了版本,在转换计费表达式的时候,发现部分模型提示“无法验证模型路由配置”,实测 gpt、claude 系列都报这个错,gemini、deepseek 等其他系列暂未发现
F12 抓取转换请求内容如下:
-
请求接口:/api/option/model_pricing/convert
-
payload:
{
"model_name":"gpt-5",
"pricing":{
"billing_setting.billing_mode":"ratio",
"ModelRatio":0.625,
"CompletionRatio":8
}
}
- response:
{
"data": {
"billing_details": {},
"unsupported_reason": "The model routing configuration could not be verified."
},
"message": "",
"success": true
}
复现步骤
更新到 v1.0.0-rc.38 版本,对 gpt、claude 模型进行计费表达式转换
预期结果
正常转换到新的计费表达式定价模式
相关截图
转换异常截图:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the /api/option/model_pricing/convert endpoint and reproduce the supplied payload for gpt-5 and a Claude model on v1.0.0-rc.38. Trace the model-routing verification path and compare its response with working Gemini or DeepSeek conversions. Done means supported GPT and Claude pricing conversions return billing details without the unsupported_reason response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100