Skip to content

Commit 576bd20

Browse files
committed
Update default model for token counter
1 parent b920b83 commit 576bd20

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/src/app/api/v1/token-count/_post.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const tokenCountRequestSchema = z.object({
2626

2727
type TokenCountRequest = z.infer<typeof tokenCountRequestSchema>
2828

29+
const DEFAULT_ANTHROPIC_MODEL = 'claude-opus-4-6'
30+
2931
export async function postTokenCount(params: {
3032
req: NextRequest
3133
getUserInfoFromApiKey: GetUserInfoFromApiKeyFn
@@ -87,7 +89,7 @@ export async function postTokenCount(params: {
8789
userId,
8890
messageCount: messages.length,
8991
hasSystem: !!system,
90-
model: model ?? 'claude-opus-4-5-20251101',
92+
model: model ?? DEFAULT_ANTHROPIC_MODEL,
9193
tokenCount: inputTokens,
9294
},
9395
`Token count: ${inputTokens}`
@@ -124,7 +126,6 @@ async function countTokensViaAnthropic(params: {
124126

125127
// Convert model from OpenRouter format (e.g. "anthropic/claude-opus-4.5") to Anthropic format (e.g. "claude-opus-4-5-20251101")
126128
// For non-Anthropic models, use the default Anthropic model for token counting
127-
const DEFAULT_ANTHROPIC_MODEL = 'claude-opus-4-5-20251101'
128129
const isNonAnthropicModel = !model || !isClaudeModel(model)
129130
const anthropicModelId = isNonAnthropicModel
130131
? DEFAULT_ANTHROPIC_MODEL

0 commit comments

Comments
 (0)