From 6cf84b118bcc09864aa873c94ea5d4beff6f13aa Mon Sep 17 00:00:00 2001 From: creamlike1024 Date: Sun, 10 Aug 2025 13:37:49 +0800 Subject: [PATCH] feat: update openai websearch price --- setting/operation_setting/tools.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setting/operation_setting/tools.go b/setting/operation_setting/tools.go index 9f19ee847..549a1862e 100644 --- a/setting/operation_setting/tools.go +++ b/setting/operation_setting/tools.go @@ -32,11 +32,12 @@ func GetWebSearchPricePerThousand(modelName string, contextSize string) float64 // 确定模型类型 // https://platform.openai.com/docs/pricing Web search 价格按模型类型收费 // 新版计费规则不再关联 search context size,故在const区域将各size的价格设为一致。 - // gpt-4o and gpt-4.1 models (including mini models) 等模型更贵,o3, o4-mini, o3-pro, and deep research models 等模型更便宜 + // gpt-5, gpt-5-mini, gpt-5-nano 和 o 系列模型价格为 10.00 美元/千次调用,产生额外 token 计入 input_tokens + // gpt-4o, gpt-4.1, gpt-4o-mini 和 gpt-4.1-mini 价格为 25.00 美元/千次调用,不产生额外 token isNormalPriceModel := strings.HasPrefix(modelName, "o3") || strings.HasPrefix(modelName, "o4") || - strings.Contains(modelName, "deep-research") + strings.HasPrefix(modelName, "gpt-5") var priceWebSearchPerThousandCalls float64 if isNormalPriceModel { priceWebSearchPerThousandCalls = WebSearchPrice