快速结论:该问题出现在 LiteLLM 代理版本较旧(如 1.81.14)时,向 gpt-4o/gpt-4o-mini/gpt-4.1/gpt-4.1-mini 发送 service_tier="priority" 请求后,计费仍按默认档位费率计算,导致费用被低估。优先升级 LiteLLM 到包含定价数据修复的最新版本,并确认 litellm_version 版本号。
适用环境:LiteLLM 代理(Proxy),涉及 OpenAI 模型 gpt-4o、gpt-4o-mini、gpt-4.1、gpt-4.1-mini;问题在 LiteLLM 1.81.14 版本中复现。
最快修复方案:升级 LiteLLM 到最新版本(main 分支已修复,commit bc6e7df05)。Issue 作者确认升级后 dated-snapshot 模型条目已补齐 priority 定价键,问题不再出现。
注意事项:如果升级后问题仍存在,则需要进一步排查 lookup 逻辑,而非定价数据缺失;该修复仅在 main 分支验证,具体发布版本号请以官方 Release 为准。
问题场景
用户在 LiteLLM 代理上以 service_tier="priority" 调用 gpt-4o、gpt-4o-mini、gpt-4.1、gpt-4.1-mini 时发现:OpenAI 响应中正确回显 service_tier == "priority",但 LiteLLM 计算的费用(x-litellm-response-cost 响应头或 spend 日志)与默认档位费率一致,而非 priority 档费率。对于 gpt-5 系列模型则没有此问题。
报错原文
[Bug]: service_tier=priority silently billed at default rate for gpt-4o/gpt-4.1 family (missing pricing keys on dated-snapshot model entries)
# Actual behaviour
For gpt-4o, gpt-4o-mini, gpt-4.1, and gpt-4.1-mini, sending service_tier="priority" is accepted by OpenAI, but the cost LiteLLM computes (x-litellm-response-cost header / spend logs) is identical to the default-tier cost.
# Root cause
model_prices_and_context_window_backup.json defines input_cost_per_token_priority / output_cost_per_token_priority on the alias entries but NOT on the dated-snapshot entries that OpenAI actually echoes back in response.model
原因分析
可能原因是历史版本 LiteLLM 的定价数据不完整:input_cost_per_token_priority / output_cost_per_token_priority 只配置在模型别名条目(如 gpt-4o)上,而未配置在 OpenAI 实际回显的 dated-snapshot 条目(如 gpt-4o-2024-08-06)上。LiteLLM 在计算成本时优先使用 dated-snapshot 名称查找定价,当该条目缺少 _priority 键时,静默回退到默认费率,且不报错。该问题已在最新 main 分支修复,dated-snapshot 条目已补齐 priority 定价键。
环境排查
- 确认 LiteLLM 代理版本:通过
/health/readiness接口查看litellm_version字段。 - 若版本为 1.81.14 或更早,优先考虑升级。
- 确认调用的模型名称是别名(如
gpt-4o)还是 dated-snapshot(如gpt-4o-2024-08-06),两者的计费 lookup 路径可能不同。
解决步骤
- 升级 LiteLLM 到最新版本(包含 commit bc6e7df05 的构建),或等待包含此修复的正式 Release 发布后升级。
- 升级后,在代理上重新发起
service_tier="priority"的测试请求,确认x-litellm-response-cost响应头中的费用与 priority 档费率一致。 - 如果升级后问题仍存在,检查定价数据是否被自定义配置覆盖(如自定义
model_prices_and_context_window.json),并确认请求实际路由到的模型名称是否为 dated-snapshot 形式。
验证方法
升级后,使用 gpt-4o(或 gpt-4o-mini、gpt-4.1、gpt-4.1-mini)发送 service_tier="priority" 请求,检查 x-litellm-response-cost 响应头,确认费用与 priority 档费率(约为默认费率的 1.7-2 倍)匹配,而非默认费率。
参考来源
AI 工具推荐
想把多个 AI 模型放在一个入口?
GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。
推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。
这个方案解决了吗?
可以继续搜索完整报错,或查看同一工具的其他排查指南。
![[Bug]: CheckBatchCost stale sweep excludes completed statuses that its own job selection includes, so a completed unprocessed row is never s](https://www.chat-gpts.plus/wp-content/uploads/2026/08/37153-cc613eab-768x403.jpg)

