From 52dc23440dca62328d5e98446f95fbf849e68969 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Tue, 30 Sep 2025 01:29:35 +0800 Subject: [PATCH] Add Claude Sonnet 4.5 model support - Register `claudeSonnet45Api` with the Anthropic API list using the `claude-sonnet-4-5-20250929` identifier. - Add OpenRouter (`anthropic/claude-sonnet-4.5`) and AIML (`anthropic/claude-sonnet-4-5`) options to keep providers in sync. - Update the default OpenRouter model to Sonnet 4.5 so new installs use the latest Claude Sonnet model. Reference: - https://www.anthropic.com/news/claude-sonnet-4-5 --- src/config/index.mjs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/config/index.mjs b/src/config/index.mjs index fb504aee..57ca6a17 100644 --- a/src/config/index.mjs +++ b/src/config/index.mjs @@ -82,6 +82,7 @@ export const claudeApiModelKeys = [ 'claudeOpus4Api', 'claudeOpus41Api', 'claudeSonnet4Api', + 'claudeSonnet45Api', ] export const chatglmApiModelKeys = ['chatglmTurbo', 'chatglm4', 'chatglmEmohaa', 'chatglmCharGLM3'] export const githubThirdPartyApiModelKeys = ['waylaidwandererApi'] @@ -110,6 +111,7 @@ export const moonshotApiModelKeys = [ export const deepSeekApiModelKeys = ['deepseek_chat', 'deepseek_reasoner'] export const openRouterApiModelKeys = [ 'openRouter_anthropic_claude_sonnet4', + 'openRouter_anthropic_claude_sonnet4_5', 'openRouter_anthropic_claude_3_7_sonnet', 'openRouter_google_gemini_2_5_pro', 'openRouter_google_gemini_2_5_flash', @@ -120,6 +122,7 @@ export const openRouterApiModelKeys = [ export const aimlApiModelKeys = [ 'aiml_anthropic_claude_opus_4', 'aiml_anthropic_claude_sonnet_4', + 'aiml_anthropic_claude_sonnet_4_5', 'aiml_anthropic_claude_opus_4_1', 'aiml_claude_3_7_sonnet_20250219', 'aiml_google_gemini_2_5_pro_preview_05_06', @@ -290,6 +293,10 @@ export const Models = { value: 'claude-sonnet-4-20250514', desc: 'Claude.ai (API, Claude Sonnet 4)', }, + claudeSonnet45Api: { + value: 'claude-sonnet-4-5-20250929', + desc: 'Claude.ai (API, Claude Sonnet 4.5)', + }, bingFree4: { value: '', desc: 'Bing (Web, GPT-4)' }, bingFreeSydney: { value: '', desc: 'Bing (Web, GPT-4, Sydney)' }, @@ -372,6 +379,10 @@ export const Models = { value: 'anthropic/claude-sonnet-4', desc: 'OpenRouter (Claude Sonnet 4)', }, + openRouter_anthropic_claude_sonnet4_5: { + value: 'anthropic/claude-sonnet-4.5', + desc: 'OpenRouter (Claude Sonnet 4.5)', + }, openRouter_anthropic_claude_3_7_sonnet: { value: 'anthropic/claude-3.7-sonnet', desc: 'OpenRouter (Claude 3.7 Sonnet)', @@ -409,6 +420,10 @@ export const Models = { value: 'anthropic/claude-sonnet-4', desc: 'AIML (Claude Sonnet 4)', }, + aiml_anthropic_claude_sonnet_4_5: { + value: 'anthropic/claude-sonnet-4-5', + desc: 'AIML (Claude Sonnet 4.5)', + }, aiml_claude_3_7_sonnet_20250219: { value: 'claude-3-7-sonnet-20250219', desc: 'AIML (Claude 3.7 Sonnet)', @@ -538,7 +553,7 @@ export const defaultConfig = { 'ollamaModel', 'customModel', 'azureOpenAi', - 'openRouter_anthropic_claude_sonnet4', + 'openRouter_anthropic_claude_sonnet4_5', 'openRouter_google_gemini_2_5_pro', 'openRouter_openai_o3', ],