File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
web/src/app/api/v1/token-count Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ const tokenCountRequestSchema = z.object({
2626
2727type TokenCountRequest = z . infer < typeof tokenCountRequestSchema >
2828
29+ const DEFAULT_ANTHROPIC_MODEL = 'claude-opus-4-6'
30+
2931export 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
You can’t perform that action at this time.
0 commit comments