Skip to content

Commit e0ca891

Browse files
jahoomaclaude
andcommitted
Use Opus 4.6 as default tokenizer for non-Claude models
Opus 4.7's tokenizer differs from most models; using 4.6 gives more representative counts for open-source models routed through the Anthropic count_tokens endpoint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d3b7ef6 commit e0ca891

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

common/src/constants/claude-oauth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const OPENROUTER_TO_ANTHROPIC_MODEL_MAP: Record<string, string> = {
8383

8484
// Claude 4.x Opus models
8585
'anthropic/claude-opus-4.7': 'claude-opus-4-7',
86+
'anthropic/claude-opus-4.6': 'claude-opus-4-6',
8687
'anthropic/claude-opus-4.5': 'claude-opus-4-5-20251101',
8788
'anthropic/claude-opus-4.1': 'claude-opus-4-1-20250805',
8889
'anthropic/claude-opus-4': 'claude-opus-4-1-20250805',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const tokenCountRequestSchema = z.object({
3232

3333
type TokenCountRequest = z.infer<typeof tokenCountRequestSchema>
3434

35-
const DEFAULT_ANTHROPIC_MODEL = 'claude-opus-4-7'
35+
const DEFAULT_ANTHROPIC_MODEL = 'claude-opus-4-6'
3636

3737
export async function postTokenCount(params: {
3838
req: NextRequest

0 commit comments

Comments
 (0)