From 6cc75d5c24bccfea3b438130e6f0ad8a7f41ce84 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 23 Oct 2025 16:53:42 +0800 Subject: [PATCH] feat: add AnyRouter presets and update endpoints - Add AnyRouter provider presets for Claude and Codex with endpoint candidates and base_url - Simplify PackyCode endpoint candidates to primary domain + SLB for both Claude and Codex - Set default OPENAI_API_KEY to empty in Codex presets for safety (no placeholder key) - Update model placeholders to GLM-4.6 / GLM-4.5-Air in en/zh locales --- src/config/codexProviderPresets.ts | 24 ++++++++++++++++++++---- src/config/providerPresets.ts | 25 ++++++++++++++++++++----- src/i18n/locales/en.json | 4 ++-- src/i18n/locales/zh.json | 4 ++-- 4 files changed, 44 insertions(+), 13 deletions(-) diff --git a/src/config/codexProviderPresets.ts b/src/config/codexProviderPresets.ts index d93ac72..ca84a93 100644 --- a/src/config/codexProviderPresets.ts +++ b/src/config/codexProviderPresets.ts @@ -25,7 +25,7 @@ export interface CodexProviderPreset { */ export function generateThirdPartyAuth(apiKey: string): Record { return { - OPENAI_API_KEY: apiKey || "sk-your-api-key-here", + OPENAI_API_KEY: apiKey || "", }; } @@ -74,7 +74,7 @@ export const codexProviderPresets: CodexProviderPreset[] = [ name: "PackyCode", websiteUrl: "https://codex.packycode.com/", category: "third_party", - auth: generateThirdPartyAuth("sk-your-api-key-here"), + auth: generateThirdPartyAuth(""), config: generateThirdPartyConfig( "packycode", "https://codex-api.packycode.com/v1", @@ -83,8 +83,24 @@ export const codexProviderPresets: CodexProviderPreset[] = [ // Codex 请求地址候选(用于地址管理/测速) endpointCandidates: [ "https://codex-api.packycode.com/v1", - "https://codex-api-hk-cn2.packycode.com/v1", - "https://codex-api-hk-cdn.packycode.com/v1", + "https://codex-api-slb.packycode.com/v1", + ], + }, + { + name: "AnyRouter", + websiteUrl: "https://anyrouter.top", + category: "third_party", + auth: generateThirdPartyAuth(""), + config: generateThirdPartyConfig( + "anyrouter", + "https://anyrouter.top", + "gpt-5-codex", + ), + // Codex 请求地址候选(用于地址管理/测速) + endpointCandidates: [ + "https://anyrouter.top", + "https://q.quuvv.cn", + "https://pmpjfbhq.cn-nb1.rainapp.top", ], }, ]; diff --git a/src/config/providerPresets.ts b/src/config/providerPresets.ts index 537f11b..1de549f 100644 --- a/src/config/providerPresets.ts +++ b/src/config/providerPresets.ts @@ -167,7 +167,7 @@ export const providerPresets: ProviderPreset[] = [ { name: "PackyCode", websiteUrl: "https://www.packycode.com", - apiKeyUrl: "https://www.packycode.com/?aff=rlo54mgz", + apiKeyUrl: "https://www.packycode.com/", settingsConfig: { env: { ANTHROPIC_BASE_URL: "https://api.packycode.com", @@ -177,10 +177,25 @@ export const providerPresets: ProviderPreset[] = [ // 请求地址候选(用于地址管理/测速) endpointCandidates: [ "https://api.packycode.com", - "https://api-hk-cn2.packycode.com", - "https://api-hk-g.packycode.com", - "https://api-us-cn2.packycode.com", - "https://api-cf-pro.packycode.com", + "https://api-slb.packycode.com", + ], + category: "third_party", + }, + { + name: "AnyRouter", + websiteUrl: "https://anyrouter.top", + apiKeyUrl: "https://anyrouter.top/register?aff=PCel", + settingsConfig: { + env: { + ANTHROPIC_BASE_URL: "https://anyrouter.top", + ANTHROPIC_AUTH_TOKEN: "", + }, + }, + // 请求地址候选(用于地址管理/测速) + endpointCandidates: [ + "https://q.quuvv.cn", + "https://pmpjfbhq.cn-nb1.rainapp.top", + "https://anyrouter.top", ], category: "third_party", }, diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 6285c8d..a09fc50 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -239,8 +239,8 @@ "visitWebsite": "Visit {{url}}", "anthropicModel": "Main Model", "anthropicSmallFastModel": "Fast Model", - "modelPlaceholder": "claude-3-7-sonnet-20250219", - "smallModelPlaceholder": "claude-3-5-haiku-20241022", + "modelPlaceholder": "GLM-4.6", + "smallModelPlaceholder": "GLM-4.5-Air", "modelHelper": "Optional: Specify default Claude model to use, leave blank to use system default.", "categoryOfficial": "Official", "categoryCnOfficial": "Opensource Official", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index 6c9f50a..1bea334 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -239,8 +239,8 @@ "visitWebsite": "访问 {{url}}", "anthropicModel": "主模型", "anthropicSmallFastModel": "快速模型", - "modelPlaceholder": "claude-3-7-sonnet-20250219", - "smallModelPlaceholder": "claude-3-5-haiku-20241022", + "modelPlaceholder": "GLM-4.6", + "smallModelPlaceholder": "GLM-4.5-Air", "modelHelper": "可选:指定默认使用的 Claude 模型,留空则使用系统默认。", "categoryOfficial": "官方", "categoryCnOfficial": "开源官方",