Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
a38bd413
Commit
a38bd413
authored
Feb 06, 2026
by
yangjianbo
Browse files
fix(计费): gpt-5.3-codex 定价回退到 gpt-5.2-codex
parent
9e1535e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/internal/service/pricing_service.go
View file @
a38bd413
...
@@ -651,7 +651,8 @@ func (s *PricingService) matchByModelFamily(model string) *LiteLLMModelPricing {
...
@@ -651,7 +651,8 @@ func (s *PricingService) matchByModelFamily(model string) *LiteLLMModelPricing {
// 回退顺序:
// 回退顺序:
// 1. gpt-5.2-codex -> gpt-5.2(去掉后缀如 -codex, -mini, -max 等)
// 1. gpt-5.2-codex -> gpt-5.2(去掉后缀如 -codex, -mini, -max 等)
// 2. gpt-5.2-20251222 -> gpt-5.2(去掉日期版本号)
// 2. gpt-5.2-20251222 -> gpt-5.2(去掉日期版本号)
// 3. 最终回退到 DefaultTestModel (gpt-5.1-codex)
// 3. gpt-5.3-codex -> gpt-5.2-codex
// 4. 最终回退到 DefaultTestModel (gpt-5.1-codex)
func
(
s
*
PricingService
)
matchOpenAIModel
(
model
string
)
*
LiteLLMModelPricing
{
func
(
s
*
PricingService
)
matchOpenAIModel
(
model
string
)
*
LiteLLMModelPricing
{
// 尝试的回退变体
// 尝试的回退变体
variants
:=
s
.
generateOpenAIModelVariants
(
model
,
openAIModelDatePattern
)
variants
:=
s
.
generateOpenAIModelVariants
(
model
,
openAIModelDatePattern
)
...
@@ -663,6 +664,13 @@ func (s *PricingService) matchOpenAIModel(model string) *LiteLLMModelPricing {
...
@@ -663,6 +664,13 @@ func (s *PricingService) matchOpenAIModel(model string) *LiteLLMModelPricing {
}
}
}
}
if
strings
.
HasPrefix
(
model
,
"gpt-5.3-codex"
)
{
if
pricing
,
ok
:=
s
.
pricingData
[
"gpt-5.2-codex"
];
ok
{
log
.
Printf
(
"[Pricing] OpenAI fallback matched %s -> %s"
,
model
,
"gpt-5.2-codex"
)
return
pricing
}
}
// 最终回退到 DefaultTestModel
// 最终回退到 DefaultTestModel
defaultModel
:=
strings
.
ToLower
(
openai
.
DefaultTestModel
)
defaultModel
:=
strings
.
ToLower
(
openai
.
DefaultTestModel
)
if
pricing
,
ok
:=
s
.
pricingData
[
defaultModel
];
ok
{
if
pricing
,
ok
:=
s
.
pricingData
[
defaultModel
];
ok
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment