Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
feat: CLI fingerprint UI toggle + fix playground i18n (#223)
diegosouzapw2d8091340f85
diff --git a/open-sse/config/cliFingerprints.ts b/open-sse/config/cliFingerprints.tsindex 3f34399ffd..61c2f73f9c 100644--- a/open-sse/config/cliFingerprints.ts+++ b/open-sse/config/cliFingerprints.ts@@ -222,16 +222,42 @@ export function applyFingerprint(};}+/**+ * Runtime cache for CLI compat providers set via Settings UI.+ * Updated by the settings API when users toggle providers.+ */+let _cliCompatProviders: Set<string> = new Set();++/**+ * Update the runtime cache of CLI-compat-enabled providers.+ * Called from the settings API when cliCompatProviders is updated.+ */+export function setCliCompatProviders(providers: string[]): void {+ _cliCompatProviders = new Set((providers || []).map((p) => p.toLowerCase()));+}++/**+ * Get the current list of CLI-compat-enabled providers.+ */+export function getCliCompatProviders(): string[] {+ return Array.from(_cliCompatProviders);+}+/*** Check if CLI compatibility mode is enabled for a provider.- * This reads from the settings database or environment variable.+ * Reads from: 1) Runtime cache (Settings UI), 2) Environment variables.*/export function isCliCompatEnabled(provider: string): boolean {- // Check environment variable first: CLI_COMPAT_<PROVIDER>=1- const envKey = `CLI_COMPAT_${provider?.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`;+ const key = provider?.toLowerCase().replace(/[^a-z0-9]/g, "_");++ // 1. Check runtime cache (set via Settings UI)+ if (_cliCompatProviders.has(provider?.toLowerCase())) return true;++ // 2. Check environment variable: CLI_COMPAT_<PROVIDER>=1+ const envKey = `CLI_COMPAT_${key?.toUpperCase()}`;if (process.env[envKey] === "1" || process.env[envKey] === "true") return true;- // Global enable: CLI_COMPAT_ALL=1+ // 3. Global enable: CLI_COMPAT_ALL=1if (process.env.CLI_COMPAT_ALL === "1" || process.env.CLI_COMPAT_ALL === "true") return true;return false;diff --git a/src/app/(dashboard)/dashboard/settings/components/SecurityTab.tsx b/src/app/(dashboard)/dashboard/settings/components/SecurityTab.tsxindex 5583361467..bd83ec2a7a 100644--- a/src/app/(dashboard)/dashboard/settings/components/SecurityTab.tsx+++ b/src/app/(dashboard)/dashboard/settings/components/SecurityTab.tsx@@ -248,6 +248,76 @@ export default function SecurityTab() {</div></Card>+ {/* CLI Fingerprint Matching */}+ <Card>+ <div className="flex items-center gap-3 mb-4">+ <div className="p-2 rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400">+ <span className="material-symbols-outlined text-[20px]" aria-hidden="true">+ fingerprint+ </span>+ </div>+ <h3 className="text-lg font-semibold">{t("cliFingerprint")}</h3>+ </div>+ <div className="flex flex-col gap-4">+ <p className="text-sm text-text-muted">{t("cliFingerprintDesc")}</p>+ <div className="flex flex-wrap gap-2">+ {(["codex", "claude", "github", "antigravity"] as const).map((providerId) => {+ const providerMeta = Object.values(AI_PROVIDERS).find(+ (p: any) => p.id === providerId+ ) as any;+ const isEnabled = (settings.cliCompatProviders || []).includes(providerId);+ const displayName = providerMeta?.name || providerId;+ const icon = providerMeta?.icon || "terminal";+ const color = providerMeta?.color || "#888";+ return (+ <button+ key={providerId}+ onClick={() => {+ const current: string[] = settings.cliCompatProviders || [];+ const updated = current.includes(providerId)+ ? current.filter((p) => p !== providerId)+ : [...current, providerId];+ updateSetting("cliCompatProviders", updated);+ }}+ disabled={loading}+ className={`inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-all border ${+ isEnabled+ ? "bg-emerald-500/10 border-emerald-500/30 text-emerald-600 dark:text-emerald-400"+ : "bg-black/[0.02] dark:bg-white/[0.02] border-transparent text-text-muted hover:bg-black/[0.05] dark:hover:bg-white/[0.05]"+ }`}+ title={+ isEnabled+ ? t("disableFingerprintTitle", { provider: displayName })+ : t("enableFingerprintTitle", { provider: displayName })+ }+ >+ <span+ className="material-symbols-outlined text-[14px]"+ style={{ color: isEnabled ? undefined : color }}+ >+ {isEnabled ? "fingerprint" : icon}+ </span>+ {displayName}+ {isEnabled && (+ <span className="material-symbols-outlined text-[12px] text-emerald-500">+ check+ </span>+ )}+ </button>+ );+ })}+ </div>+ {(settings.cliCompatProviders || []).length > 0 && (+ <p className="text-xs text-emerald-600 dark:text-emerald-400 mt-1 flex items-center gap-1">+ <span className="material-symbols-outlined text-[14px]">verified</span>+ {t("cliFingerprintEnabled", {+ count: (settings.cliCompatProviders || []).length,+ })}+ </p>+ )}+ </div>+ </Card>+<SessionInfoCard /><IPFilterSection /></div>diff --git a/src/app/api/settings/route.ts b/src/app/api/settings/route.tsindex f809bfa3ac..cb0511c6d8 100644--- a/src/app/api/settings/route.ts+++ b/src/app/api/settings/route.ts@@ -5,12 +5,18 @@ import bcrypt from "bcryptjs";import { getRuntimePorts } from "@/lib/runtime/ports";import { updateSettingsSchema } from "@/shared/validation/settingsSchemas";import { isValidationFailure, validateBody } from "@/shared/validation/helpers";+import { setCliCompatProviders } from "../../../../open-sse/config/cliFingerprints";export async function GET() {try {const settings = await getSettings();const { password, ...safeSettings } = settings;+ // Sync CLI fingerprint providers to runtime cache on load+ if (settings.cliCompatProviders) {+ setCliCompatProviders(settings.cliCompatProviders as string[]);+ }+const enableRequestLogs = process.env.ENABLE_REQUEST_LOGS === "true";const runtimePorts = getRuntimePorts();@@ -74,6 +80,11 @@ export async function PATCH(request) {clearHealthCheckLogCache();}+ // Sync CLI fingerprint providers to runtime cache+ if ("cliCompatProviders" in body) {+ setCliCompatProviders(body.cliCompatProviders || []);+ }+const { password, ...safeSettings } = settings;return NextResponse.json(safeSettings);} catch (error) {diff --git a/src/i18n/messages/ar.json b/src/i18n/messages/ar.jsonindex d9acb7141f..6747feba2f 100644--- a/src/i18n/messages/ar.json+++ b/src/i18n/messages/ar.json@@ -100,7 +100,8 @@"themeViolet": "بنفسجي ساحر","themeOrange": "أورانج (Orange)","themeCyan": "كيان",- "endpoints": "نقاط النهاية"+ "endpoints": "نقاط النهاية",+ "playground": "ملعب النماذج"},"themesPage": {"title": "المواضيع",diff --git a/src/i18n/messages/bg.json b/src/i18n/messages/bg.jsonindex 18aaeed2ce..b7044f005f 100644--- a/src/i18n/messages/bg.json+++ b/src/i18n/messages/bg.json@@ -100,7 +100,8 @@"themeViolet": "Виолетово","themeOrange": "Оранжево","themeCyan": "Циан",- "endpoints": "Крайни точки"+ "endpoints": "Крайни точки",+ "playground": "Площадка"},"themesPage": {"title": "Теми",diff --git a/src/i18n/messages/da.json b/src/i18n/messages/da.jsonindex 499a156d50..24c5da65c2 100644--- a/src/i18n/messages/da.json+++ b/src/i18n/messages/da.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Turkis",- "endpoints": "Endpoints"+ "endpoints": "Endpoints",+ "playground": "Legeplads"},"themesPage": {"title": "Temaer",diff --git a/src/i18n/messages/de.json b/src/i18n/messages/de.jsonindex b8e668010e..2c6660e4a7 100644--- a/src/i18n/messages/de.json+++ b/src/i18n/messages/de.json@@ -100,7 +100,8 @@"themeViolet": "Violett","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Endpunkte"+ "endpoints": "Endpunkte",+ "playground": "Spielwiese"},"themesPage": {"title": "Themen",diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.jsonindex 96f1637a54..28d6175c9a 100644--- a/src/i18n/messages/en.json+++ b/src/i18n/messages/en.json@@ -1493,6 +1493,11 @@"providersBlocked": "{count} provider(s) blocked from /models","blockProviderTitle": "Block {provider}","unblockProviderTitle": "Unblock {provider}",+ "cliFingerprint": "CLI Fingerprint Matching",+ "cliFingerprintDesc": "Match native CLI binary signatures when proxying requests. Reorders headers and body fields to look identical to the official CLI tools. Your proxy IP is preserved.",+ "cliFingerprintEnabled": "{count} provider(s) with CLI fingerprint active",+ "enableFingerprintTitle": "Enable fingerprint for {provider}",+ "disableFingerprintTitle": "Disable fingerprint for {provider}","routingStrategy": "Routing Strategy","fillFirst": "Fill First","fillFirstDesc": "Use accounts in priority order",diff --git a/src/i18n/messages/es.json b/src/i18n/messages/es.jsonindex b185bd229b..a3041f84fb 100644--- a/src/i18n/messages/es.json+++ b/src/i18n/messages/es.json@@ -100,7 +100,8 @@"themeViolet": "Violeta","themeOrange": "Naranja","themeCyan": "cian",- "endpoints": "Endpoints"+ "endpoints": "Endpoints",+ "playground": "Playground"},"themesPage": {"title": "Temas",diff --git a/src/i18n/messages/fi.json b/src/i18n/messages/fi.jsonindex 40f58a99d6..feff9d6f99 100644--- a/src/i18n/messages/fi.json+++ b/src/i18n/messages/fi.json@@ -100,7 +100,8 @@"themeViolet": "Violetti","themeOrange": "Oranssi","themeCyan": "Syaani",- "endpoints": "Päätepisteet"+ "endpoints": "Päätepisteet",+ "playground": "Leikkipaikka"},"themesPage": {"title": "Teemat",diff --git a/src/i18n/messages/fr.json b/src/i18n/messages/fr.jsonindex 2f60253b33..83da4be908 100644--- a/src/i18n/messages/fr.json+++ b/src/i18n/messages/fr.json@@ -100,7 +100,8 @@"themeViolet": "Violette","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Points d'accès"+ "endpoints": "Points d'accès",+ "playground": "Playground"},"themesPage": {"title": "Thèmes",diff --git a/src/i18n/messages/he.json b/src/i18n/messages/he.jsonindex e4357ee628..d034a5ca65 100644--- a/src/i18n/messages/he.json+++ b/src/i18n/messages/he.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "נקודות קצה"+ "endpoints": "נקודות קצה",+ "playground": "Playground"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/hu.json b/src/i18n/messages/hu.jsonindex 30991ddbbd..a9d628a376 100644--- a/src/i18n/messages/hu.json+++ b/src/i18n/messages/hu.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "narancssárga","themeCyan": "Cián",- "endpoints": "Végpontok"+ "endpoints": "Végpontok",+ "playground": "Játszótér"},"themesPage": {"title": "Témák",diff --git a/src/i18n/messages/id.json b/src/i18n/messages/id.jsonindex 130b3c1cc5..72ed9769d9 100644--- a/src/i18n/messages/id.json+++ b/src/i18n/messages/id.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Endpoint"+ "endpoints": "Endpoint",+ "playground": "Playground"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/in.json b/src/i18n/messages/in.jsonindex 8c23d099ba..610d5d2b42 100644--- a/src/i18n/messages/in.json+++ b/src/i18n/messages/in.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Endpoint"+ "endpoints": "Endpoint",+ "playground": "Playground"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/it.json b/src/i18n/messages/it.jsonindex d039393801..e192813955 100644--- a/src/i18n/messages/it.json+++ b/src/i18n/messages/it.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Endpoint"+ "endpoints": "Endpoint",+ "playground": "Playground"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/ja.json b/src/i18n/messages/ja.jsonindex 97596cbc7d..542bb0c2ec 100644--- a/src/i18n/messages/ja.json+++ b/src/i18n/messages/ja.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "エンドポイント"+ "endpoints": "エンドポイント",+ "playground": "プレイグラウンド"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/ko.json b/src/i18n/messages/ko.jsonindex 35f93be6e4..686f6c539e 100644--- a/src/i18n/messages/ko.json+++ b/src/i18n/messages/ko.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "엔드포인트"+ "endpoints": "엔드포인트",+ "playground": "플레이그라운드"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/ms.json b/src/i18n/messages/ms.jsonindex 6dc6693d28..2c8a68ceb7 100644--- a/src/i18n/messages/ms.json+++ b/src/i18n/messages/ms.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Titik Akhir"+ "endpoints": "Titik Akhir",+ "playground": "Playground"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/nl.json b/src/i18n/messages/nl.jsonindex 0024b923f5..82ec8f5601 100644--- a/src/i18n/messages/nl.json+++ b/src/i18n/messages/nl.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Eindpunten"+ "endpoints": "Eindpunten",+ "playground": "Speeltuin"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/no.json b/src/i18n/messages/no.jsonindex 9b0cdd8c65..5187598f0e 100644--- a/src/i18n/messages/no.json+++ b/src/i18n/messages/no.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Endepunkter"+ "endpoints": "Endepunkter",+ "playground": "Lekeplass"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/phi.json b/src/i18n/messages/phi.jsonindex 9e364d07ac..b48a8ea2d8 100644--- a/src/i18n/messages/phi.json+++ b/src/i18n/messages/phi.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Mga Endpoint"+ "endpoints": "Mga Endpoint",+ "playground": "Playground"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/pl.json b/src/i18n/messages/pl.jsonindex 5d5d3ecd66..c43b8c0b47 100644--- a/src/i18n/messages/pl.json+++ b/src/i18n/messages/pl.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Punkty końcowe"+ "endpoints": "Punkty końcowe",+ "playground": "Plac zabaw"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/pt-BR.json b/src/i18n/messages/pt-BR.jsonindex 7d2de3f14e..efcffca6e0 100644--- a/src/i18n/messages/pt-BR.json+++ b/src/i18n/messages/pt-BR.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Endpoints"+ "endpoints": "Endpoints",+ "playground": "Playground"},"themesPage": {"title": "Themes",@@ -1480,6 +1481,11 @@"providersBlocked": "{count} provedor(es) bloqueado(s) do /models","blockProviderTitle": "Bloquear {provider}","unblockProviderTitle": "Desbloquear {provider}",+ "cliFingerprint": "Assinatura Digital CLI",+ "cliFingerprintDesc": "Reproduz a assinatura digital dos CLIs nativos ao fazer proxy. Reorganiza headers e campos do body para parecer idêntico às ferramentas CLI oficiais. O IP do proxy é preservado.",+ "cliFingerprintEnabled": "{count} provider(s) com fingerprint CLI ativo",+ "enableFingerprintTitle": "Ativar fingerprint para {provider}",+ "disableFingerprintTitle": "Desativar fingerprint para {provider}","routingStrategy": "Estratégia de Roteamento","fillFirst": "Preencher Primeiro","fillFirstDesc": "Usar contas em ordem de prioridade",diff --git a/src/i18n/messages/pt.json b/src/i18n/messages/pt.jsonindex e111ffe8df..cb5045fc5b 100644--- a/src/i18n/messages/pt.json+++ b/src/i18n/messages/pt.json@@ -100,7 +100,8 @@"themeGreen": "Verde","themeViolet": "Violeta","themeOrange": "Laranja",- "themeCyan": "Ciano"+ "themeCyan": "Ciano",+ "playground": "Playground"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/ro.json b/src/i18n/messages/ro.jsonindex 438698ce04..1469badfe3 100644--- a/src/i18n/messages/ro.json+++ b/src/i18n/messages/ro.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Puncte finale"+ "endpoints": "Puncte finale",+ "playground": "Playground"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.jsonindex 5e289943e5..a6fcd987c4 100644--- a/src/i18n/messages/ru.json+++ b/src/i18n/messages/ru.json@@ -100,7 +100,8 @@"themeViolet": "Фиолетовый","themeOrange": "Оранжевый","themeCyan": "Голубой",- "endpoints": "Конечные точки"+ "endpoints": "Конечные точки",+ "playground": "Площадка"},"themesPage": {"title": "Темы",diff --git a/src/i18n/messages/sk.json b/src/i18n/messages/sk.jsonindex a8fc2dfc23..b2a8376d60 100644--- a/src/i18n/messages/sk.json+++ b/src/i18n/messages/sk.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Koncové body"+ "endpoints": "Koncové body",+ "playground": "Ihrisko"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/sv.json b/src/i18n/messages/sv.jsonindex bc972792de..92d9ec33ff 100644--- a/src/i18n/messages/sv.json+++ b/src/i18n/messages/sv.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Ändpunkter"+ "endpoints": "Ändpunkter",+ "playground": "Lekplats"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/th.json b/src/i18n/messages/th.jsonindex fab5d33c14..82e42cc5b6 100644--- a/src/i18n/messages/th.json+++ b/src/i18n/messages/th.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "จุดปลายทาง"+ "endpoints": "จุดปลายทาง",+ "playground": "Playground"},"themesPage": {"title": "ธีมส์",diff --git a/src/i18n/messages/uk-UA.json b/src/i18n/messages/uk-UA.jsonindex 44498bc9d6..301fa18ae2 100644--- a/src/i18n/messages/uk-UA.json+++ b/src/i18n/messages/uk-UA.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Кінцеві точки"+ "endpoints": "Кінцеві точки",+ "playground": "Playground"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/vi.json b/src/i18n/messages/vi.jsonindex e92404ecbc..7b17169ec9 100644--- a/src/i18n/messages/vi.json+++ b/src/i18n/messages/vi.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "Điểm cuối"+ "endpoints": "Điểm cuối",+ "playground": "Playground"},"themesPage": {"title": "Themes",diff --git a/src/i18n/messages/zh-CN.json b/src/i18n/messages/zh-CN.jsonindex 3de1c53cc9..7e5c3a29de 100644--- a/src/i18n/messages/zh-CN.json+++ b/src/i18n/messages/zh-CN.json@@ -100,7 +100,8 @@"themeViolet": "Violet","themeOrange": "Orange","themeCyan": "Cyan",- "endpoints": "端点"+ "endpoints": "端点",+ "playground": "模型试验场"},"themesPage": {"title": "Themes",diff --git a/src/shared/validation/settingsSchemas.ts b/src/shared/validation/settingsSchemas.tsindex 6c6cc78e4a..db22d1bdde 100644--- a/src/shared/validation/settingsSchemas.ts+++ b/src/shared/validation/settingsSchemas.ts@@ -34,4 +34,6 @@ export const updateSettingsSchema = z.object({mcpEnabled: z.boolean().optional(),mcpTransport: z.enum(["stdio", "sse", "streamable-http"]).optional(),a2aEnabled: z.boolean().optional(),+ // CLI Fingerprint compatibility (per-provider)+ cliCompatProviders: z.array(z.string().max(100)).optional(),});