Skip to content

7.4 billion tokens per month. 34 free LLM providers. 635 free model endpoints. All behind one /v1 endpoint, plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.

TypeScript

feat: per-client API keys with server-enforced system prompts (#411) (#758)

Tashfeenfedfdb8bd9e1
diff --git a/client/src/components/keys/client-profiles-section.tsx b/client/src/components/keys/client-profiles-section.tsx
new file mode 100644
index 00000000..15e42dc7
--- /dev/null
+++ b/client/src/components/keys/client-profiles-section.tsx
@@ -0,0 +1,194 @@
+import { useState } from 'react'
+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
+import { apiFetch } from '@/lib/api'
+import { copyText } from '@/lib/clipboard'
+import { toast } from '@/lib/toast'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Textarea } from '@/components/ui/textarea'
+import { Switch } from '@/components/ui/switch'
+import { ConfirmButton } from '@/components/confirm-button'
+import { ChevronRight, RotateCw, Trash2 } from 'lucide-react'
+import { useI18n } from '@/i18n'
+
+interface ClientProfile {
+ id: number
+ name: string
+ maskedKey: string
+ systemPrompt: string | null
+ enabled: boolean
+}
+
+type ProfileWithKey = ClientProfile & { key: string }
+
+// Per-client API keys with a server-enforced system prompt (#411). Deliberately
+// a collapsed accordion under the unified-key card — the unified key stays the
+// first-class flow; this is the power-user add-on.
+export function ClientProfilesSection() {
+ const { t } = useI18n()
+ const queryClient = useQueryClient()
+ const [open, setOpen] = useState(false)
+ const [name, setName] = useState('')
+ const [prompt, setPrompt] = useState('')
+ // The freshly minted key (create/rotate) — shown once, never fetchable again.
+ const [newKey, setNewKey] = useState<{ id: number; key: string } | null>(null)
+ const [copied, setCopied] = useState(false)
+
+ const { data: profiles = [] } = useQuery<ClientProfile[]>({
+ queryKey: ['client-profiles'],
+ queryFn: () => apiFetch('/api/client-profiles'),
+ enabled: open,
+ })
+
+ const invalidate = () => queryClient.invalidateQueries({ queryKey: ['client-profiles'] })
+
+ const create = useMutation({
+ mutationFn: () => apiFetch<ProfileWithKey>('/api/client-profiles', {
+ method: 'POST',
+ body: JSON.stringify({ name: name.trim(), systemPrompt: prompt.trim() || null }),
+ }),
+ onSuccess: (created) => {
+ setName('')
+ setPrompt('')
+ setNewKey({ id: created.id, key: created.key })
+ invalidate()
+ },
+ })
+
+ const update = useMutation({
+ mutationFn: ({ id, ...body }: { id: number; enabled?: boolean }) =>
+ apiFetch(`/api/client-profiles/${id}`, { method: 'PATCH', body: JSON.stringify(body) }),
+ onSuccess: invalidate,
+ })
+
+ const rotate = useMutation({
+ mutationFn: (id: number) =>
+ apiFetch<ProfileWithKey>(`/api/client-profiles/${id}/rotate`, { method: 'POST' }),
+ onSuccess: (rotated) => {
+ setNewKey({ id: rotated.id, key: rotated.key })
+ invalidate()
+ },
+ })
+
+ const remove = useMutation({
+ mutationFn: (id: number) => apiFetch(`/api/client-profiles/${id}`, { method: 'DELETE' }),
+ onSuccess: (_data, id) => {
+ setNewKey(current => (current?.id === id ? null : current))
+ invalidate()
+ },
+ })
+
+ async function copyNewKey() {
+ if (!newKey || !await copyText(newKey.key)) {
+ toast.error(t('common.copyFailed'))
+ return
+ }
+ setCopied(true)
+ setTimeout(() => setCopied(false), 1500)
+ }
+
+ return (
+ <section className="rounded-3xl border bg-card">
+ <button
+ type="button"
+ className="flex w-full items-center gap-2 p-5 text-start"
+ aria-expanded={open}
+ onClick={() => setOpen(!open)}
+ >
+ <ChevronRight className={`size-4 shrink-0 text-muted-foreground transition-transform ${open ? 'rotate-90' : ''}`} />
+ <div>
+ <h2 className="text-sm font-medium">{t('keys.cpTitle')}</h2>
+ <p className="text-xs text-muted-foreground mt-0.5">{t('keys.cpDesc')}</p>
+ </div>
+ </button>
+
+ {open && (
+ <div className="px-5 pb-5 space-y-4">
+ {newKey && (
+ <div className="rounded-lg border border-primary/40 bg-primary/5 px-3 py-2.5 space-y-1.5">
+ <p className="text-xs text-muted-foreground">{t('keys.cpKeyOnce')}</p>
+ <div className="flex items-center gap-2">
+ <code className="flex-1 font-mono text-xs bg-muted px-3 py-2 rounded-lg select-all truncate">{newKey.key}</code>
+ <Button variant="outline" size="sm" onClick={() => void copyNewKey()}>
+ {copied ? t('common.copied') : t('common.copy')}
+ </Button>
+ <Button variant="ghost" size="sm" onClick={() => setNewKey(null)}>
+ {t('common.dismiss')}
+ </Button>
+ </div>
+ </div>
+ )}
+
+ {profiles.length === 0 ? (
+ <p className="text-xs text-muted-foreground">{t('keys.cpEmpty')}</p>
+ ) : (
+ <ul className="divide-y">
+ {profiles.map(p => (
+ <li key={p.id} className="flex items-center gap-3 py-2">
+ <div className="min-w-0 flex-1">
+ <div className="flex items-center gap-2">
+ <span className="text-xs font-medium truncate">{p.name}</span>
+ <code className="font-mono text-[11px] text-muted-foreground">{p.maskedKey}</code>
+ </div>
+ {p.systemPrompt && (
+ <p className="text-[11px] text-muted-foreground truncate mt-0.5">{p.systemPrompt}</p>
+ )}
+ </div>
+ <Switch
+ size="sm"
+ checked={p.enabled}
+ onCheckedChange={(enabled) => update.mutate({ id: p.id, enabled })}
+ aria-label={t('keys.cpEnabledAria')}
+ />
+ <ConfirmButton
+ onConfirm={() => rotate.mutate(p.id)}
+ size="icon-xs"
+ armedSize="xs"
+ confirmLabel={t('keys.cpRotate')}
+ title={t('keys.cpRotate')}
+ aria-label={t('keys.cpRotate')}
+ >
+ <RotateCw className="size-3.5" />
+ </ConfirmButton>
+ <ConfirmButton
+ onConfirm={() => remove.mutate(p.id)}
+ size="icon-xs"
+ armedSize="xs"
+ armedClassName="text-destructive"
+ title={t('common.delete')}
+ aria-label={t('common.delete')}
+ >
+ <Trash2 className="size-3.5" />
+ </ConfirmButton>
+ </li>
+ ))}
+ </ul>
+ )}
+
+ <form
+ className="space-y-2 border-t pt-4"
+ onSubmit={(e) => { e.preventDefault(); if (name.trim()) create.mutate() }}
+ >
+ <Input
+ value={name}
+ onChange={(e) => setName(e.target.value)}
+ placeholder={t('keys.cpNamePlaceholder')}
+ aria-label={t('keys.cpNameLabel')}
+ maxLength={100}
+ />
+ <Textarea
+ value={prompt}
+ onChange={(e) => setPrompt(e.target.value)}
+ placeholder={t('keys.cpPromptPlaceholder')}
+ aria-label={t('keys.cpPromptLabel')}
+ rows={3}
+ />
+ <Button type="submit" size="sm" disabled={!name.trim() || create.isPending}>
+ {t('keys.cpCreate')}
+ </Button>
+ </form>
+ </div>
+ )}
+ </section>
+ )
+}
diff --git a/client/src/i18n/locales/am.json b/client/src/i18n/locales/am.json
index e58e372e..5074f18d 100644
--- a/client/src/i18n/locales/am.json
+++ b/client/src/i18n/locales/am.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "ወሰን አልተቀመጠም — ይህ ቁልፍ የአቅራቢውን ሞዴሎች ሁሉ ያገለግላል።",
"modelScopeClear": "ወሰን አጥፋ",
"modelScopeBadgeOne": "የተገደበ · 1 ሞዴል",
- "modelScopeBadgeOther": "የተገደበ · {count} ሞዴሎች"
+ "modelScopeBadgeOther": "የተገደበ · {count} ሞዴሎች",
+ "cpTitle": "የደንበኛ መገለጫዎች",
+ "cpDesc": "ለእያንዳንዱ ደንበኛ የተለየ የ API ቁልፍ፣ እያንዳንዱም አገልጋዩ ሁልጊዜ የሚተገብረው የስርዓት መመሪያ አለው።",
+ "cpEmpty": "እስካሁን የደንበኛ መገለጫ የለም።",
+ "cpNameLabel": "ስም",
+ "cpNamePlaceholder": "ለምሳሌ፦ የድጋፍ ቦት",
+ "cpPromptLabel": "የስርዓት መመሪያ (አማራጭ)",
+ "cpPromptPlaceholder": "አገልጋዩ በዚህ ቁልፍ ለሚደረግ እያንዳንዱ ጥያቄ ፊት የሚያክላቸው መመሪያዎች።",
+ "cpCreate": "መገለጫ ፍጠር",
+ "cpRotate": "ቁልፍ ቀይር",
+ "cpKeyOnce": "ይህን ቁልፍ አሁን ቅዱ — ዳግም አይታይም።",
+ "cpEnabledAria": "መገለጫ ነቅቷል"
},
"status": {
"healthy": "ጤናማ",
diff --git a/client/src/i18n/locales/ar.json b/client/src/i18n/locales/ar.json
index a9c658e6..2462f7f2 100644
--- a/client/src/i18n/locales/ar.json
+++ b/client/src/i18n/locales/ar.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "لا يوجد نطاق محدد — يخدم هذا المفتاح جميع نماذج مزوّده.",
"modelScopeClear": "مسح النطاق",
"modelScopeBadgeOne": "مقيّد · نموذج واحد",
- "modelScopeBadgeOther": "مقيّد · {count} نماذج"
+ "modelScopeBadgeOther": "مقيّد · {count} نماذج",
+ "cpTitle": "ملفات تعريف العملاء",
+ "cpDesc": "مفاتيح API لكل عميل، لكل منها موجّه نظام يطبّقه الخادم دائمًا.",
+ "cpEmpty": "لا توجد ملفات تعريف عملاء بعد.",
+ "cpNameLabel": "الاسم",
+ "cpNamePlaceholder": "مثال: روبوت الدعم",
+ "cpPromptLabel": "موجّه النظام (اختياري)",
+ "cpPromptPlaceholder": "تعليمات يضيفها الخادم قبل كل طلب يُجرى بهذا المفتاح.",
+ "cpCreate": "إنشاء ملف تعريف",
+ "cpRotate": "تدوير المفتاح",
+ "cpKeyOnce": "انسخ هذا المفتاح الآن — لن يظهر مرة أخرى.",
+ "cpEnabledAria": "الملف مفعّل"
},
"status": {
"healthy": "صحي",
diff --git a/client/src/i18n/locales/az.json b/client/src/i18n/locales/az.json
index b6157515..fc01c737 100644
--- a/client/src/i18n/locales/az.json
+++ b/client/src/i18n/locales/az.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Əhatə təyin edilməyib — bu açar provayderinin bütün modellərinə xidmət edir.",
"modelScopeClear": "Əhatəni təmizlə",
"modelScopeBadgeOne": "məhdud · 1 model",
- "modelScopeBadgeOther": "məhdud · {count} model"
+ "modelScopeBadgeOther": "məhdud · {count} model",
+ "cpTitle": "Müştəri profilləri",
+ "cpDesc": "Hər müştəri üçün ayrıca API açarı; onun sistem promptunu server həmişə tətbiq edir.",
+ "cpEmpty": "Hələ müştəri profili yoxdur.",
+ "cpNameLabel": "Ad",
+ "cpNamePlaceholder": "məs. Dəstək botu",
+ "cpPromptLabel": "Sistem promptu (istəyə bağlı)",
+ "cpPromptPlaceholder": "Bu açarla edilən hər sorğunun əvvəlinə serverin əlavə etdiyi təlimatlar.",
+ "cpCreate": "Profil yarat",
+ "cpRotate": "Açarı dəyiş",
+ "cpKeyOnce": "Bu açarı indi kopyalayın — bir daha göstərilməyəcək.",
+ "cpEnabledAria": "Profil aktivdir"
},
"status": {
"healthy": "sağlam",
diff --git a/client/src/i18n/locales/bg.json b/client/src/i18n/locales/bg.json
index e891d95c..beb677f0 100644
--- a/client/src/i18n/locales/bg.json
+++ b/client/src/i18n/locales/bg.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Няма зададен обхват — този ключ обслужва всички модели на доставчика си.",
"modelScopeClear": "Изчисти обхвата",
"modelScopeBadgeOne": "ограничен · 1 модел",
- "modelScopeBadgeOther": "ограничен · {count} модела"
+ "modelScopeBadgeOther": "ограничен · {count} модела",
+ "cpTitle": "Клиентски профили",
+ "cpDesc": "Отделни API ключове за всеки клиент, всеки със системен промпт, който сървърът винаги прилага.",
+ "cpEmpty": "Все още няма клиентски профили.",
+ "cpNameLabel": "Име",
+ "cpNamePlaceholder": "напр. Бот за поддръжка",
+ "cpPromptLabel": "Системен промпт (по избор)",
+ "cpPromptPlaceholder": "Инструкции, които сървърът добавя преди всяка заявка с този ключ.",
+ "cpCreate": "Създай профил",
+ "cpRotate": "Смени ключа",
+ "cpKeyOnce": "Копирайте този ключ сега — няма да бъде показан отново.",
+ "cpEnabledAria": "Профилът е активиран"
},
"status": {
"healthy": "здравословно",
diff --git a/client/src/i18n/locales/bn.json b/client/src/i18n/locales/bn.json
index db78b988..f398536c 100644
--- a/client/src/i18n/locales/bn.json
+++ b/client/src/i18n/locales/bn.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "কোনো পরিধি সেট নেই — এই কী তার প্রোভাইডারের সব মডেলের জন্য কাজ করে।",
"modelScopeClear": "পরিধি মুছুন",
"modelScopeBadgeOne": "সীমিত · 1টি মডেল",
- "modelScopeBadgeOther": "সীমিত · {count}টি মডেল"
+ "modelScopeBadgeOther": "সীমিত · {count}টি মডেল",
+ "cpTitle": "ক্লায়েন্ট প্রোফাইল",
+ "cpDesc": "প্রতিটি ক্লায়েন্টের জন্য আলাদা API কী, যার সিস্টেম প্রম্পট সার্ভার সবসময় প্রয়োগ করে।",
+ "cpEmpty": "এখনও কোনো ক্লায়েন্ট প্রোফাইল নেই।",
+ "cpNameLabel": "নাম",
+ "cpNamePlaceholder": "যেমন: সাপোর্ট বট",
+ "cpPromptLabel": "সিস্টেম প্রম্পট (ঐচ্ছিক)",
+ "cpPromptPlaceholder": "এই কী দিয়ে করা প্রতিটি অনুরোধের আগে সার্ভার এই নির্দেশাবলি যুক্ত করে।",
+ "cpCreate": "প্রোফাইল তৈরি করুন",
+ "cpRotate": "কী পরিবর্তন করুন",
+ "cpKeyOnce": "এই কী এখনই কপি করুন — এটি আর দেখানো হবে না।",
+ "cpEnabledAria": "প্রোফাইল সক্রিয়"
},
"status": {
"healthy": "সুস্থ",
diff --git a/client/src/i18n/locales/cs.json b/client/src/i18n/locales/cs.json
index 4af9faff..d834a87b 100644
--- a/client/src/i18n/locales/cs.json
+++ b/client/src/i18n/locales/cs.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Rozsah není nastaven — tento klíč obsluhuje všechny modely svého poskytovatele.",
"modelScopeClear": "Vymazat rozsah",
"modelScopeBadgeOne": "omezený · 1 model",
- "modelScopeBadgeOther": "omezený · {count} modelů"
+ "modelScopeBadgeOther": "omezený · {count} modelů",
+ "cpTitle": "Profily klientů",
+ "cpDesc": "Samostatné API klíče pro každého klienta, každý se systémovým promptem, který server vždy použije.",
+ "cpEmpty": "Zatím žádné profily klientů.",
+ "cpNameLabel": "Název",
+ "cpNamePlaceholder": "např. Bot podpory",
+ "cpPromptLabel": "Systémový prompt (volitelné)",
+ "cpPromptPlaceholder": "Pokyny, které server přidá před každý požadavek provedený tímto klíčem.",
+ "cpCreate": "Vytvořit profil",
+ "cpRotate": "Obměnit klíč",
+ "cpKeyOnce": "Zkopírujte tento klíč hned — už se znovu nezobrazí.",
+ "cpEnabledAria": "Profil povolen"
},
"status": {
"healthy": "zdravé",
diff --git a/client/src/i18n/locales/da.json b/client/src/i18n/locales/da.json
index 81021aca..f477ec38 100644
--- a/client/src/i18n/locales/da.json
+++ b/client/src/i18n/locales/da.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Intet omfang angivet — nøglen betjener alle modeller hos sin udbyder.",
"modelScopeClear": "Ryd omfang",
"modelScopeBadgeOne": "begrænset · 1 model",
- "modelScopeBadgeOther": "begrænset · {count} modeller"
+ "modelScopeBadgeOther": "begrænset · {count} modeller",
+ "cpTitle": "Klientprofiler",
+ "cpDesc": "API-nøgler pr. klient, hver med en systemprompt som serveren altid anvender.",
+ "cpEmpty": "Ingen klientprofiler endnu.",
+ "cpNameLabel": "Navn",
+ "cpNamePlaceholder": "f.eks. Supportbot",
+ "cpPromptLabel": "Systemprompt (valgfri)",
+ "cpPromptPlaceholder": "Instruktioner som serveren indsætter før hver forespørgsel med denne nøgle.",
+ "cpCreate": "Opret profil",
+ "cpRotate": "Rotér nøgle",
+ "cpKeyOnce": "Kopiér denne nøgle nu — den vises ikke igen.",
+ "cpEnabledAria": "Profil aktiveret"
},
"status": {
"healthy": "sundt",
diff --git a/client/src/i18n/locales/de.json b/client/src/i18n/locales/de.json
index 29fe90e9..a792681b 100644
--- a/client/src/i18n/locales/de.json
+++ b/client/src/i18n/locales/de.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Kein Bereich gesetzt — dieser Schlüssel bedient alle Modelle seines Anbieters.",
"modelScopeClear": "Bereich löschen",
"modelScopeBadgeOne": "begrenzt · 1 Modell",
- "modelScopeBadgeOther": "begrenzt · {count} Modelle"
+ "modelScopeBadgeOther": "begrenzt · {count} Modelle",
+ "cpTitle": "Client-Profile",
+ "cpDesc": "API-Schlüssel pro Client, jeweils mit einem System-Prompt, den der Server immer anwendet.",
+ "cpEmpty": "Noch keine Client-Profile.",
+ "cpNameLabel": "Name",
+ "cpNamePlaceholder": "z. B. Support-Bot",
+ "cpPromptLabel": "System-Prompt (optional)",
+ "cpPromptPlaceholder": "Anweisungen, die der Server jeder Anfrage mit diesem Schlüssel voranstellt.",
+ "cpCreate": "Profil erstellen",
+ "cpRotate": "Schlüssel rotieren",
+ "cpKeyOnce": "Kopiere diesen Schlüssel jetzt — er wird nicht erneut angezeigt.",
+ "cpEnabledAria": "Profil aktiviert"
},
"status": {
"healthy": "gesund",
diff --git a/client/src/i18n/locales/el.json b/client/src/i18n/locales/el.json
index e4b3881e..e313ca1f 100644
--- a/client/src/i18n/locales/el.json
+++ b/client/src/i18n/locales/el.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Δεν έχει οριστεί εύρος — αυτό το κλειδί εξυπηρετεί όλα τα μοντέλα του παρόχου του.",
"modelScopeClear": "Καθαρισμός εύρους",
"modelScopeBadgeOne": "περιορισμένο · 1 μοντέλο",
- "modelScopeBadgeOther": "περιορισμένο · {count} μοντέλα"
+ "modelScopeBadgeOther": "περιορισμένο · {count} μοντέλα",
+ "cpTitle": "Προφίλ πελατών",
+ "cpDesc": "Κλειδιά API ανά πελάτη, καθένα με ένα system prompt που ο διακομιστής εφαρμόζει πάντα.",
+ "cpEmpty": "Δεν υπάρχουν ακόμη προφίλ πελατών.",
+ "cpNameLabel": "Όνομα",
+ "cpNamePlaceholder": "π.χ. Bot υποστήριξης",
+ "cpPromptLabel": "System prompt (προαιρετικό)",
+ "cpPromptPlaceholder": "Οδηγίες που ο διακομιστής προσθέτει πριν από κάθε αίτημα με αυτό το κλειδί.",
+ "cpCreate": "Δημιουργία προφίλ",
+ "cpRotate": "Εναλλαγή κλειδιού",
+ "cpKeyOnce": "Αντιγράψτε αυτό το κλειδί τώρα — δεν θα εμφανιστεί ξανά.",
+ "cpEnabledAria": "Προφίλ ενεργό"
},
"status": {
"healthy": "υγιής",
diff --git a/client/src/i18n/locales/en.json b/client/src/i18n/locales/en.json
index c84ea5c3..80ee5d04 100644
--- a/client/src/i18n/locales/en.json
+++ b/client/src/i18n/locales/en.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "No scope set — this key serves every model of its provider.",
"modelScopeClear": "Clear scope",
"modelScopeBadgeOne": "scoped · 1 model",
- "modelScopeBadgeOther": "scoped · {count} models"
+ "modelScopeBadgeOther": "scoped · {count} models",
+ "cpTitle": "Client profiles",
+ "cpDesc": "Per-client API keys, each with a system prompt the server always applies.",
+ "cpEmpty": "No client profiles yet.",
+ "cpNameLabel": "Name",
+ "cpNamePlaceholder": "e.g. Support bot",
+ "cpPromptLabel": "System prompt (optional)",
+ "cpPromptPlaceholder": "Instructions the server prepends to every request made with this key.",
+ "cpCreate": "Create profile",
+ "cpRotate": "Rotate key",
+ "cpKeyOnce": "Copy this key now — it won't be shown again.",
+ "cpEnabledAria": "Profile enabled"
},
"status": {
"healthy": "healthy",
diff --git a/client/src/i18n/locales/es.json b/client/src/i18n/locales/es.json
index ac78beb6..164ac810 100644
--- a/client/src/i18n/locales/es.json
+++ b/client/src/i18n/locales/es.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Sin alcance definido: esta clave sirve todos los modelos de su proveedor.",
"modelScopeClear": "Borrar alcance",
"modelScopeBadgeOne": "limitada · 1 modelo",
- "modelScopeBadgeOther": "limitada · {count} modelos"
+ "modelScopeBadgeOther": "limitada · {count} modelos",
+ "cpTitle": "Perfiles de cliente",
+ "cpDesc": "Claves API por cliente, cada una con un prompt de sistema que el servidor aplica siempre.",
+ "cpEmpty": "Aún no hay perfiles de cliente.",
+ "cpNameLabel": "Nombre",
+ "cpNamePlaceholder": "p. ej., Bot de soporte",
+ "cpPromptLabel": "Prompt de sistema (opcional)",
+ "cpPromptPlaceholder": "Instrucciones que el servidor antepone a cada solicitud hecha con esta clave.",
+ "cpCreate": "Crear perfil",
+ "cpRotate": "Rotar clave",
+ "cpKeyOnce": "Copia esta clave ahora: no se volverá a mostrar.",
+ "cpEnabledAria": "Perfil habilitado"
},
"status": {
"healthy": "correcto",
diff --git a/client/src/i18n/locales/fa.json b/client/src/i18n/locales/fa.json
index ca648d6e..3d404f3e 100644
--- a/client/src/i18n/locales/fa.json
+++ b/client/src/i18n/locales/fa.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "محدوده‌ای تنظیم نشده — این کلید به همه مدل‌های ارائه‌دهنده‌اش خدمت می‌دهد.",
"modelScopeClear": "پاک کردن محدوده",
"modelScopeBadgeOne": "محدود · 1 مدل",
- "modelScopeBadgeOther": "محدود · {count} مدل"
+ "modelScopeBadgeOther": "محدود · {count} مدل",
+ "cpTitle": "پروفایل‌های کلاینت",
+ "cpDesc": "کلیدهای API جداگانه برای هر کلاینت، هرکدام با یک پرامپت سیستمی که سرور همیشه اعمال می‌کند.",
+ "cpEmpty": "هنوز پروفایل کلاینتی وجود ندارد.",
+ "cpNameLabel": "نام",
+ "cpNamePlaceholder": "مثلاً بات پشتیبانی",
+ "cpPromptLabel": "پرامپت سیستمی (اختیاری)",
+ "cpPromptPlaceholder": "دستورالعمل‌هایی که سرور پیش از هر درخواستِ انجام‌شده با این کلید اضافه می‌کند.",
+ "cpCreate": "ایجاد پروفایل",
+ "cpRotate": "چرخش کلید",
+ "cpKeyOnce": "همین حالا این کلید را کپی کنید — دیگر نمایش داده نخواهد شد.",
+ "cpEnabledAria": "پروفایل فعال"
},
"status": {
"healthy": "سالم",
diff --git a/client/src/i18n/locales/fi.json b/client/src/i18n/locales/fi.json
index b7f19012..954ac575 100644
--- a/client/src/i18n/locales/fi.json
+++ b/client/src/i18n/locales/fi.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Rajausta ei ole asetettu — avain palvelee kaikkia tarjoajansa malleja.",
"modelScopeClear": "Tyhjennä rajaus",
"modelScopeBadgeOne": "rajattu · 1 malli",
- "modelScopeBadgeOther": "rajattu · {count} mallia"
+ "modelScopeBadgeOther": "rajattu · {count} mallia",
+ "cpTitle": "Asiakasprofiilit",
+ "cpDesc": "API-avaimet asiakaskohtaisesti, kullakin järjestelmäkehote, jonka palvelin lisää aina.",
+ "cpEmpty": "Ei vielä asiakasprofiileja.",
+ "cpNameLabel": "Nimi",
+ "cpNamePlaceholder": "esim. Tukibotti",
+ "cpPromptLabel": "Järjestelmäkehote (valinnainen)",
+ "cpPromptPlaceholder": "Ohjeet, jotka palvelin lisää jokaisen tällä avaimella tehdyn pyynnön alkuun.",
+ "cpCreate": "Luo profiili",
+ "cpRotate": "Vaihda avain",
+ "cpKeyOnce": "Kopioi tämä avain nyt — sitä ei näytetä uudelleen.",
+ "cpEnabledAria": "Profiili käytössä"
},
"status": {
"healthy": "terve",
diff --git a/client/src/i18n/locales/fr.json b/client/src/i18n/locales/fr.json
index 91725d53..b18ef48e 100644
--- a/client/src/i18n/locales/fr.json
+++ b/client/src/i18n/locales/fr.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Aucune portée définie — cette clé sert tous les modèles de son fournisseur.",
"modelScopeClear": "Effacer la portée",
"modelScopeBadgeOne": "limitée · 1 modèle",
- "modelScopeBadgeOther": "limitée · {count} modèles"
+ "modelScopeBadgeOther": "limitée · {count} modèles",
+ "cpTitle": "Profils client",
+ "cpDesc": "Des clés API par client, chacune avec un prompt système que le serveur applique toujours.",
+ "cpEmpty": "Aucun profil client pour le moment.",
+ "cpNameLabel": "Nom",
+ "cpNamePlaceholder": "p. ex. Bot de support",
+ "cpPromptLabel": "Prompt système (facultatif)",
+ "cpPromptPlaceholder": "Instructions que le serveur ajoute en tête de chaque requête effectuée avec cette clé.",
+ "cpCreate": "Créer le profil",
+ "cpRotate": "Renouveler la clé",
+ "cpKeyOnce": "Copiez cette clé maintenant — elle ne sera plus affichée.",
+ "cpEnabledAria": "Profil activé"
},
"status": {
"healthy": "sain",
diff --git a/client/src/i18n/locales/gu.json b/client/src/i18n/locales/gu.json
index 23c54356..c8759521 100644
--- a/client/src/i18n/locales/gu.json
+++ b/client/src/i18n/locales/gu.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "કોઈ વ્યાપ સેટ નથી — આ કી તેના પ્રદાતાના બધા મૉડલ માટે કામ કરે છે.",
"modelScopeClear": "વ્યાપ દૂર કરો",
"modelScopeBadgeOne": "મર્યાદિત · 1 મૉડલ",
- "modelScopeBadgeOther": "મર્યાદિત · {count} મૉડલ"
+ "modelScopeBadgeOther": "મર્યાદિત · {count} મૉડલ",
+ "cpTitle": "ક્લાયન્ટ પ્રોફાઇલ",
+ "cpDesc": "દરેક ક્લાયન્ટ માટે અલગ API કી, જેનો સિસ્ટમ પ્રોમ્પ્ટ સર્વર હંમેશાં લાગુ કરે છે.",
+ "cpEmpty": "હજી કોઈ ક્લાયન્ટ પ્રોફાઇલ નથી.",
+ "cpNameLabel": "નામ",
+ "cpNamePlaceholder": "દા.ત. સપોર્ટ બોટ",
+ "cpPromptLabel": "સિસ્ટમ પ્રોમ્પ્ટ (વૈકલ્પિક)",
+ "cpPromptPlaceholder": "આ કીથી થતી દરેક વિનંતી પહેલાં સર્વર ઉમેરે તે સૂચનાઓ.",
+ "cpCreate": "પ્રોફાઇલ બનાવો",
+ "cpRotate": "કી બદલો",
+ "cpKeyOnce": "આ કી હમણાં જ કૉપિ કરો — તે ફરી બતાવવામાં આવશે નહીં.",
+ "cpEnabledAria": "પ્રોફાઇલ સક્ષમ"
},
"status": {
"healthy": "સ્વસ્થ",
diff --git a/client/src/i18n/locales/ha.json b/client/src/i18n/locales/ha.json
index ba051c5b..90e60561 100644
--- a/client/src/i18n/locales/ha.json
+++ b/client/src/i18n/locales/ha.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Ba a saita iyaka ba — wannan maɓalli yana aiki da duk samfuran mai bayarwa.",
"modelScopeClear": "Share iyaka",
"modelScopeBadgeOne": "iyakantacce · samfuri 1",
- "modelScopeBadgeOther": "iyakantacce · samfura {count}"
+ "modelScopeBadgeOther": "iyakantacce · samfura {count}",
+ "cpTitle": "Bayanan martabar abokan ciniki",
+ "cpDesc": "Maɓallan API na kowane abokin ciniki, kowanne da umarnin tsarin da sabar ke amfani da shi koyaushe.",
+ "cpEmpty": "Babu bayanan martabar abokan ciniki tukuna.",
+ "cpNameLabel": "Suna",
+ "cpNamePlaceholder": "misali: Bot na tallafi",
+ "cpPromptLabel": "Umarnin tsari (na zaɓi)",
+ "cpPromptPlaceholder": "Umarnin da sabar ke ƙarawa a gaban kowace buƙata da aka yi da wannan maɓallin.",
+ "cpCreate": "Ƙirƙiri bayanin martaba",
+ "cpRotate": "Canza maɓalli",
+ "cpKeyOnce": "Kwafi wannan maɓallin yanzu — ba za a sake nuna shi ba.",
+ "cpEnabledAria": "An kunna bayanin martaba"
},
"status": {
"healthy": "lafiya",
diff --git a/client/src/i18n/locales/he.json b/client/src/i18n/locales/he.json
index b53e2950..07a0ea9b 100644
--- a/client/src/i18n/locales/he.json
+++ b/client/src/i18n/locales/he.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "לא הוגדר טווח — מפתח זה משרת את כל המודלים של הספק שלו.",
"modelScopeClear": "נקה טווח",
"modelScopeBadgeOne": "מוגבל · מודל 1",
- "modelScopeBadgeOther": "מוגבל · {count} מודלים"
+ "modelScopeBadgeOther": "מוגבל · {count} מודלים",
+ "cpTitle": "פרופילי לקוח",
+ "cpDesc": "מפתחות API לכל לקוח, לכל אחד הנחיית מערכת שהשרת מחיל תמיד.",
+ "cpEmpty": "אין עדיין פרופילי לקוח.",
+ "cpNameLabel": "שם",
+ "cpNamePlaceholder": "לדוגמה: בוט תמיכה",
+ "cpPromptLabel": "הנחיית מערכת (אופציונלי)",
+ "cpPromptPlaceholder": "הוראות שהשרת מוסיף לפני כל בקשה שנעשית עם מפתח זה.",
+ "cpCreate": "יצירת פרופיל",
+ "cpRotate": "החלפת מפתח",
+ "cpKeyOnce": "העתיקו את המפתח עכשיו — הוא לא יוצג שוב.",
+ "cpEnabledAria": "הפרופיל מופעל"
},
"status": {
"healthy": "בריא",
diff --git a/client/src/i18n/locales/hi.json b/client/src/i18n/locales/hi.json
index 0416180d..ac225013 100644
--- a/client/src/i18n/locales/hi.json
+++ b/client/src/i18n/locales/hi.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "कोई दायरा सेट नहीं — यह कुंजी अपने प्रदाता के सभी मॉडल के लिए काम करती है।",
"modelScopeClear": "दायरा हटाएँ",
"modelScopeBadgeOne": "सीमित · 1 मॉडल",
- "modelScopeBadgeOther": "सीमित · {count} मॉडल"
+ "modelScopeBadgeOther": "सीमित · {count} मॉडल",
+ "cpTitle": "क्लाइंट प्रोफ़ाइल",
+ "cpDesc": "हर क्लाइंट के लिए अलग API कुंजी, जिसके सिस्टम प्रॉम्प्ट को सर्वर हमेशा लागू करता है।",
+ "cpEmpty": "अभी कोई क्लाइंट प्रोफ़ाइल नहीं है।",
+ "cpNameLabel": "नाम",
+ "cpNamePlaceholder": "जैसे: सपोर्ट बॉट",
+ "cpPromptLabel": "सिस्टम प्रॉम्प्ट (वैकल्पिक)",
+ "cpPromptPlaceholder": "निर्देश जो सर्वर इस कुंजी से किए गए हर अनुरोध से पहले जोड़ता है।",
+ "cpCreate": "प्रोफ़ाइल बनाएँ",
+ "cpRotate": "कुंजी बदलें",
+ "cpKeyOnce": "इस कुंजी को अभी कॉपी करें — यह दोबारा नहीं दिखाई जाएगी।",
+ "cpEnabledAria": "प्रोफ़ाइल सक्षम"
},
"status": {
"healthy": "स्वस्थ",
diff --git a/client/src/i18n/locales/hr.json b/client/src/i18n/locales/hr.json
index f2241518..a0b2b622 100644
--- a/client/src/i18n/locales/hr.json
+++ b/client/src/i18n/locales/hr.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Opseg nije postavljen — ovaj ključ služi sve modele svog pružatelja.",
"modelScopeClear": "Očisti opseg",
"modelScopeBadgeOne": "ograničen · 1 model",
- "modelScopeBadgeOther": "ograničen · {count} modela"
+ "modelScopeBadgeOther": "ograničen · {count} modela",
+ "cpTitle": "Profili klijenata",
+ "cpDesc": "API ključevi po klijentu, svaki sa sistemskim promptom koji poslužitelj uvijek primjenjuje.",
+ "cpEmpty": "Još nema profila klijenata.",
+ "cpNameLabel": "Naziv",
+ "cpNamePlaceholder": "npr. Bot za podršku",
+ "cpPromptLabel": "Sistemski prompt (neobavezno)",
+ "cpPromptPlaceholder": "Upute koje poslužitelj dodaje prije svakog zahtjeva ovim ključem.",
+ "cpCreate": "Stvori profil",
+ "cpRotate": "Rotiraj ključ",
+ "cpKeyOnce": "Kopirajte ovaj ključ sada — neće se ponovno prikazati.",
+ "cpEnabledAria": "Profil omogućen"
},
"status": {
"healthy": "Zdravo",
diff --git a/client/src/i18n/locales/hu.json b/client/src/i18n/locales/hu.json
index 673a5896..f172ca83 100644
--- a/client/src/i18n/locales/hu.json
+++ b/client/src/i18n/locales/hu.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Nincs beállított kör — ez a kulcs a szolgáltató összes modelljét kiszolgálja.",
"modelScopeClear": "Kör törlése",
"modelScopeBadgeOne": "korlátozva · 1 modell",
- "modelScopeBadgeOther": "korlátozva · {count} modell"
+ "modelScopeBadgeOther": "korlátozva · {count} modell",
+ "cpTitle": "Kliensprofilok",
+ "cpDesc": "Kliensenkénti API-kulcsok, mindegyikhez saját rendszerprompt, amelyet a szerver mindig alkalmaz.",
+ "cpEmpty": "Még nincsenek kliensprofilok.",
+ "cpNameLabel": "Név",
+ "cpNamePlaceholder": "pl. Támogatási bot",
+ "cpPromptLabel": "Rendszerprompt (opcionális)",
+ "cpPromptPlaceholder": "Utasítások, amelyeket a szerver minden, ezzel a kulccsal indított kérés elé illeszt.",
+ "cpCreate": "Profil létrehozása",
+ "cpRotate": "Kulcs cseréje",
+ "cpKeyOnce": "Másolja ki most ezt a kulcsot — többé nem jelenik meg.",
+ "cpEnabledAria": "Profil engedélyezve"
},
"status": {
"healthy": "egészséges",
diff --git a/client/src/i18n/locales/id.json b/client/src/i18n/locales/id.json
index 03496d31..c3e20e3c 100644
--- a/client/src/i18n/locales/id.json
+++ b/client/src/i18n/locales/id.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Cakupan belum diatur — kunci ini melayani semua model penyedianya.",
"modelScopeClear": "Hapus cakupan",
"modelScopeBadgeOne": "dibatasi · 1 model",
- "modelScopeBadgeOther": "dibatasi · {count} model"
+ "modelScopeBadgeOther": "dibatasi · {count} model",
+ "cpTitle": "Profil klien",
+ "cpDesc": "Kunci API per klien, masing-masing dengan prompt sistem yang selalu diterapkan server.",
+ "cpEmpty": "Belum ada profil klien.",
+ "cpNameLabel": "Nama",
+ "cpNamePlaceholder": "mis. Bot dukungan",
+ "cpPromptLabel": "Prompt sistem (opsional)",
+ "cpPromptPlaceholder": "Instruksi yang ditambahkan server di awal setiap permintaan dengan kunci ini.",
+ "cpCreate": "Buat profil",
+ "cpRotate": "Rotasi kunci",
+ "cpKeyOnce": "Salin kunci ini sekarang — tidak akan ditampilkan lagi.",
+ "cpEnabledAria": "Profil aktif"
},
"status": {
"healthy": "sehat",
diff --git a/client/src/i18n/locales/ig.json b/client/src/i18n/locales/ig.json
index a891429e..bb87b1e4 100644
--- a/client/src/i18n/locales/ig.json
+++ b/client/src/i18n/locales/ig.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Enweghị oke edobere — igodo a na-arụ ọrụ maka model niile nke onye na-eweta ya.",
"modelScopeClear": "Hichapụ oke",
"modelScopeBadgeOne": "oke · model 1",
- "modelScopeBadgeOther": "oke · model {count}"
+ "modelScopeBadgeOther": "oke · model {count}",
+ "cpTitle": "Profaịlụ ndị ahịa",
+ "cpDesc": "Igodo API maka onye ahịa ọ bụla, nke ọ bụla nwere ntụziaka sistemu nke sava na-etinye mgbe niile.",
+ "cpEmpty": "Enwebeghị profaịlụ onye ahịa.",
+ "cpNameLabel": "Aha",
+ "cpNamePlaceholder": "dịka: Bot nkwado",
+ "cpPromptLabel": "Ntụziaka sistemu (nhọrọ)",
+ "cpPromptPlaceholder": "Ntụziaka sava na-etinye n'ihu arịrịọ ọ bụla e ji igodo a mee.",
+ "cpCreate": "Mepụta profaịlụ",
+ "cpRotate": "Gbanwee igodo",
+ "cpKeyOnce": "Detuo igodo a ugbu a — agaghị egosi ya ọzọ.",
+ "cpEnabledAria": "Profaịlụ na-arụ ọrụ"
},
"status": {
"healthy": "ahụike",
diff --git a/client/src/i18n/locales/it.json b/client/src/i18n/locales/it.json
index 4afacccb..a6204dd2 100644
--- a/client/src/i18n/locales/it.json
+++ b/client/src/i18n/locales/it.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Nessun ambito impostato — questa chiave serve tutti i modelli del suo provider.",
"modelScopeClear": "Cancella ambito",
"modelScopeBadgeOne": "limitata · 1 modello",
- "modelScopeBadgeOther": "limitata · {count} modelli"
+ "modelScopeBadgeOther": "limitata · {count} modelli",
+ "cpTitle": "Profili client",
+ "cpDesc": "Chiavi API per singolo client, ognuna con un prompt di sistema che il server applica sempre.",
+ "cpEmpty": "Nessun profilo client per ora.",
+ "cpNameLabel": "Nome",
+ "cpNamePlaceholder": "es. Bot di supporto",
+ "cpPromptLabel": "Prompt di sistema (facoltativo)",
+ "cpPromptPlaceholder": "Istruzioni che il server antepone a ogni richiesta effettuata con questa chiave.",
+ "cpCreate": "Crea profilo",
+ "cpRotate": "Ruota chiave",
+ "cpKeyOnce": "Copia questa chiave adesso — non verrà più mostrata.",
+ "cpEnabledAria": "Profilo abilitato"
},
"status": {
"healthy": "funzionante",
diff --git a/client/src/i18n/locales/ja.json b/client/src/i18n/locales/ja.json
index 7b8ce5f5..1a38ddd3 100644
--- a/client/src/i18n/locales/ja.json
+++ b/client/src/i18n/locales/ja.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "スコープ未設定 — このキーはプロバイダーのすべてのモデルに使えます。",
"modelScopeClear": "スコープを解除",
"modelScopeBadgeOne": "限定 · 1 モデル",
- "modelScopeBadgeOther": "限定 · {count} モデル"
+ "modelScopeBadgeOther": "限定 · {count} モデル",
+ "cpTitle": "クライアントプロファイル",
+ "cpDesc": "クライアントごとの API キー。それぞれのシステムプロンプトをサーバーが常に適用します。",
+ "cpEmpty": "クライアントプロファイルはまだありません。",
+ "cpNameLabel": "名前",
+ "cpNamePlaceholder": "例: サポートボット",
+ "cpPromptLabel": "システムプロンプト(任意)",
+ "cpPromptPlaceholder": "このキーで行われるすべてのリクエストの先頭にサーバーが追加する指示。",
+ "cpCreate": "プロファイルを作成",
+ "cpRotate": "キーをローテーション",
+ "cpKeyOnce": "このキーを今すぐコピーしてください。二度と表示されません。",
+ "cpEnabledAria": "プロファイル有効"
},
"status": {
"healthy": "健康な",
diff --git a/client/src/i18n/locales/ka.json b/client/src/i18n/locales/ka.json
index 739c5056..a589036c 100644
--- a/client/src/i18n/locales/ka.json
+++ b/client/src/i18n/locales/ka.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "ფარგლები არ არის დაყენებული — ეს გასაღები ემსახურება მისი პროვაიდერის ყველა მოდელს.",
"modelScopeClear": "ფარგლების გასუფთავება",
"modelScopeBadgeOne": "შეზღუდული · 1 მოდელი",
- "modelScopeBadgeOther": "შეზღუდული · {count} მოდელი"
+ "modelScopeBadgeOther": "შეზღუდული · {count} მოდელი",
+ "cpTitle": "კლიენტის პროფილები",
+ "cpDesc": "ცალკე API გასაღები თითოეული კლიენტისთვის, თითოეულს აქვს სისტემური პრომპტი, რომელსაც სერვერი ყოველთვის იყენებს.",
+ "cpEmpty": "კლიენტის პროფილები ჯერ არ არის.",
+ "cpNameLabel": "სახელი",
+ "cpNamePlaceholder": "მაგ. მხარდაჭერის ბოტი",
+ "cpPromptLabel": "სისტემური პრომპტი (არასავალდებულო)",
+ "cpPromptPlaceholder": "ინსტრუქციები, რომლებსაც სერვერი ამ გასაღებით გაკეთებულ ყოველ მოთხოვნას წინ ურთავს.",
+ "cpCreate": "პროფილის შექმნა",
+ "cpRotate": "გასაღების შეცვლა",
+ "cpKeyOnce": "დააკოპირეთ ეს გასაღები ახლავე — ის აღარ გამოჩნდება.",
+ "cpEnabledAria": "პროფილი ჩართულია"
},
"status": {
"healthy": "ჯანსაღი",
diff --git a/client/src/i18n/locales/km.json b/client/src/i18n/locales/km.json
index b6dd279d..1cceb229 100644
--- a/client/src/i18n/locales/km.json
+++ b/client/src/i18n/locales/km.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "មិនទាន់កំណត់វិសាលភាព — សោនេះប្រើបានជាមួយម៉ូដែលទាំងអស់របស់អ្នកផ្តល់សេវា។",
"modelScopeClear": "លុបវិសាលភាព",
"modelScopeBadgeOne": "កំណត់ · ម៉ូដែល 1",
- "modelScopeBadgeOther": "កំណត់ · ម៉ូដែល {count}"
+ "modelScopeBadgeOther": "កំណត់ · ម៉ូដែល {count}",
+ "cpTitle": "ប្រវត្តិរូបអតិថិជន",
+ "cpDesc": "សោ API សម្រាប់អតិថិជននីមួយៗ ដែលមាន system prompt ដែលម៉ាស៊ីនមេអនុវត្តជានិច្ច។",
+ "cpEmpty": "មិនទាន់មានប្រវត្តិរូបអតិថិជនទេ។",
+ "cpNameLabel": "ឈ្មោះ",
+ "cpNamePlaceholder": "ឧ. Bot ជំនួយ",
+ "cpPromptLabel": "System prompt (ស្រេចចិត្ត)",
+ "cpPromptPlaceholder": "ការណែនាំដែលម៉ាស៊ីនមេបន្ថែមនៅមុខសំណើនីមួយៗ ដែលធ្វើដោយសោនេះ។",
+ "cpCreate": "បង្កើតប្រវត្តិរូប",
+ "cpRotate": "ប្ដូរសោ",
+ "cpKeyOnce": "ចម្លងសោនេះឥឡូវនេះ — វានឹងមិនបង្ហាញម្ដងទៀតទេ។",
+ "cpEnabledAria": "ប្រវត្តិរូបបានបើក"
},
"status": {
"healthy": "មានសុខភាពល្អ",
diff --git a/client/src/i18n/locales/kn.json b/client/src/i18n/locales/kn.json
index db57cba3..d3af0b93 100644
--- a/client/src/i18n/locales/kn.json
+++ b/client/src/i18n/locales/kn.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "ವ್ಯಾಪ್ತಿ ಹೊಂದಿಸಿಲ್ಲ — ಈ ಕೀಲಿ ತನ್ನ ಪೂರೈಕೆದಾರರ ಎಲ್ಲ ಮಾಡೆಲ್‌ಗಳಿಗೂ ಕೆಲಸ ಮಾಡುತ್ತದೆ.",
"modelScopeClear": "ವ್ಯಾಪ್ತಿ ತೆಗೆದುಹಾಕಿ",
"modelScopeBadgeOne": "ಸೀಮಿತ · 1 ಮಾಡೆಲ್",
- "modelScopeBadgeOther": "ಸೀಮಿತ · {count} ಮಾಡೆಲ್‌ಗಳು"
+ "modelScopeBadgeOther": "ಸೀಮಿತ · {count} ಮಾಡೆಲ್‌ಗಳು",
+ "cpTitle": "ಕ್ಲೈಂಟ್ ಪ್ರೊಫೈಲ್‌ಗಳು",
+ "cpDesc": "ಪ್ರತಿ ಕ್ಲೈಂಟ್‌ಗೆ ಪ್ರತ್ಯೇಕ API ಕೀ; ಅದರ ಸಿಸ್ಟಂ ಪ್ರಾಂಪ್ಟ್ ಅನ್ನು ಸರ್ವರ್ ಯಾವಾಗಲೂ ಅನ್ವಯಿಸುತ್ತದೆ.",
+ "cpEmpty": "ಇನ್ನೂ ಯಾವುದೇ ಕ್ಲೈಂಟ್ ಪ್ರೊಫೈಲ್‌ಗಳಿಲ್ಲ.",
+ "cpNameLabel": "ಹೆಸರು",
+ "cpNamePlaceholder": "ಉದಾ. ಬೆಂಬಲ ಬಾಟ್",
+ "cpPromptLabel": "ಸಿಸ್ಟಂ ಪ್ರಾಂಪ್ಟ್ (ಐಚ್ಛಿಕ)",
+ "cpPromptPlaceholder": "ಈ ಕೀ ಬಳಸಿ ಮಾಡುವ ಪ್ರತಿ ವಿನಂತಿಯ ಮೊದಲು ಸರ್ವರ್ ಸೇರಿಸುವ ಸೂಚನೆಗಳು.",
+ "cpCreate": "ಪ್ರೊಫೈಲ್ ರಚಿಸಿ",
+ "cpRotate": "ಕೀ ಬದಲಾಯಿಸಿ",
+ "cpKeyOnce": "ಈ ಕೀಯನ್ನು ಈಗಲೇ ನಕಲಿಸಿ — ಇದು ಮತ್ತೆ ತೋರಿಸಲ್ಪಡುವುದಿಲ್ಲ.",
+ "cpEnabledAria": "ಪ್ರೊಫೈಲ್ ಸಕ್ರಿಯ"
},
"status": {
"healthy": "ಆರೋಗ್ಯಕರ",
diff --git a/client/src/i18n/locales/ko.json b/client/src/i18n/locales/ko.json
index 359efc45..81fa144c 100644
--- a/client/src/i18n/locales/ko.json
+++ b/client/src/i18n/locales/ko.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "범위 미설정 — 이 키는 제공자의 모든 모델에 사용됩니다.",
"modelScopeClear": "범위 지우기",
"modelScopeBadgeOne": "제한됨 · 모델 1개",
- "modelScopeBadgeOther": "제한됨 · 모델 {count}개"
+ "modelScopeBadgeOther": "제한됨 · 모델 {count}개",
+ "cpTitle": "클라이언트 프로필",
+ "cpDesc": "클라이언트별 API 키로, 각 키의 시스템 프롬프트를 서버가 항상 적용합니다.",
+ "cpEmpty": "아직 클라이언트 프로필이 없습니다.",
+ "cpNameLabel": "이름",
+ "cpNamePlaceholder": "예: 고객지원 봇",
+ "cpPromptLabel": "시스템 프롬프트 (선택)",
+ "cpPromptPlaceholder": "이 키로 보내는 모든 요청 앞에 서버가 추가하는 지침입니다.",
+ "cpCreate": "프로필 만들기",
+ "cpRotate": "키 교체",
+ "cpKeyOnce": "지금 이 키를 복사하세요. 다시 표시되지 않습니다.",
+ "cpEnabledAria": "프로필 활성화됨"
},
"status": {
"healthy": "건강한",
diff --git a/client/src/i18n/locales/lt.json b/client/src/i18n/locales/lt.json
index 8c35b2d4..d3e7a5db 100644
--- a/client/src/i18n/locales/lt.json
+++ b/client/src/i18n/locales/lt.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Aprėptis nenustatyta — šis raktas aptarnauja visus savo teikėjo modelius.",
"modelScopeClear": "Išvalyti aprėptį",
"modelScopeBadgeOne": "apribotas · 1 modelis",
- "modelScopeBadgeOther": "apribotas · {count} modeliai"
+ "modelScopeBadgeOther": "apribotas · {count} modeliai",
+ "cpTitle": "Klientų profiliai",
+ "cpDesc": "Atskiri API raktai kiekvienam klientui, kiekvienas su sisteminiu promptu, kurį serveris visada taiko.",
+ "cpEmpty": "Klientų profilių kol kas nėra.",
+ "cpNameLabel": "Pavadinimas",
+ "cpNamePlaceholder": "pvz., Pagalbos botas",
+ "cpPromptLabel": "Sisteminis promptas (nebūtina)",
+ "cpPromptPlaceholder": "Nurodymai, kuriuos serveris prideda prieš kiekvieną užklausą šiuo raktu.",
+ "cpCreate": "Sukurti profilį",
+ "cpRotate": "Pakeisti raktą",
+ "cpKeyOnce": "Nukopijuokite šį raktą dabar — jis daugiau nebus rodomas.",
+ "cpEnabledAria": "Profilis įjungtas"
},
"status": {
"healthy": "Sveika",
diff --git a/client/src/i18n/locales/ml.json b/client/src/i18n/locales/ml.json
index c5b7f9df..d725eeef 100644
--- a/client/src/i18n/locales/ml.json
+++ b/client/src/i18n/locales/ml.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "പരിധി സജ്ജമാക്കിയിട്ടില്ല — ഈ കീ അതിന്റെ ദാതാവിന്റെ എല്ലാ മോഡലുകൾക്കും പ്രവർത്തിക്കുന്നു.",
"modelScopeClear": "പരിധി നീക്കം ചെയ്യുക",
"modelScopeBadgeOne": "പരിമിതം · 1 മോഡൽ",
- "modelScopeBadgeOther": "പരിമിതം · {count} മോഡലുകൾ"
+ "modelScopeBadgeOther": "പരിമിതം · {count} മോഡലുകൾ",
+ "cpTitle": "ക്ലയന്റ് പ്രൊഫൈലുകൾ",
+ "cpDesc": "ഓരോ ക്ലയന്റിനും പ്രത്യേക API കീ; അതിന്റെ സിസ്റ്റം പ്രോംപ്റ്റ് സെർവർ എപ്പോഴും പ്രയോഗിക്കുന്നു.",
+ "cpEmpty": "ഇതുവരെ ക്ലയന്റ് പ്രൊഫൈലുകളില്ല.",
+ "cpNameLabel": "പേര്",
+ "cpNamePlaceholder": "ഉദാ. സപ്പോർട്ട് ബോട്ട്",
+ "cpPromptLabel": "സിസ്റ്റം പ്രോംപ്റ്റ് (ഐച്ഛികം)",
+ "cpPromptPlaceholder": "ഈ കീ ഉപയോഗിച്ചുള്ള ഓരോ അഭ്യർത്ഥനയ്ക്കും മുമ്പ് സെർവർ ചേർക്കുന്ന നിർദ്ദേശങ്ങൾ.",
+ "cpCreate": "പ്രൊഫൈൽ സൃഷ്ടിക്കുക",
+ "cpRotate": "കീ മാറ്റുക",
+ "cpKeyOnce": "ഈ കീ ഇപ്പോൾതന്നെ പകർത്തുക — ഇത് വീണ്ടും കാണിക്കില്ല.",
+ "cpEnabledAria": "പ്രൊഫൈൽ പ്രവർത്തനക്ഷമം"
},
"status": {
"healthy": "ആരോഗ്യമുള്ള",
diff --git a/client/src/i18n/locales/mr.json b/client/src/i18n/locales/mr.json
index fff955f1..aa844242 100644
--- a/client/src/i18n/locales/mr.json
+++ b/client/src/i18n/locales/mr.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "व्याप्ती सेट केलेली नाही — ही की तिच्या प्रदात्याच्या सर्व मॉडेलसाठी वापरली जाते.",
"modelScopeClear": "व्याप्ती काढा",
"modelScopeBadgeOne": "मर्यादित · 1 मॉडेल",
- "modelScopeBadgeOther": "मर्यादित · {count} मॉडेल"
+ "modelScopeBadgeOther": "मर्यादित · {count} मॉडेल",
+ "cpTitle": "क्लायंट प्रोफाइल",
+ "cpDesc": "प्रत्येक क्लायंटसाठी वेगळी API की, जिचा सिस्टम प्रॉम्प्ट सर्व्हर नेहमी लागू करतो.",
+ "cpEmpty": "अद्याप कोणतेही क्लायंट प्रोफाइल नाहीत.",
+ "cpNameLabel": "नाव",
+ "cpNamePlaceholder": "उदा. सपोर्ट बॉट",
+ "cpPromptLabel": "सिस्टम प्रॉम्प्ट (ऐच्छिक)",
+ "cpPromptPlaceholder": "या कीने केलेल्या प्रत्येक विनंतीपूर्वी सर्व्हर जोडत असलेल्या सूचना.",
+ "cpCreate": "प्रोफाइल तयार करा",
+ "cpRotate": "की बदला",
+ "cpKeyOnce": "ही की आत्ताच कॉपी करा — ती पुन्हा दाखवली जाणार नाही.",
+ "cpEnabledAria": "प्रोफाइल सक्षम"
},
"status": {
"healthy": "निरोगी",
diff --git a/client/src/i18n/locales/ms.json b/client/src/i18n/locales/ms.json
index e521a397..4ecccff3 100644
--- a/client/src/i18n/locales/ms.json
+++ b/client/src/i18n/locales/ms.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Tiada skop ditetapkan — kunci ini melayani semua model penyedianya.",
"modelScopeClear": "Kosongkan skop",
"modelScopeBadgeOne": "terhad · 1 model",
- "modelScopeBadgeOther": "terhad · {count} model"
+ "modelScopeBadgeOther": "terhad · {count} model",
+ "cpTitle": "Profil klien",
+ "cpDesc": "Kunci API bagi setiap klien, masing-masing dengan prompt sistem yang sentiasa digunakan oleh pelayan.",
+ "cpEmpty": "Belum ada profil klien.",
+ "cpNameLabel": "Nama",
+ "cpNamePlaceholder": "cth. Bot sokongan",
+ "cpPromptLabel": "Prompt sistem (pilihan)",
+ "cpPromptPlaceholder": "Arahan yang ditambah oleh pelayan di hadapan setiap permintaan dengan kunci ini.",
+ "cpCreate": "Cipta profil",
+ "cpRotate": "Putar kunci",
+ "cpKeyOnce": "Salin kunci ini sekarang — ia tidak akan dipaparkan lagi.",
+ "cpEnabledAria": "Profil diaktifkan"
},
"status": {
"healthy": "sihat",
diff --git a/client/src/i18n/locales/my.json b/client/src/i18n/locales/my.json
index 64c5b678..d8878673 100644
--- a/client/src/i18n/locales/my.json
+++ b/client/src/i18n/locales/my.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "အတိုင်းအတာ မသတ်မှတ်ရသေးပါ — ဤကီးသည် ၎င်း၏ ဝန်ဆောင်မှုပေးသူ၏ မော်ဒယ်အားလုံးအတွက် အသုံးပြုနိုင်သည်။",
"modelScopeClear": "အတိုင်းအတာ ဖယ်ရှားရန်",
"modelScopeBadgeOne": "ကန့်သတ် · မော်ဒယ် 1 ခု",
- "modelScopeBadgeOther": "ကန့်သတ် · မော်ဒယ် {count} ခု"
+ "modelScopeBadgeOther": "ကန့်သတ် · မော်ဒယ် {count} ခု",
+ "cpTitle": "ကလိုင်းယင့် ပရိုဖိုင်များ",
+ "cpDesc": "ကလိုင်းယင့်တစ်ခုချင်းစီအတွက် သီးခြား API ကီးများ၊ တစ်ခုစီတွင် ဆာဗာက အမြဲအသုံးပြုသည့် စနစ် prompt ပါရှိသည်။",
+ "cpEmpty": "ကလိုင်းယင့် ပရိုဖိုင် မရှိသေးပါ။",
+ "cpNameLabel": "အမည်",
+ "cpNamePlaceholder": "ဥပမာ - Support bot",
+ "cpPromptLabel": "စနစ် prompt (ရွေးချယ်နိုင်)",
+ "cpPromptPlaceholder": "ဤကီးဖြင့် ပြုလုပ်သည့် တောင်းဆိုမှုတိုင်း၏ ရှေ့တွင် ဆာဗာက ထည့်သည့် ညွှန်ကြားချက်များ။",
+ "cpCreate": "ပရိုဖိုင် ဖန်တီးရန်",
+ "cpRotate": "ကီး လဲလှယ်ရန်",
+ "cpKeyOnce": "ဤကီးကို ယခုပင် ကူးယူပါ — နောက်ထပ် ပြသမည် မဟုတ်ပါ။",
+ "cpEnabledAria": "ပရိုဖိုင် ဖွင့်ထားသည်"
},
"status": {
"healthy": "ကျန်းမာသော",
diff --git a/client/src/i18n/locales/ne.json b/client/src/i18n/locales/ne.json
index 498a39c0..d34bc125 100644
--- a/client/src/i18n/locales/ne.json
+++ b/client/src/i18n/locales/ne.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "कुनै दायरा सेट छैन — यो कुञ्जी आफ्नो प्रदायकका सबै मोडेलका लागि काम गर्छ।",
"modelScopeClear": "दायरा हटाउनुहोस्",
"modelScopeBadgeOne": "सीमित · 1 मोडेल",
- "modelScopeBadgeOther": "सीमित · {count} मोडेल"
+ "modelScopeBadgeOther": "सीमित · {count} मोडेल",
+ "cpTitle": "क्लाइन्ट प्रोफाइलहरू",
+ "cpDesc": "प्रत्येक क्लाइन्टका लागि छुट्टै API कुञ्जी, जसको सिस्टम प्रम्प्ट सर्भरले सधैँ लागू गर्छ।",
+ "cpEmpty": "अहिलेसम्म कुनै क्लाइन्ट प्रोफाइल छैन।",
+ "cpNameLabel": "नाम",
+ "cpNamePlaceholder": "जस्तै: सपोर्ट बोट",
+ "cpPromptLabel": "सिस्टम प्रम्प्ट (वैकल्पिक)",
+ "cpPromptPlaceholder": "यस कुञ्जीबाट गरिने हरेक अनुरोधअघि सर्भरले थप्ने निर्देशनहरू।",
+ "cpCreate": "प्रोफाइल बनाउनुहोस्",
+ "cpRotate": "कुञ्जी बदल्नुहोस्",
+ "cpKeyOnce": "यो कुञ्जी अहिल्यै कपी गर्नुहोस् — यो फेरि देखाइने छैन।",
+ "cpEnabledAria": "प्रोफाइल सक्षम"
},
"status": {
"healthy": "स्वस्थ छ",
diff --git a/client/src/i18n/locales/nl.json b/client/src/i18n/locales/nl.json
index beb4168c..c4c31ce9 100644
--- a/client/src/i18n/locales/nl.json
+++ b/client/src/i18n/locales/nl.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Geen bereik ingesteld — deze sleutel bedient alle modellen van zijn provider.",
"modelScopeClear": "Bereik wissen",
"modelScopeBadgeOne": "beperkt · 1 model",
- "modelScopeBadgeOther": "beperkt · {count} modellen"
+ "modelScopeBadgeOther": "beperkt · {count} modellen",
+ "cpTitle": "Clientprofielen",
+ "cpDesc": "API-sleutels per client, elk met een systeemprompt die de server altijd toepast.",
+ "cpEmpty": "Nog geen clientprofielen.",
+ "cpNameLabel": "Naam",
+ "cpNamePlaceholder": "bijv. Supportbot",
+ "cpPromptLabel": "Systeemprompt (optioneel)",
+ "cpPromptPlaceholder": "Instructies die de server vóór elk verzoek met deze sleutel plaatst.",
+ "cpCreate": "Profiel aanmaken",
+ "cpRotate": "Sleutel rouleren",
+ "cpKeyOnce": "Kopieer deze sleutel nu — hij wordt niet opnieuw getoond.",
+ "cpEnabledAria": "Profiel ingeschakeld"
},
"status": {
"healthy": "Gezond",
diff --git a/client/src/i18n/locales/no.json b/client/src/i18n/locales/no.json
index 962d98b1..1f38a88b 100644
--- a/client/src/i18n/locales/no.json
+++ b/client/src/i18n/locales/no.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Ingen avgrensning satt — nøkkelen betjener alle modellene til leverandøren sin.",
"modelScopeClear": "Fjern avgrensning",
"modelScopeBadgeOne": "begrenset · 1 modell",
- "modelScopeBadgeOther": "begrenset · {count} modeller"
+ "modelScopeBadgeOther": "begrenset · {count} modeller",
+ "cpTitle": "Klientprofiler",
+ "cpDesc": "API-nøkler per klient, hver med en systemprompt som serveren alltid bruker.",
+ "cpEmpty": "Ingen klientprofiler ennå.",
+ "cpNameLabel": "Navn",
+ "cpNamePlaceholder": "f.eks. Supportbot",
+ "cpPromptLabel": "Systemprompt (valgfritt)",
+ "cpPromptPlaceholder": "Instruksjoner som serveren setter inn før hver forespørsel med denne nøkkelen.",
+ "cpCreate": "Opprett profil",
+ "cpRotate": "Roter nøkkel",
+ "cpKeyOnce": "Kopier denne nøkkelen nå — den vises ikke igjen.",
+ "cpEnabledAria": "Profil aktivert"
},
"status": {
"healthy": "Sunt",
diff --git a/client/src/i18n/locales/or.json b/client/src/i18n/locales/or.json
index 9f9c9128..67ba7af2 100644
--- a/client/src/i18n/locales/or.json
+++ b/client/src/i18n/locales/or.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "କୌଣସି ପରିସର ସେଟ୍ ନାହିଁ — ଏହି କୀ ତାହାର ପ୍ରଦାତାର ସମସ୍ତ ମଡେଲ ପାଇଁ କାମ କରେ।",
"modelScopeClear": "ପରିସର ହଟାନ୍ତୁ",
"modelScopeBadgeOne": "ସୀମିତ · 1 ମଡେଲ",
- "modelScopeBadgeOther": "ସୀମିତ · {count} ମଡେଲ"
+ "modelScopeBadgeOther": "ସୀମିତ · {count} ମଡେଲ",
+ "cpTitle": "କ୍ଲାଏଣ୍ଟ ପ୍ରୋଫାଇଲ୍",
+ "cpDesc": "ପ୍ରତ୍ୟେକ କ୍ଲାଏଣ୍ଟ ପାଇଁ ଅଲଗା API କି; ଏହାର ସିଷ୍ଟମ୍ ପ୍ରମ୍ପ୍ଟକୁ ସର୍ଭର ସର୍ବଦା ପ୍ରୟୋଗ କରେ।",
+ "cpEmpty": "ଏପର୍ଯ୍ୟନ୍ତ କୌଣସି କ୍ଲାଏଣ୍ଟ ପ୍ରୋଫାଇଲ୍ ନାହିଁ।",
+ "cpNameLabel": "ନାମ",
+ "cpNamePlaceholder": "ଯଥା: ସପୋର୍ଟ ବଟ୍",
+ "cpPromptLabel": "ସିଷ୍ଟମ୍ ପ୍ରମ୍ପ୍ଟ (ଇଚ୍ଛାଧୀନ)",
+ "cpPromptPlaceholder": "ଏହି କି ସହିତ କରାଯାଉଥିବା ପ୍ରତ୍ୟେକ ଅନୁରୋଧ ପୂର୍ବରୁ ସର୍ଭର ଯୋଡୁଥିବା ନିର୍ଦ୍ଦେଶାବଳୀ।",
+ "cpCreate": "ପ୍ରୋଫାଇଲ୍ ତିଆରି କରନ୍ତୁ",
+ "cpRotate": "କି ବଦଳାନ୍ତୁ",
+ "cpKeyOnce": "ଏହି କି ବର୍ତ୍ତମାନ କପି କରନ୍ତୁ — ଏହା ପୁଣି ଦେଖାଯିବ ନାହିଁ।",
+ "cpEnabledAria": "ପ୍ରୋଫାଇଲ୍ ସକ୍ଷମ"
},
"status": {
"healthy": "ସୁସ୍ଥ",
diff --git a/client/src/i18n/locales/pa.json b/client/src/i18n/locales/pa.json
index 0c8d148d..b4875ebb 100644
--- a/client/src/i18n/locales/pa.json
+++ b/client/src/i18n/locales/pa.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "ਕੋਈ ਦਾਇਰਾ ਸੈੱਟ ਨਹੀਂ — ਇਹ ਕੁੰਜੀ ਆਪਣੇ ਪ੍ਰਦਾਤਾ ਦੇ ਸਾਰੇ ਮਾਡਲਾਂ ਲਈ ਕੰਮ ਕਰਦੀ ਹੈ।",
"modelScopeClear": "ਦਾਇਰਾ ਹਟਾਓ",
"modelScopeBadgeOne": "ਸੀਮਤ · 1 ਮਾਡਲ",
- "modelScopeBadgeOther": "ਸੀਮਤ · {count} ਮਾਡਲ"
+ "modelScopeBadgeOther": "ਸੀਮਤ · {count} ਮਾਡਲ",
+ "cpTitle": "ਕਲਾਇੰਟ ਪ੍ਰੋਫਾਈਲ",
+ "cpDesc": "ਹਰ ਕਲਾਇੰਟ ਲਈ ਵੱਖਰੀ API ਕੁੰਜੀ, ਜਿਸਦਾ ਸਿਸਟਮ ਪ੍ਰੋਂਪਟ ਸਰਵਰ ਹਮੇਸ਼ਾ ਲਾਗੂ ਕਰਦਾ ਹੈ।",
+ "cpEmpty": "ਹਾਲੇ ਕੋਈ ਕਲਾਇੰਟ ਪ੍ਰੋਫਾਈਲ ਨਹੀਂ ਹੈ।",
+ "cpNameLabel": "ਨਾਮ",
+ "cpNamePlaceholder": "ਜਿਵੇਂ: ਸਪੋਰਟ ਬੋਟ",
+ "cpPromptLabel": "ਸਿਸਟਮ ਪ੍ਰੋਂਪਟ (ਵਿਕਲਪਿਕ)",
+ "cpPromptPlaceholder": "ਹਦਾਇਤਾਂ ਜੋ ਸਰਵਰ ਇਸ ਕੁੰਜੀ ਨਾਲ ਕੀਤੀ ਹਰ ਬੇਨਤੀ ਤੋਂ ਪਹਿਲਾਂ ਜੋੜਦਾ ਹੈ।",
+ "cpCreate": "ਪ੍ਰੋਫਾਈਲ ਬਣਾਓ",
+ "cpRotate": "ਕੁੰਜੀ ਬਦਲੋ",
+ "cpKeyOnce": "ਇਹ ਕੁੰਜੀ ਹੁਣੇ ਕਾਪੀ ਕਰੋ — ਇਹ ਦੁਬਾਰਾ ਨਹੀਂ ਦਿਖਾਈ ਜਾਵੇਗੀ।",
+ "cpEnabledAria": "ਪ੍ਰੋਫਾਈਲ ਚਾਲੂ"
},
"status": {
"healthy": "ਸਿਹਤਮੰਦ",
diff --git a/client/src/i18n/locales/pl.json b/client/src/i18n/locales/pl.json
index 7bd75438..ce712f4f 100644
--- a/client/src/i18n/locales/pl.json
+++ b/client/src/i18n/locales/pl.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Brak zakresu — ten klucz obsługuje wszystkie modele swojego dostawcy.",
"modelScopeClear": "Wyczyść zakres",
"modelScopeBadgeOne": "ograniczony · 1 model",
- "modelScopeBadgeOther": "ograniczony · {count} modeli"
+ "modelScopeBadgeOther": "ograniczony · {count} modeli",
+ "cpTitle": "Profile klientów",
+ "cpDesc": "Osobne klucze API dla każdego klienta, każdy z promptem systemowym, który serwer zawsze stosuje.",
+ "cpEmpty": "Nie ma jeszcze profili klientów.",
+ "cpNameLabel": "Nazwa",
+ "cpNamePlaceholder": "np. Bot wsparcia",
+ "cpPromptLabel": "Prompt systemowy (opcjonalny)",
+ "cpPromptPlaceholder": "Instrukcje, które serwer dodaje przed każdym żądaniem wykonanym tym kluczem.",
+ "cpCreate": "Utwórz profil",
+ "cpRotate": "Wymień klucz",
+ "cpKeyOnce": "Skopiuj ten klucz teraz — nie zostanie ponownie wyświetlony.",
+ "cpEnabledAria": "Profil włączony"
},
"status": {
"healthy": "zdrowy",
diff --git a/client/src/i18n/locales/pt-BR.json b/client/src/i18n/locales/pt-BR.json
index d86d3650..837a108a 100644
--- a/client/src/i18n/locales/pt-BR.json
+++ b/client/src/i18n/locales/pt-BR.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Sem escopo definido — esta chave atende todos os modelos do provedor.",
"modelScopeClear": "Limpar escopo",
"modelScopeBadgeOne": "restrita · 1 modelo",
- "modelScopeBadgeOther": "restrita · {count} modelos"
+ "modelScopeBadgeOther": "restrita · {count} modelos",
+ "cpTitle": "Perfis de cliente",
+ "cpDesc": "Chaves de API por cliente, cada uma com um prompt de sistema que o servidor sempre aplica.",
+ "cpEmpty": "Ainda não há perfis de cliente.",
+ "cpNameLabel": "Nome",
+ "cpNamePlaceholder": "ex.: Bot de suporte",
+ "cpPromptLabel": "Prompt de sistema (opcional)",
+ "cpPromptPlaceholder": "Instruções que o servidor adiciona antes de cada solicitação feita com esta chave.",
+ "cpCreate": "Criar perfil",
+ "cpRotate": "Rotacionar chave",
+ "cpKeyOnce": "Copie esta chave agora — ela não será mostrada novamente.",
+ "cpEnabledAria": "Perfil habilitado"
},
"status": {
"healthy": "saudável",
diff --git a/client/src/i18n/locales/pt-PT.json b/client/src/i18n/locales/pt-PT.json
index 7078075b..37d1231e 100644
--- a/client/src/i18n/locales/pt-PT.json
+++ b/client/src/i18n/locales/pt-PT.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Sem âmbito definido — esta chave serve todos os modelos do fornecedor.",
"modelScopeClear": "Limpar âmbito",
"modelScopeBadgeOne": "restrita · 1 modelo",
- "modelScopeBadgeOther": "restrita · {count} modelos"
+ "modelScopeBadgeOther": "restrita · {count} modelos",
+ "cpTitle": "Perfis de cliente",
+ "cpDesc": "Chaves de API por cliente, cada uma com um prompt de sistema que o servidor aplica sempre.",
+ "cpEmpty": "Ainda não existem perfis de cliente.",
+ "cpNameLabel": "Nome",
+ "cpNamePlaceholder": "p. ex., Bot de apoio",
+ "cpPromptLabel": "Prompt de sistema (opcional)",
+ "cpPromptPlaceholder": "Instruções que o servidor antepõe a cada pedido feito com esta chave.",
+ "cpCreate": "Criar perfil",
+ "cpRotate": "Rodar chave",
+ "cpKeyOnce": "Copie esta chave agora — não voltará a ser mostrada.",
+ "cpEnabledAria": "Perfil ativado"
},
"status": {
"healthy": "Saudável",
diff --git a/client/src/i18n/locales/ro.json b/client/src/i18n/locales/ro.json
index 5c3d70cc..cf71fa9c 100644
--- a/client/src/i18n/locales/ro.json
+++ b/client/src/i18n/locales/ro.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Niciun domeniu setat — această cheie servește toate modelele furnizorului ei.",
"modelScopeClear": "Șterge domeniul",
"modelScopeBadgeOne": "limitată · 1 model",
- "modelScopeBadgeOther": "limitată · {count} modele"
+ "modelScopeBadgeOther": "limitată · {count} modele",
+ "cpTitle": "Profiluri de client",
+ "cpDesc": "Chei API per client, fiecare cu un prompt de sistem pe care serverul îl aplică întotdeauna.",
+ "cpEmpty": "Încă nu există profiluri de client.",
+ "cpNameLabel": "Nume",
+ "cpNamePlaceholder": "ex. Bot de asistență",
+ "cpPromptLabel": "Prompt de sistem (opțional)",
+ "cpPromptPlaceholder": "Instrucțiuni pe care serverul le adaugă înaintea fiecărei cereri făcute cu această cheie.",
+ "cpCreate": "Creează profil",
+ "cpRotate": "Rotește cheia",
+ "cpKeyOnce": "Copiază această cheie acum — nu va mai fi afișată.",
+ "cpEnabledAria": "Profil activat"
},
"status": {
"healthy": "Sănătos",
diff --git a/client/src/i18n/locales/ru.json b/client/src/i18n/locales/ru.json
index c203da56..e13b40f3 100644
--- a/client/src/i18n/locales/ru.json
+++ b/client/src/i18n/locales/ru.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Область не задана — ключ обслуживает все модели своего провайдера.",
"modelScopeClear": "Очистить область",
"modelScopeBadgeOne": "ограничен · 1 модель",
- "modelScopeBadgeOther": "ограничен · {count} моделей"
+ "modelScopeBadgeOther": "ограничен · {count} моделей",
+ "cpTitle": "Профили клиентов",
+ "cpDesc": "Отдельные API-ключи для каждого клиента, каждый со своим системным промптом, который сервер применяет всегда.",
+ "cpEmpty": "Профилей клиентов пока нет.",
+ "cpNameLabel": "Название",
+ "cpNamePlaceholder": "напр., Бот поддержки",
+ "cpPromptLabel": "Системный промпт (необязательно)",
+ "cpPromptPlaceholder": "Инструкции, которые сервер добавляет перед каждым запросом с этим ключом.",
+ "cpCreate": "Создать профиль",
+ "cpRotate": "Сменить ключ",
+ "cpKeyOnce": "Скопируйте этот ключ сейчас — он больше не будет показан.",
+ "cpEnabledAria": "Профиль включён"
},
"status": {
"healthy": "здоровый",
diff --git a/client/src/i18n/locales/si.json b/client/src/i18n/locales/si.json
index 6d583d06..c64b0471 100644
--- a/client/src/i18n/locales/si.json
+++ b/client/src/i18n/locales/si.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "පරාසයක් සකසා නැත — මෙම යතුර එහි සැපයුම්කරුගේ සියලුම මොඩල සඳහා ක්‍රියා කරයි.",
"modelScopeClear": "පරාසය හිස් කරන්න",
"modelScopeBadgeOne": "සීමිත · මොඩල 1",
- "modelScopeBadgeOther": "සීමිත · මොඩල {count}"
+ "modelScopeBadgeOther": "සීමිත · මොඩල {count}",
+ "cpTitle": "සේවාලාභී පැතිකඩ",
+ "cpDesc": "එක් එක් සේවාලාභියාට වෙනම API යතුරක්; එහි පද්ධති විධානය සේවාදායකය සැමවිටම යොදයි.",
+ "cpEmpty": "තවම සේවාලාභී පැතිකඩ නොමැත.",
+ "cpNameLabel": "නම",
+ "cpNamePlaceholder": "උදා: සහාය බොට්",
+ "cpPromptLabel": "පද්ධති විධානය (විකල්ප)",
+ "cpPromptPlaceholder": "මෙම යතුරෙන් කරන සෑම ඉල්ලීමකටම පෙර සේවාදායකය එක් කරන උපදෙස්.",
+ "cpCreate": "පැතිකඩ සාදන්න",
+ "cpRotate": "යතුර මාරු කරන්න",
+ "cpKeyOnce": "මෙම යතුර දැන්ම පිටපත් කරන්න — එය නැවත නොපෙන්වයි.",
+ "cpEnabledAria": "පැතිකඩ සක්‍රීයයි"
},
"status": {
"healthy": "සෞඛ්ය සම්පන්න",
diff --git a/client/src/i18n/locales/sk.json b/client/src/i18n/locales/sk.json
index c6718229..4984d2db 100644
--- a/client/src/i18n/locales/sk.json
+++ b/client/src/i18n/locales/sk.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Rozsah nie je nastavený — tento kľúč obsluhuje všetky modely svojho poskytovateľa.",
"modelScopeClear": "Vymazať rozsah",
"modelScopeBadgeOne": "obmedzený · 1 model",
- "modelScopeBadgeOther": "obmedzený · {count} modelov"
+ "modelScopeBadgeOther": "obmedzený · {count} modelov",
+ "cpTitle": "Profily klientov",
+ "cpDesc": "Samostatné API kľúče pre každého klienta, každý so systémovým promptom, ktorý server vždy použije.",
+ "cpEmpty": "Zatiaľ žiadne profily klientov.",
+ "cpNameLabel": "Názov",
+ "cpNamePlaceholder": "napr. Bot podpory",
+ "cpPromptLabel": "Systémový prompt (voliteľné)",
+ "cpPromptPlaceholder": "Pokyny, ktoré server pridá pred každú požiadavku vykonanú týmto kľúčom.",
+ "cpCreate": "Vytvoriť profil",
+ "cpRotate": "Obmeniť kľúč",
+ "cpKeyOnce": "Skopírujte tento kľúč hneď — už sa znova nezobrazí.",
+ "cpEnabledAria": "Profil povolený"
},
"status": {
"healthy": "zdravé",
diff --git a/client/src/i18n/locales/sr.json b/client/src/i18n/locales/sr.json
index a226f382..aa9d5a39 100644
--- a/client/src/i18n/locales/sr.json
+++ b/client/src/i18n/locales/sr.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Опсег није постављен — овај кључ служи све моделе свог провајдера.",
"modelScopeClear": "Очисти опсег",
"modelScopeBadgeOne": "ограничен · 1 модел",
- "modelScopeBadgeOther": "ограничен · {count} модела"
+ "modelScopeBadgeOther": "ограничен · {count} модела",
+ "cpTitle": "Профили клијената",
+ "cpDesc": "API кључеви по клијенту, сваки са системским промптом који сервер увек примењује.",
+ "cpEmpty": "Још нема профила клијената.",
+ "cpNameLabel": "Назив",
+ "cpNamePlaceholder": "нпр. Бот за подршку",
+ "cpPromptLabel": "Системски промпт (опционо)",
+ "cpPromptPlaceholder": "Упутства која сервер додаје пре сваког захтева овим кључем.",
+ "cpCreate": "Направи профил",
+ "cpRotate": "Ротирај кључ",
+ "cpKeyOnce": "Копирајте овај кључ одмах — неће бити поново приказан.",
+ "cpEnabledAria": "Профил омогућен"
},
"status": {
"healthy": "здраво",
diff --git a/client/src/i18n/locales/sv.json b/client/src/i18n/locales/sv.json
index 51b2293b..881e3ff7 100644
--- a/client/src/i18n/locales/sv.json
+++ b/client/src/i18n/locales/sv.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Inget omfång angivet — nyckeln betjänar alla modeller hos sin leverantör.",
"modelScopeClear": "Rensa omfång",
"modelScopeBadgeOne": "begränsad · 1 modell",
- "modelScopeBadgeOther": "begränsad · {count} modeller"
+ "modelScopeBadgeOther": "begränsad · {count} modeller",
+ "cpTitle": "Klientprofiler",
+ "cpDesc": "API-nycklar per klient, var och en med en systemprompt som servern alltid tillämpar.",
+ "cpEmpty": "Inga klientprofiler ännu.",
+ "cpNameLabel": "Namn",
+ "cpNamePlaceholder": "t.ex. Supportbot",
+ "cpPromptLabel": "Systemprompt (valfritt)",
+ "cpPromptPlaceholder": "Instruktioner som servern lägger till före varje förfrågan med den här nyckeln.",
+ "cpCreate": "Skapa profil",
+ "cpRotate": "Rotera nyckel",
+ "cpKeyOnce": "Kopiera nyckeln nu — den visas inte igen.",
+ "cpEnabledAria": "Profil aktiverad"
},
"status": {
"healthy": "Hälsosamt",
diff --git a/client/src/i18n/locales/sw.json b/client/src/i18n/locales/sw.json
index 5206d589..b285506e 100644
--- a/client/src/i18n/locales/sw.json
+++ b/client/src/i18n/locales/sw.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Hakuna wigo uliowekwa — ufunguo huu unahudumia modeli zote za mtoa huduma wake.",
"modelScopeClear": "Futa wigo",
"modelScopeBadgeOne": "imezuiliwa · modeli 1",
- "modelScopeBadgeOther": "imezuiliwa · modeli {count}"
+ "modelScopeBadgeOther": "imezuiliwa · modeli {count}",
+ "cpTitle": "Wasifu wa wateja",
+ "cpDesc": "Funguo za API kwa kila mteja, kila mmoja na maelekezo ya mfumo ambayo seva hutumia kila wakati.",
+ "cpEmpty": "Bado hakuna wasifu wa wateja.",
+ "cpNameLabel": "Jina",
+ "cpNamePlaceholder": "k.m. Boti ya usaidizi",
+ "cpPromptLabel": "Maelekezo ya mfumo (hiari)",
+ "cpPromptPlaceholder": "Maelekezo ambayo seva huweka mwanzoni mwa kila ombi linalofanywa kwa ufunguo huu.",
+ "cpCreate": "Unda wasifu",
+ "cpRotate": "Badilisha ufunguo",
+ "cpKeyOnce": "Nakili ufunguo huu sasa — hautaonyeshwa tena.",
+ "cpEnabledAria": "Wasifu umewashwa"
},
"status": {
"healthy": "afya",
diff --git a/client/src/i18n/locales/ta.json b/client/src/i18n/locales/ta.json
index 5cfea5b0..9860520d 100644
--- a/client/src/i18n/locales/ta.json
+++ b/client/src/i18n/locales/ta.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "வரம்பு அமைக்கப்படவில்லை — இந்த சாவி அதன் வழங்குநரின் அனைத்து மாடல்களுக்கும் செயல்படும்.",
"modelScopeClear": "வரம்பை நீக்கு",
"modelScopeBadgeOne": "வரம்பிடப்பட்டது · 1 மாடல்",
- "modelScopeBadgeOther": "வரம்பிடப்பட்டது · {count} மாடல்கள்"
+ "modelScopeBadgeOther": "வரம்பிடப்பட்டது · {count} மாடல்கள்",
+ "cpTitle": "கிளையண்ட் சுயவிவரங்கள்",
+ "cpDesc": "ஒவ்வொரு கிளையண்டுக்கும் தனி API சாவி; அதன் சிஸ்டம் ப்ராம்ப்டை சேவையகம் எப்போதும் பயன்படுத்தும்.",
+ "cpEmpty": "இன்னும் கிளையண்ட் சுயவிவரங்கள் இல்லை.",
+ "cpNameLabel": "பெயர்",
+ "cpNamePlaceholder": "எ.கா. ஆதரவு போட்",
+ "cpPromptLabel": "சிஸ்டம் ப்ராம்ப்ட் (விருப்பத்திற்குரியது)",
+ "cpPromptPlaceholder": "இந்தச் சாவியால் செய்யப்படும் ஒவ்வொரு கோரிக்கைக்கும் முன் சேவையகம் சேர்க்கும் வழிமுறைகள்.",
+ "cpCreate": "சுயவிவரத்தை உருவாக்கு",
+ "cpRotate": "சாவியை மாற்று",
+ "cpKeyOnce": "இந்தச் சாவியை இப்போதே நகலெடுக்கவும் — இது மீண்டும் காட்டப்படாது.",
+ "cpEnabledAria": "சுயவிவரம் இயக்கத்தில்"
},
"status": {
"healthy": "ஆரோக்கியமான",
diff --git a/client/src/i18n/locales/te.json b/client/src/i18n/locales/te.json
index 8294b7b8..b32af206 100644
--- a/client/src/i18n/locales/te.json
+++ b/client/src/i18n/locales/te.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "పరిధి సెట్ కాలేదు — ఈ కీ దాని ప్రొవైడర్ యొక్క అన్ని మోడళ్లకు పనిచేస్తుంది.",
"modelScopeClear": "పరిధిని తొలగించండి",
"modelScopeBadgeOne": "పరిమితం · 1 మోడల్",
- "modelScopeBadgeOther": "పరిమితం · {count} మోడళ్లు"
+ "modelScopeBadgeOther": "పరిమితం · {count} మోడళ్లు",
+ "cpTitle": "క్లయింట్ ప్రొఫైల్స్",
+ "cpDesc": "ప్రతి క్లయింట్‌కు వేరు API కీ, దాని సిస్టమ్ ప్రాంప్ట్‌ను సర్వర్ ఎల్లప్పుడూ వర్తింపజేస్తుంది.",
+ "cpEmpty": "ఇంకా క్లయింట్ ప్రొఫైల్స్ లేవు.",
+ "cpNameLabel": "పేరు",
+ "cpNamePlaceholder": "ఉదా. సపోర్ట్ బాట్",
+ "cpPromptLabel": "సిస్టమ్ ప్రాంప్ట్ (ఐచ్ఛికం)",
+ "cpPromptPlaceholder": "ఈ కీతో చేసే ప్రతి అభ్యర్థనకు ముందు సర్వర్ జోడించే సూచనలు.",
+ "cpCreate": "ప్రొఫైల్ సృష్టించండి",
+ "cpRotate": "కీ మార్చండి",
+ "cpKeyOnce": "ఈ కీని ఇప్పుడే కాపీ చేయండి — ఇది మళ్లీ చూపబడదు.",
+ "cpEnabledAria": "ప్రొఫైల్ ప్రారంభించబడింది"
},
"status": {
"healthy": "ఆరోగ్యకరమైన",
diff --git a/client/src/i18n/locales/th.json b/client/src/i18n/locales/th.json
index 84212b74..fee41ba0 100644
--- a/client/src/i18n/locales/th.json
+++ b/client/src/i18n/locales/th.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "ยังไม่ได้ตั้งขอบเขต — คีย์นี้ใช้ได้กับทุกโมเดลของผู้ให้บริการ",
"modelScopeClear": "ล้างขอบเขต",
"modelScopeBadgeOne": "จำกัด · 1 โมเดล",
- "modelScopeBadgeOther": "จำกัด · {count} โมเดล"
+ "modelScopeBadgeOther": "จำกัด · {count} โมเดล",
+ "cpTitle": "โปรไฟล์ไคลเอนต์",
+ "cpDesc": "คีย์ API แยกตามไคลเอนต์ แต่ละคีย์มี system prompt ที่เซิร์ฟเวอร์ใช้เสมอ",
+ "cpEmpty": "ยังไม่มีโปรไฟล์ไคลเอนต์",
+ "cpNameLabel": "ชื่อ",
+ "cpNamePlaceholder": "เช่น บอตฝ่ายสนับสนุน",
+ "cpPromptLabel": "System prompt (ไม่บังคับ)",
+ "cpPromptPlaceholder": "คำสั่งที่เซิร์ฟเวอร์เพิ่มไว้หน้าทุกคำขอที่ใช้คีย์นี้",
+ "cpCreate": "สร้างโปรไฟล์",
+ "cpRotate": "หมุนเวียนคีย์",
+ "cpKeyOnce": "คัดลอกคีย์นี้ตอนนี้ — จะไม่แสดงอีก",
+ "cpEnabledAria": "เปิดใช้งานโปรไฟล์"
},
"status": {
"healthy": "มีสุขภาพดี",
diff --git a/client/src/i18n/locales/tl.json b/client/src/i18n/locales/tl.json
index e70f8a47..6a6ddbf0 100644
--- a/client/src/i18n/locales/tl.json
+++ b/client/src/i18n/locales/tl.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Walang nakatakdang saklaw — ginagamit ang key na ito para sa lahat ng modelo ng provider nito.",
"modelScopeClear": "Burahin ang saklaw",
"modelScopeBadgeOne": "limitado · 1 modelo",
- "modelScopeBadgeOther": "limitado · {count} na modelo"
+ "modelScopeBadgeOther": "limitado · {count} na modelo",
+ "cpTitle": "Mga profile ng client",
+ "cpDesc": "Hiwalay na API key para sa bawat client, bawat isa may system prompt na palaging inilalapat ng server.",
+ "cpEmpty": "Wala pang mga profile ng client.",
+ "cpNameLabel": "Pangalan",
+ "cpNamePlaceholder": "hal. Support bot",
+ "cpPromptLabel": "System prompt (opsyonal)",
+ "cpPromptPlaceholder": "Mga tagubiling idinaragdag ng server bago ang bawat kahilingang ginawa gamit ang key na ito.",
+ "cpCreate": "Gumawa ng profile",
+ "cpRotate": "I-rotate ang key",
+ "cpKeyOnce": "Kopyahin ang key na ito ngayon — hindi na ito ipapakita muli.",
+ "cpEnabledAria": "Naka-enable ang profile"
},
"status": {
"healthy": "malusog",
diff --git a/client/src/i18n/locales/tr.json b/client/src/i18n/locales/tr.json
index fe86a6a7..43355e80 100644
--- a/client/src/i18n/locales/tr.json
+++ b/client/src/i18n/locales/tr.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Kapsam ayarlanmadı — bu anahtar sağlayıcısının tüm modellerine hizmet eder.",
"modelScopeClear": "Kapsamı temizle",
"modelScopeBadgeOne": "sınırlı · 1 model",
- "modelScopeBadgeOther": "sınırlı · {count} model"
+ "modelScopeBadgeOther": "sınırlı · {count} model",
+ "cpTitle": "İstemci profilleri",
+ "cpDesc": "İstemci başına API anahtarları; her birinin sistem istemini sunucu her zaman uygular.",
+ "cpEmpty": "Henüz istemci profili yok.",
+ "cpNameLabel": "Ad",
+ "cpNamePlaceholder": "örn. Destek botu",
+ "cpPromptLabel": "Sistem istemi (isteğe bağlı)",
+ "cpPromptPlaceholder": "Sunucunun bu anahtarla yapılan her isteğin başına eklediği talimatlar.",
+ "cpCreate": "Profil oluştur",
+ "cpRotate": "Anahtarı yenile",
+ "cpKeyOnce": "Bu anahtarı şimdi kopyalayın — bir daha gösterilmeyecek.",
+ "cpEnabledAria": "Profil etkin"
},
"status": {
"healthy": "sağlıklı",
diff --git a/client/src/i18n/locales/uk.json b/client/src/i18n/locales/uk.json
index b039d4b2..f92d31bb 100644
--- a/client/src/i18n/locales/uk.json
+++ b/client/src/i18n/locales/uk.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Область не задана — ключ обслуговує всі моделі свого провайдера.",
"modelScopeClear": "Очистити область",
"modelScopeBadgeOne": "обмежено · 1 модель",
- "modelScopeBadgeOther": "обмежено · {count} моделей"
+ "modelScopeBadgeOther": "обмежено · {count} моделей",
+ "cpTitle": "Профілі клієнтів",
+ "cpDesc": "Окремі API-ключі для кожного клієнта, кожен зі своїм системним промптом, який сервер застосовує завжди.",
+ "cpEmpty": "Профілів клієнтів поки немає.",
+ "cpNameLabel": "Назва",
+ "cpNamePlaceholder": "напр., Бот підтримки",
+ "cpPromptLabel": "Системний промпт (необов'язково)",
+ "cpPromptPlaceholder": "Інструкції, які сервер додає перед кожним запитом із цим ключем.",
+ "cpCreate": "Створити профіль",
+ "cpRotate": "Змінити ключ",
+ "cpKeyOnce": "Скопіюйте цей ключ зараз — він більше не показуватиметься.",
+ "cpEnabledAria": "Профіль увімкнено"
},
"status": {
"healthy": "здоровий",
diff --git a/client/src/i18n/locales/ur.json b/client/src/i18n/locales/ur.json
index a9d3bc29..02de3247 100644
--- a/client/src/i18n/locales/ur.json
+++ b/client/src/i18n/locales/ur.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "کوئی دائرہ مقرر نہیں — یہ کلید اپنے فراہم کنندہ کے تمام ماڈلز کے لیے کام کرتی ہے۔",
"modelScopeClear": "دائرہ صاف کریں",
"modelScopeBadgeOne": "محدود · 1 ماڈل",
- "modelScopeBadgeOther": "محدود · {count} ماڈلز"
+ "modelScopeBadgeOther": "محدود · {count} ماڈلز",
+ "cpTitle": "کلائنٹ پروفائلز",
+ "cpDesc": "ہر کلائنٹ کے لیے الگ API کلید، جس کا سسٹم پرامپٹ سرور ہمیشہ لاگو کرتا ہے۔",
+ "cpEmpty": "ابھی کوئی کلائنٹ پروفائل نہیں۔",
+ "cpNameLabel": "نام",
+ "cpNamePlaceholder": "مثلاً سپورٹ بوٹ",
+ "cpPromptLabel": "سسٹم پرامپٹ (اختیاری)",
+ "cpPromptPlaceholder": "ہدایات جو سرور اس کلید سے کی گئی ہر درخواست سے پہلے شامل کرتا ہے۔",
+ "cpCreate": "پروفائل بنائیں",
+ "cpRotate": "کلید تبدیل کریں",
+ "cpKeyOnce": "یہ کلید ابھی کاپی کریں — یہ دوبارہ نہیں دکھائی جائے گی۔",
+ "cpEnabledAria": "پروفائل فعال"
},
"status": {
"healthy": "صحت مند",
diff --git a/client/src/i18n/locales/uz.json b/client/src/i18n/locales/uz.json
index 781de425..31af2dc7 100644
--- a/client/src/i18n/locales/uz.json
+++ b/client/src/i18n/locales/uz.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Doira belgilanmagan — bu kalit o‘z provayderining barcha modellariga xizmat qiladi.",
"modelScopeClear": "Doirani tozalash",
"modelScopeBadgeOne": "cheklangan · 1 model",
- "modelScopeBadgeOther": "cheklangan · {count} model"
+ "modelScopeBadgeOther": "cheklangan · {count} model",
+ "cpTitle": "Mijoz profillari",
+ "cpDesc": "Har bir mijoz uchun alohida API kaliti; uning tizim promptini server doim qo'llaydi.",
+ "cpEmpty": "Hozircha mijoz profillari yo'q.",
+ "cpNameLabel": "Nomi",
+ "cpNamePlaceholder": "masalan: Qo'llab-quvvatlash boti",
+ "cpPromptLabel": "Tizim prompti (ixtiyoriy)",
+ "cpPromptPlaceholder": "Server ushbu kalit bilan qilingan har bir so'rov oldiga qo'shadigan ko'rsatmalar.",
+ "cpCreate": "Profil yaratish",
+ "cpRotate": "Kalitni almashtirish",
+ "cpKeyOnce": "Bu kalitni hozir nusxalang — u boshqa ko'rsatilmaydi.",
+ "cpEnabledAria": "Profil yoqilgan"
},
"status": {
"healthy": "sog'lom",
diff --git a/client/src/i18n/locales/vi.json b/client/src/i18n/locales/vi.json
index a22e6f37..ae89b28d 100644
--- a/client/src/i18n/locales/vi.json
+++ b/client/src/i18n/locales/vi.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Chưa đặt phạm vi — khóa này phục vụ mọi mô hình của nhà cung cấp.",
"modelScopeClear": "Xóa phạm vi",
"modelScopeBadgeOne": "giới hạn · 1 mô hình",
- "modelScopeBadgeOther": "giới hạn · {count} mô hình"
+ "modelScopeBadgeOther": "giới hạn · {count} mô hình",
+ "cpTitle": "Hồ sơ client",
+ "cpDesc": "Khóa API riêng cho từng client, mỗi khóa có một system prompt mà máy chủ luôn áp dụng.",
+ "cpEmpty": "Chưa có hồ sơ client nào.",
+ "cpNameLabel": "Tên",
+ "cpNamePlaceholder": "vd: Bot hỗ trợ",
+ "cpPromptLabel": "System prompt (tùy chọn)",
+ "cpPromptPlaceholder": "Các chỉ dẫn máy chủ chèn vào đầu mọi yêu cầu dùng khóa này.",
+ "cpCreate": "Tạo hồ sơ",
+ "cpRotate": "Xoay khóa",
+ "cpKeyOnce": "Sao chép khóa này ngay — nó sẽ không được hiển thị lại.",
+ "cpEnabledAria": "Hồ sơ đang bật"
},
"status": {
"healthy": "khỏe mạnh",
diff --git a/client/src/i18n/locales/yo.json b/client/src/i18n/locales/yo.json
index b79c0070..1f90d718 100644
--- a/client/src/i18n/locales/yo.json
+++ b/client/src/i18n/locales/yo.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "Kò sí àgbègbè tí a ṣètò — bọtìnì yìí ń ṣiṣẹ́ fún gbogbo awoṣe olùpèsè rẹ̀.",
"modelScopeClear": "Pa àgbègbè rẹ́",
"modelScopeBadgeOne": "ní ààlà · awoṣe 1",
- "modelScopeBadgeOther": "ní ààlà · awoṣe {count}"
+ "modelScopeBadgeOther": "ní ààlà · awoṣe {count}",
+ "cpTitle": "Àwọn pírófáìlì oníbàárà",
+ "cpDesc": "Àwọn kọ́kọ́rọ́ API fún oníbàárà kọ̀ọ̀kan, ọ̀kọ̀ọ̀kan pẹ̀lú ìtọ́ni ètò tí sáfà máa ń lò nígbà gbogbo.",
+ "cpEmpty": "Kò sí pírófáìlì oníbàárà síbẹ̀.",
+ "cpNameLabel": "Orúkọ",
+ "cpNamePlaceholder": "b.a. Bọ́ọ̀tì àtìlẹ́yìn",
+ "cpPromptLabel": "Ìtọ́ni ètò (àṣàyàn)",
+ "cpPromptPlaceholder": "Àwọn ìtọ́ni tí sáfà máa ń fi kún iwájú gbogbo ìbéèrè tí a fi kọ́kọ́rọ́ yìí ṣe.",
+ "cpCreate": "Ṣẹ̀dá pírófáìlì",
+ "cpRotate": "Yí kọ́kọ́rọ́ padà",
+ "cpKeyOnce": "Ṣàdàkọ kọ́kọ́rọ́ yìí báyìí — a kò ní fi hàn mọ́.",
+ "cpEnabledAria": "Pírófáìlì ti ṣiṣẹ́"
},
"status": {
"healthy": "ni ilera",
diff --git a/client/src/i18n/locales/zh-CN.json b/client/src/i18n/locales/zh-CN.json
index a94ba031..003142bb 100644
--- a/client/src/i18n/locales/zh-CN.json
+++ b/client/src/i18n/locales/zh-CN.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "未设置范围——此密钥可服务该提供商的所有模型。",
"modelScopeClear": "清除范围",
"modelScopeBadgeOne": "限定 · 1 个模型",
- "modelScopeBadgeOther": "限定 · {count} 个模型"
+ "modelScopeBadgeOther": "限定 · {count} 个模型",
+ "cpTitle": "客户端配置文件",
+ "cpDesc": "为每个客户端单独发放 API 密钥,服务器会始终应用其系统提示词。",
+ "cpEmpty": "还没有客户端配置文件。",
+ "cpNameLabel": "名称",
+ "cpNamePlaceholder": "例如:客服机器人",
+ "cpPromptLabel": "系统提示词(可选)",
+ "cpPromptPlaceholder": "服务器会将这些指令加在使用此密钥的每个请求之前。",
+ "cpCreate": "创建配置文件",
+ "cpRotate": "轮换密钥",
+ "cpKeyOnce": "请立即复制此密钥——之后将不再显示。",
+ "cpEnabledAria": "配置文件已启用"
},
"status": {
"healthy": "健康",
diff --git a/client/src/i18n/locales/zh-TW.json b/client/src/i18n/locales/zh-TW.json
index 7687dea0..2a8259f4 100644
--- a/client/src/i18n/locales/zh-TW.json
+++ b/client/src/i18n/locales/zh-TW.json
@@ -490,7 +490,18 @@
"modelScopeEmpty": "未設定範圍——此金鑰可服務該供應商的所有模型。",
"modelScopeClear": "清除範圍",
"modelScopeBadgeOne": "限定 · 1 個模型",
- "modelScopeBadgeOther": "限定 · {count} 個模型"
+ "modelScopeBadgeOther": "限定 · {count} 個模型",
+ "cpTitle": "用戶端設定檔",
+ "cpDesc": "為每個用戶端各自發放 API 金鑰,伺服器會一律套用其系統提示詞。",
+ "cpEmpty": "尚無用戶端設定檔。",
+ "cpNameLabel": "名稱",
+ "cpNamePlaceholder": "例如:客服機器人",
+ "cpPromptLabel": "系統提示詞(選填)",
+ "cpPromptPlaceholder": "伺服器會將這些指令加在使用此金鑰的每個請求之前。",
+ "cpCreate": "建立設定檔",
+ "cpRotate": "輪換金鑰",
+ "cpKeyOnce": "請立即複製此金鑰——之後將不會再顯示。",
+ "cpEnabledAria": "設定檔已啟用"
},
"status": {
"healthy": "健康",
diff --git a/client/src/pages/KeysPage.tsx b/client/src/pages/KeysPage.tsx
index 12f2879e..a8c88659 100644
--- a/client/src/pages/KeysPage.tsx
+++ b/client/src/pages/KeysPage.tsx
@@ -10,6 +10,7 @@ import { useI18n } from '@/i18n'
import type { HealthData } from '@/components/keys/shared'
import { QuotaSignalsSection } from '@/components/keys/quota-signals-section'
import { UnifiedKeySection } from '@/components/keys/unified-key-section'
+import { ClientProfilesSection } from '@/components/keys/client-profiles-section'
import { ProxySettingsSection } from '@/components/keys/proxy-settings-section'
import { AnthropicSection } from '@/components/keys/anthropic-section'
import { ProviderList } from '@/components/keys/provider-list'
@@ -101,6 +102,7 @@ export default function KeysPage() {
{tab === 'apiKey' && (
<>
<UnifiedKeySection />
+ <ClientProfilesSection />
<ProxySettingsSection />
</>
)}
diff --git a/server/src/__tests__/db/migrate/roundtrip.test.ts b/server/src/__tests__/db/migrate/roundtrip.test.ts
index 2848d8b5..b9b84c38 100644
--- a/server/src/__tests__/db/migrate/roundtrip.test.ts
+++ b/server/src/__tests__/db/migrate/roundtrip.test.ts
@@ -24,6 +24,7 @@ const TOMBSTONE_PROVENANCE_FILENAME = '20260728_000001_tombstone_provenance.ts';
const CUSTOM_MODEL_ENDPOINT_IDENTITY_FILENAME = '20260729_000001_custom_model_endpoint_identity.ts';
const CUSTOM_ENDPOINT_HOST_LABELS_FILENAME = '20260802_000001_custom_endpoint_host_labels.ts';
const KEY_MODEL_SCOPE_FILENAME = '20260805_000001_key_model_scope.ts';
+const CLIENT_PROFILES_FILENAME = '20260805_000002_client_profiles.ts';
interface SchemaRow {
type: string;
@@ -94,6 +95,7 @@ describe('migration round trip', () => {
CUSTOM_MODEL_ENDPOINT_IDENTITY_FILENAME,
CUSTOM_ENDPOINT_HOST_LABELS_FILENAME,
KEY_MODEL_SCOPE_FILENAME,
+ CLIENT_PROFILES_FILENAME,
]);
} finally {
db.close();
diff --git a/server/src/__tests__/lib/system-prompt.test.ts b/server/src/__tests__/lib/system-prompt.test.ts
new file mode 100644
index 00000000..465d40ae
--- /dev/null
+++ b/server/src/__tests__/lib/system-prompt.test.ts
@@ -0,0 +1,92 @@
+import { describe, it, expect, beforeAll } from 'vitest';
+import type { ChatMessage } from '@freellmapi/shared/types.js';
+import { initDb, getDb, getUnifiedApiKey } from '../../db/index.js';
+import { encrypt } from '../../lib/crypto.js';
+import {
+ resolveAuth,
+ prependSystemPrompt,
+ mintClientProfileKey,
+ hashClientProfileKey,
+ CLIENT_PROFILE_KEY_PREFIX,
+} from '../../lib/system-prompt.js';
+
+// resolveAuth precedence (#411): unified key → default behavior (no enforced
+// prompt); profile key → its own prompt; empty prompt → neutral passthrough;
+// disabled profile → rejected exactly like an unknown key.
+
+function insertProfile(name: string, systemPrompt: string | null, enabled = 1): string {
+ const key = mintClientProfileKey();
+ const { encrypted, iv, authTag } = encrypt(key);
+ getDb().prepare(`
+ INSERT INTO client_profiles (name, token_hash, encrypted_key, iv, auth_tag, system_prompt, enabled)
+ VALUES (?, ?, ?, ?, ?, ?, ?)
+ `).run(name, hashClientProfileKey(key), encrypted, iv, authTag, systemPrompt, enabled);
+ return key;
+}
+
+describe('resolveAuth (#411)', () => {
+ beforeAll(() => {
+ process.env.ENCRYPTION_KEY = '0'.repeat(64);
+ initDb(':memory:');
+ });
+
+ it('resolves the unified key to the default behavior (no enforced prompt)', () => {
+ const auth = resolveAuth(getUnifiedApiKey());
+ expect(auth).toEqual({ kind: 'unified', systemPrompt: null });
+ });
+
+ it('resolves a profile key to its own prompt', () => {
+ const key = insertProfile('support-bot', 'You are the support bot.');
+ expect(key.startsWith(CLIENT_PROFILE_KEY_PREFIX)).toBe(true);
+ const auth = resolveAuth(key);
+ expect(auth?.kind).toBe('profile');
+ expect(auth?.systemPrompt).toBe('You are the support bot.');
+ if (auth?.kind === 'profile') expect(auth.name).toBe('support-bot');
+ });
+
+ it('treats a null or blank profile prompt as no prompt', () => {
+ expect(resolveAuth(insertProfile('no-prompt', null))?.systemPrompt).toBeNull();
+ expect(resolveAuth(insertProfile('blank-prompt', ' '))?.systemPrompt).toBeNull();
+ });
+
+ it('rejects a disabled profile like a bad key', () => {
+ const key = insertProfile('disabled-bot', 'irrelevant', 0);
+ expect(resolveAuth(key)).toBeNull();
+ });
+
+ it('rejects unknown and missing tokens', () => {
+ expect(resolveAuth(undefined)).toBeNull();
+ expect(resolveAuth('')).toBeNull();
+ expect(resolveAuth('not-a-key')).toBeNull();
+ expect(resolveAuth(`${CLIENT_PROFILE_KEY_PREFIX}${'0'.repeat(48)}`)).toBeNull();
+ });
+});
+
+describe('prependSystemPrompt (#411)', () => {
+ const caller: ChatMessage[] = [
+ { role: 'system', content: 'caller instructions' },
+ { role: 'user', content: 'hi' },
+ ];
+
+ it('puts the enforced prompt first and keeps the caller system message after it', () => {
+ const out = prependSystemPrompt(caller, 'ENFORCED');
+ expect(out.map(m => [m.role, m.content])).toEqual([
+ ['system', 'ENFORCED'],
+ ['system', 'caller instructions'],
+ ['user', 'hi'],
+ ]);
+ });
+
+ it('is a neutral passthrough for null/empty/blank prompts', () => {
+ expect(prependSystemPrompt(caller, null)).toBe(caller);
+ expect(prependSystemPrompt(caller, undefined)).toBe(caller);
+ expect(prependSystemPrompt(caller, '')).toBe(caller);
+ expect(prependSystemPrompt(caller, ' \n ')).toBe(caller);
+ });
+
+ it('does not mutate the input array', () => {
+ const before = [...caller];
+ prependSystemPrompt(caller, 'ENFORCED');
+ expect(caller).toEqual(before);
+ });
+});
diff --git a/server/src/__tests__/routes/client-profiles.test.ts b/server/src/__tests__/routes/client-profiles.test.ts
new file mode 100644
index 00000000..0a032853
--- /dev/null
+++ b/server/src/__tests__/routes/client-profiles.test.ts
@@ -0,0 +1,239 @@
+import { describe, it, expect, beforeAll, beforeEach, vi } from 'vitest';
+
+// Mock only routeRequest so the injection tests don't need real provider keys;
+// the rest of the router module stays intact (same approach as responses.test.ts).
+const { mockRouteRequest } = vi.hoisted(() => ({ mockRouteRequest: vi.fn() }));
+vi.mock('../../services/router.js', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('../../services/router.js')>();
+ return { ...actual, routeRequest: mockRouteRequest };
+});
+
+import type { Express } from 'express';
+import { createApp } from '../../app.js';
+import { initDb, getUnifiedApiKey } from '../../db/index.js';
+import { mintDashboardToken } from '../helpers/auth.js';
+
+let dashToken = '';
+
+async function request(
+ app: Express,
+ method: string,
+ path: string,
+ opts: { body?: unknown; token?: string } = {},
+) {
+ const server = app.listen(0);
+ const addr = server.address() as any;
+ const res = await fetch(`http://127.0.0.1:${addr.port}${path}`, {
+ method,
+ headers: {
+ ...(opts.body ? { 'Content-Type': 'application/json' } : {}),
+ ...(opts.token ? { Authorization: `Bearer ${opts.token}` } : {}),
+ },
+ body: opts.body ? JSON.stringify(opts.body) : undefined,
+ });
+ const body = await res.json().catch(() => null);
+ server.close();
+ return { status: res.status, body };
+}
+
+// Records the messages each dispatched request carried, so the injection tests
+// can assert the exact system-message ordering the provider would see.
+const seenMessages: any[][] = [];
+function fakeRoute() {
+ return {
+ provider: {
+ name: 'fake',
+ async chatCompletion(_apiKey: string, messages: any[]) {
+ seenMessages.push(messages);
+ return {
+ id: 'c', object: 'chat.completion', created: 0, model: 'fake-model',
+ choices: [{ index: 0, message: { role: 'assistant', content: 'ok' }, finish_reason: 'stop' }],
+ usage: { prompt_tokens: 3, completion_tokens: 1, total_tokens: 4 },
+ };
+ },
+ },
+ modelId: 'fake-model', modelDbId: 9999, apiKey: 'k', keyId: 1, platform: 'fake', displayName: 'Fake Model',
+ };
+}
+
+describe('client profiles (#411)', () => {
+ let app: Express;
+ let unifiedKey: string;
+
+ beforeAll(() => {
+ process.env.ENCRYPTION_KEY = '0'.repeat(64);
+ initDb(':memory:');
+ app = createApp();
+ unifiedKey = getUnifiedApiKey();
+ dashToken = mintDashboardToken('[email protected]');
+ });
+
+ beforeEach(() => {
+ mockRouteRequest.mockReset();
+ mockRouteRequest.mockImplementation(() => fakeRoute());
+ seenMessages.length = 0;
+ });
+
+ async function createProfile(name: string, systemPrompt?: string | null) {
+ const { status, body } = await request(app, 'POST', '/api/client-profiles', {
+ token: dashToken, body: { name, systemPrompt },
+ });
+ expect(status).toBe(201);
+ return body;
+ }
+
+ describe('CRUD', () => {
+ it('creates a profile and returns the sk-cp key exactly once', async () => {
+ const created = await createProfile('crud-bot', 'be helpful');
+ expect(created.key).toMatch(/^sk-cp-[0-9a-f]{48}$/);
+ expect(created.name).toBe('crud-bot');
+ expect(created.systemPrompt).toBe('be helpful');
+ expect(created.enabled).toBe(true);
+ // Masked display comes from the encrypted copy, never the hash.
+ expect(created.maskedKey).toBe(`${created.key.slice(0, 4)}...${created.key.slice(-4)}`);
+
+ const list = await request(app, 'GET', '/api/client-profiles', { token: dashToken });
+ expect(list.status).toBe(200);
+ const row = list.body.find((p: any) => p.id === created.id);
+ expect(row.maskedKey).toBe(created.maskedKey);
+ // The full key never appears in the list.
+ expect(JSON.stringify(list.body)).not.toContain(created.key);
+ });
+
+ it('rejects a create without a name', async () => {
+ const { status } = await request(app, 'POST', '/api/client-profiles', {
+ token: dashToken, body: { systemPrompt: 'no name' },
+ });
+ expect(status).toBe(400);
+ });
+
+ it('edits name/prompt, clears the prompt with null, and toggles enabled', async () => {
+ const created = await createProfile('edit-bot', 'v1');
+ const renamed = await request(app, 'PATCH', `/api/client-profiles/${created.id}`, {
+ token: dashToken, body: { name: 'edit-bot-2', systemPrompt: 'v2' },
+ });
+ expect(renamed.status).toBe(200);
+ expect(renamed.body.name).toBe('edit-bot-2');
+ expect(renamed.body.systemPrompt).toBe('v2');
+
+ const cleared = await request(app, 'PATCH', `/api/client-profiles/${created.id}`, {
+ token: dashToken, body: { systemPrompt: null, enabled: false },
+ });
+ expect(cleared.body.systemPrompt).toBeNull();
+ expect(cleared.body.enabled).toBe(false);
+ // Fields absent from the patch stay untouched.
+ expect(cleared.body.name).toBe('edit-bot-2');
+ });
+
+ it('rotate invalidates the old key and returns the new one once', async () => {
+ const created = await createProfile('rotate-bot', 'stay on topic');
+ const rotated = await request(app, 'POST', `/api/client-profiles/${created.id}/rotate`, { token: dashToken });
+ expect(rotated.status).toBe(200);
+ expect(rotated.body.key).toMatch(/^sk-cp-[0-9a-f]{48}$/);
+ expect(rotated.body.key).not.toBe(created.key);
+
+ const oldKey = await request(app, 'POST', '/v1/chat/completions', {
+ token: created.key, body: { messages: [{ role: 'user', content: 'hi' }] },
+ });
+ expect(oldKey.status).toBe(401);
+ const newKey = await request(app, 'POST', '/v1/chat/completions', {
+ token: rotated.body.key, body: { messages: [{ role: 'user', content: 'hi' }] },
+ });
+ expect(newKey.status).toBe(200);
+ });
+
+ it('deletes a profile and 404s on unknown ids', async () => {
+ const created = await createProfile('delete-bot');
+ const del = await request(app, 'DELETE', `/api/client-profiles/${created.id}`, { token: dashToken });
+ expect(del.status).toBe(200);
+ expect((await request(app, 'DELETE', `/api/client-profiles/${created.id}`, { token: dashToken })).status).toBe(404);
+ const auth = await request(app, 'POST', '/v1/chat/completions', {
+ token: created.key, body: { messages: [{ role: 'user', content: 'hi' }] },
+ });
+ expect(auth.status).toBe(401);
+ });
+ });
+
+ describe('security boundary', () => {
+ it('a profile key does NOT authenticate the admin/dashboard API', async () => {
+ const created = await createProfile('boundary-bot', 'x');
+ for (const [method, path] of [
+ ['GET', '/api/client-profiles'],
+ ['GET', '/api/keys'],
+ ['GET', '/api/settings/api-key'],
+ ] as const) {
+ const { status } = await request(app, method, path, { token: created.key });
+ expect(status, `${method} ${path}`).toBe(401);
+ }
+ });
+
+ it('the unified key does not authenticate the admin API either (unchanged)', async () => {
+ expect((await request(app, 'GET', '/api/client-profiles', { token: unifiedKey })).status).toBe(401);
+ });
+
+ it('a disabled profile key is rejected on inference like a bad key', async () => {
+ const created = await createProfile('disabled-bot', 'x');
+ await request(app, 'PATCH', `/api/client-profiles/${created.id}`, {
+ token: dashToken, body: { enabled: false },
+ });
+ const { status } = await request(app, 'POST', '/v1/chat/completions', {
+ token: created.key, body: { messages: [{ role: 'user', content: 'hi' }] },
+ });
+ expect(status).toBe(401);
+ });
+ });
+
+ describe('server-side prompt injection', () => {
+ const callerBody = {
+ messages: [
+ { role: 'system', content: 'caller instructions' },
+ { role: 'user', content: 'hi' },
+ ],
+ };
+
+ it('prepends the profile prompt on /v1/chat/completions, enforced prompt first', async () => {
+ const created = await createProfile('inject-bot', 'ENFORCED PROMPT');
+ const { status } = await request(app, 'POST', '/v1/chat/completions', {
+ token: created.key, body: callerBody,
+ });
+ expect(status).toBe(200);
+ const sent = seenMessages[0];
+ // Ordering contract: the enforced prompt is FIRST; the caller-supplied
+ // system message survives, after it.
+ expect(sent[0]).toMatchObject({ role: 'system', content: 'ENFORCED PROMPT' });
+ expect(sent[1]).toMatchObject({ role: 'system', content: 'caller instructions' });
+ expect(sent[2]).toMatchObject({ role: 'user', content: 'hi' });
+ });
+
+ it('the unified key injects nothing (backward compatible)', async () => {
+ const { status } = await request(app, 'POST', '/v1/chat/completions', {
+ token: unifiedKey, body: callerBody,
+ });
+ expect(status).toBe(200);
+ expect(seenMessages[0][0]).toMatchObject({ role: 'system', content: 'caller instructions' });
+ expect(seenMessages[0]).toHaveLength(2);
+ });
+
+ it('a profile without a prompt is a neutral passthrough', async () => {
+ const created = await createProfile('plain-bot');
+ const { status } = await request(app, 'POST', '/v1/chat/completions', {
+ token: created.key, body: callerBody,
+ });
+ expect(status).toBe(200);
+ expect(seenMessages[0][0]).toMatchObject({ role: 'system', content: 'caller instructions' });
+ expect(seenMessages[0]).toHaveLength(2);
+ });
+
+ it('prepends the profile prompt on /v1/responses too', async () => {
+ const created = await createProfile('responses-bot', 'ENFORCED PROMPT');
+ const { status } = await request(app, 'POST', '/v1/responses', {
+ token: created.key,
+ body: { instructions: 'caller instructions', input: 'hi' },
+ });
+ expect(status).toBe(200);
+ const sent = seenMessages[0];
+ expect(sent[0]).toMatchObject({ role: 'system', content: 'ENFORCED PROMPT' });
+ expect(sent[1]).toMatchObject({ role: 'system', content: 'caller instructions' });
+ });
+ });
+});
diff --git a/server/src/app.ts b/server/src/app.ts
index 3b1f3bdd..a48fc0e8 100644
--- a/server/src/app.ts
+++ b/server/src/app.ts
@@ -5,6 +5,7 @@ import helmet from 'helmet';
import path from 'path';
import { fileURLToPath } from 'url';
import { keysRouter } from './routes/keys.js';
+import { clientProfilesRouter } from './routes/client-profiles.js';
import { modelsRouter } from './routes/models.js';
import { proxyRouter } from './routes/proxy.js';
import { responsesRouter } from './routes/responses.js';
@@ -210,6 +211,10 @@ export function createApp(config?: Config) {
app.use('/api/keys/export', createAdminRateLimiter(EXPORT_RATE_LIMIT_RPM));
app.use('/api/keys', requireAuth, keysRouter);
+ // Per-client key management (#411). Dashboard-session gated like the rest of
+ // /api — the profile keys it mints authenticate only the /v1 inference
+ // surface and are never valid here.
+ app.use('/api/client-profiles', requireAuth, clientProfilesRouter);
app.use('/api/models', requireAuth, modelsRouter);
app.use('/api/profiles', requireAuth, profilesRouter);
app.use('/api/fallback', requireAuth, fallbackRouter);
diff --git a/server/src/db/migrate/defaults.ts b/server/src/db/migrate/defaults.ts
index 8d5ccfcc..26812471 100644
--- a/server/src/db/migrate/defaults.ts
+++ b/server/src/db/migrate/defaults.ts
@@ -19,6 +19,7 @@ import * as tombstoneProvenance from '../migrations/20260728_000001_tombstone_pr
import * as customModelEndpointIdentity from '../migrations/20260729_000001_custom_model_endpoint_identity.js';
import * as customEndpointHostLabels from '../migrations/20260802_000001_custom_endpoint_host_labels.js';
import * as keyModelScope from '../migrations/20260805_000001_key_model_scope.js';
+import * as clientProfiles from '../migrations/20260805_000002_client_profiles.js';
export interface MigrationModule {
up(db: Db): void;
@@ -50,6 +51,7 @@ export const TOMBSTONE_PROVENANCE_FILENAME = '20260728_000001_tombstone_provenan
export const CUSTOM_MODEL_ENDPOINT_IDENTITY_FILENAME = '20260729_000001_custom_model_endpoint_identity.ts';
export const CUSTOM_ENDPOINT_HOST_LABELS_FILENAME = '20260802_000001_custom_endpoint_host_labels.ts';
export const KEY_MODEL_SCOPE_FILENAME = '20260805_000001_key_model_scope.ts';
+export const CLIENT_PROFILES_FILENAME = '20260805_000002_client_profiles.ts';
export const DEFAULT_MIGRATIONS: readonly DefaultMigration[] = [
{ filename: LEGACY_BASELINE_FILENAME, module: legacyBaseline },
@@ -72,4 +74,5 @@ export const DEFAULT_MIGRATIONS: readonly DefaultMigration[] = [
{ filename: CUSTOM_MODEL_ENDPOINT_IDENTITY_FILENAME, module: customModelEndpointIdentity },
{ filename: CUSTOM_ENDPOINT_HOST_LABELS_FILENAME, module: customEndpointHostLabels },
{ filename: KEY_MODEL_SCOPE_FILENAME, module: keyModelScope },
+ { filename: CLIENT_PROFILES_FILENAME, module: clientProfiles },
];
diff --git a/server/src/db/migrations/20260805_000002_client_profiles.ts b/server/src/db/migrations/20260805_000002_client_profiles.ts
new file mode 100644
index 00000000..699dd7bb
--- /dev/null
+++ b/server/src/db/migrations/20260805_000002_client_profiles.ts
@@ -0,0 +1,36 @@
+// Migration: per-client API keys with server-enforced system prompts (#411)
+// Created: 2026-08-05
+//
+// DOWN: reversible
+//
+// One row per downstream client/product. Auth lookups go through token_hash
+// (SHA-256 of the full `sk-cp-...` key) so the plaintext credential is never
+// queried; encrypted_key/iv/auth_tag hold an AES-256-GCM copy (same crypto
+// layer as api_keys — lib/crypto.ts) used only to render the masked key in
+// the dashboard. system_prompt is the prompt the proxy prepends server-side
+// for requests authenticated with this profile's key; NULL/empty means the
+// key authenticates without injecting anything. Disabled rows are rejected
+// at auth exactly like unknown keys.
+
+import type { Db } from '../types.js';
+
+export function up(db: Db): void {
+ db.exec(`
+ CREATE TABLE IF NOT EXISTS client_profiles (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ name TEXT NOT NULL,
+ token_hash TEXT NOT NULL UNIQUE,
+ encrypted_key TEXT NOT NULL,
+ iv TEXT NOT NULL,
+ auth_tag TEXT NOT NULL,
+ system_prompt TEXT,
+ enabled INTEGER NOT NULL DEFAULT 1,
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
+ updated_at TEXT NOT NULL DEFAULT (datetime('now'))
+ );
+ `);
+}
+
+export function down(db: Db): void {
+ db.exec('DROP TABLE IF EXISTS client_profiles;');
+}
diff --git a/server/src/lib/system-prompt.ts b/server/src/lib/system-prompt.ts
new file mode 100644
index 00000000..46697f8a
--- /dev/null
+++ b/server/src/lib/system-prompt.ts
@@ -0,0 +1,82 @@
+import crypto from 'crypto';
+import type { ChatMessage } from '@freellmapi/shared/types.js';
+import { getDb, getUnifiedApiKey } from '../db/index.js';
+
+// Per-client API keys with server-enforced system prompts (#411). A client
+// profile is a second kind of inference credential: it authenticates ONLY the
+// /v1 inference surface (proxy + responses), never the /api dashboard routes —
+// those require a dashboard session (middleware/requireAuth). The unified key
+// keeps today's behavior exactly: full inference access, no injected prompt.
+
+export const CLIENT_PROFILE_KEY_PREFIX = 'sk-cp-';
+
+// Constant-time string comparison for inference credentials. Plain `===` leaks
+// length and per-character timing, which a network attacker could in principle
+// use to recover the key one byte at a time.
+export function timingSafeStringEqual(provided: string, expected: string): boolean {
+ // Use HMAC to produce fixed-length digests so timingSafeEqual always
+ // receives same-length buffers regardless of input length. This eliminates
+ // both the per-character timing leak and the length-branch timing leak that
+ // the Buffer.alloc-on-mismatch approach had.
+ const key = Buffer.alloc(32);
+ const a = crypto.createHmac('sha256', key).update(provided).digest();
+ const b = crypto.createHmac('sha256', key).update(expected).digest();
+ return crypto.timingSafeEqual(a, b);
+}
+
+export function mintClientProfileKey(): string {
+ return `${CLIENT_PROFILE_KEY_PREFIX}${crypto.randomBytes(24).toString('hex')}`;
+}
+
+// Profile keys are stored and looked up by SHA-256 digest, so the DB never
+// holds the plaintext for auth purposes (the encrypted copy exists only for
+// masked display in the dashboard). The digest also makes the indexed lookup
+// timing-independent of the secret's bytes.
+export function hashClientProfileKey(key: string): string {
+ return crypto.createHash('sha256').update(key).digest('hex');
+}
+
+export type ResolvedAuth =
+ | { kind: 'unified'; systemPrompt: null }
+ | { kind: 'profile'; profileId: number; name: string; systemPrompt: string | null };
+
+interface ProfileRow {
+ id: number;
+ name: string;
+ system_prompt: string | null;
+ enabled: number;
+}
+
+/**
+ * Resolve an inference credential. The unified key maps to today's behavior
+ * (no enforced prompt); a client-profile key carries its own prompt; a
+ * disabled profile is rejected exactly like an unknown key so a revoked
+ * client can't distinguish "disabled" from "deleted".
+ */
+export function resolveAuth(token: string | undefined): ResolvedAuth | null {
+ if (!token) return null;
+ if (timingSafeStringEqual(token, getUnifiedApiKey())) {
+ return { kind: 'unified', systemPrompt: null };
+ }
+ if (!token.startsWith(CLIENT_PROFILE_KEY_PREFIX)) return null;
+ const row = getDb().prepare(
+ 'SELECT id, name, system_prompt, enabled FROM client_profiles WHERE token_hash = ?',
+ ).get(hashClientProfileKey(token)) as ProfileRow | undefined;
+ if (!row || !row.enabled) return null;
+ const prompt = row.system_prompt != null && row.system_prompt.trim().length > 0
+ ? row.system_prompt
+ : null;
+ return { kind: 'profile', profileId: row.id, name: row.name, systemPrompt: prompt };
+}
+
+/**
+ * Prepend the server-enforced system prompt. It goes FIRST, ahead of any
+ * caller-supplied system message, so the enforced instructions take priority
+ * while the caller's own system message is preserved after it — the caller
+ * can add context but cannot override or remove the profile's prompt.
+ * An empty/null prompt is a neutral passthrough: nothing is injected.
+ */
+export function prependSystemPrompt(messages: ChatMessage[], prompt: string | null | undefined): ChatMessage[] {
+ if (prompt == null || prompt.trim().length === 0) return messages;
+ return [{ role: 'system', content: prompt }, ...messages];
+}
diff --git a/server/src/routes/client-profiles.ts b/server/src/routes/client-profiles.ts
new file mode 100644
index 00000000..d34212d2
--- /dev/null
+++ b/server/src/routes/client-profiles.ts
@@ -0,0 +1,155 @@
+import { Router } from 'express';
+import type { Request, Response } from 'express';
+import { z } from 'zod';
+import { getDb } from '../db/index.js';
+import { encrypt, decrypt, maskKey } from '../lib/crypto.js';
+import { mintClientProfileKey, hashClientProfileKey } from '../lib/system-prompt.js';
+
+// Client-profile CRUD (#411), mounted under /api/client-profiles behind the
+// dashboard session gate like every other admin route. The full `sk-cp-...`
+// key is returned exactly once — from create and rotate; the list endpoint
+// only ever shows the masked form (rendered from the encrypted copy, since
+// the auth path stores nothing but a hash).
+
+export const clientProfilesRouter = Router();
+
+const MAX_NAME_LEN = 100;
+// Generous ceiling — a system prompt is configuration, not a document.
+const MAX_PROMPT_LEN = 32_000;
+
+const createSchema = z.object({
+ name: z.string().trim().min(1).max(MAX_NAME_LEN),
+ systemPrompt: z.string().max(MAX_PROMPT_LEN).nullish(),
+});
+
+const updateSchema = z.object({
+ name: z.string().trim().min(1).max(MAX_NAME_LEN).optional(),
+ // null clears the prompt (the profile key then authenticates without
+ // injecting anything); absent leaves it untouched.
+ systemPrompt: z.string().max(MAX_PROMPT_LEN).nullable().optional(),
+ enabled: z.boolean().optional(),
+});
+
+interface ProfileRow {
+ id: number;
+ name: string;
+ encrypted_key: string;
+ iv: string;
+ auth_tag: string;
+ system_prompt: string | null;
+ enabled: number;
+ created_at: string;
+ updated_at: string;
+}
+
+function maskedKeyFor(row: Pick<ProfileRow, 'encrypted_key' | 'iv' | 'auth_tag'>): string {
+ try {
+ return maskKey(decrypt(row.encrypted_key, row.iv, row.auth_tag));
+ } catch {
+ return '[decrypt failed]';
+ }
+}
+
+function toJson(row: ProfileRow) {
+ return {
+ id: row.id,
+ name: row.name,
+ maskedKey: maskedKeyFor(row),
+ systemPrompt: row.system_prompt,
+ enabled: row.enabled === 1,
+ createdAt: row.created_at,
+ updatedAt: row.updated_at,
+ };
+}
+
+function getProfile(id: number): ProfileRow | undefined {
+ return getDb().prepare('SELECT * FROM client_profiles WHERE id = ?').get(id) as ProfileRow | undefined;
+}
+
+function parseId(req: Request, res: Response): number | null {
+ const id = Number(req.params.id);
+ if (!Number.isInteger(id) || id <= 0) {
+ res.status(400).json({ error: { message: 'Invalid profile id' } });
+ return null;
+ }
+ return id;
+}
+
+function notFound(res: Response): void {
+ res.status(404).json({ error: { message: 'Client profile not found' } });
+}
+
+clientProfilesRouter.get('/', (_req: Request, res: Response) => {
+ const rows = getDb().prepare('SELECT * FROM client_profiles ORDER BY id').all() as ProfileRow[];
+ res.json(rows.map(toJson));
+});
+
+clientProfilesRouter.post('/', (req: Request, res: Response) => {
+ const parsed = createSchema.safeParse(req.body);
+ if (!parsed.success) {
+ res.status(400).json({ error: { message: 'A profile name is required' } });
+ return;
+ }
+ const key = mintClientProfileKey();
+ const { encrypted, iv, authTag } = encrypt(key);
+ const prompt = parsed.data.systemPrompt?.trim() || null;
+ const info = getDb().prepare(`
+ INSERT INTO client_profiles (name, token_hash, encrypted_key, iv, auth_tag, system_prompt)
+ VALUES (?, ?, ?, ?, ?, ?)
+ `).run(parsed.data.name, hashClientProfileKey(key), encrypted, iv, authTag, prompt);
+ const row = getProfile(Number(info.lastInsertRowid))!;
+ // The only time the full key leaves the server (besides rotate).
+ res.status(201).json({ ...toJson(row), key });
+});
+
+clientProfilesRouter.patch('/:id', (req: Request, res: Response) => {
+ const id = parseId(req, res);
+ if (id === null) return;
+ const parsed = updateSchema.safeParse(req.body);
+ if (!parsed.success) {
+ res.status(400).json({ error: { message: 'Invalid profile update' } });
+ return;
+ }
+ const row = getProfile(id);
+ if (!row) return notFound(res);
+
+ const { name, systemPrompt, enabled } = parsed.data;
+ const nextPrompt = systemPrompt === undefined
+ ? row.system_prompt
+ : (systemPrompt?.trim() || null);
+ getDb().prepare(`
+ UPDATE client_profiles
+ SET name = ?, system_prompt = ?, enabled = ?, updated_at = datetime('now')
+ WHERE id = ?
+ `).run(
+ name ?? row.name,
+ nextPrompt,
+ enabled === undefined ? row.enabled : (enabled ? 1 : 0),
+ id,
+ );
+ res.json(toJson(getProfile(id)!));
+});
+
+clientProfilesRouter.post('/:id/rotate', (req: Request, res: Response) => {
+ const id = parseId(req, res);
+ if (id === null) return;
+ const row = getProfile(id);
+ if (!row) return notFound(res);
+
+ const key = mintClientProfileKey();
+ const { encrypted, iv, authTag } = encrypt(key);
+ getDb().prepare(`
+ UPDATE client_profiles
+ SET token_hash = ?, encrypted_key = ?, iv = ?, auth_tag = ?, updated_at = datetime('now')
+ WHERE id = ?
+ `).run(hashClientProfileKey(key), encrypted, iv, authTag, id);
+ res.json({ ...toJson(getProfile(id)!), key });
+});
+
+clientProfilesRouter.delete('/:id', (req: Request, res: Response) => {
+ const id = parseId(req, res);
+ if (id === null) return;
+ const info = getDb().prepare('DELETE FROM client_profiles WHERE id = ?').run(id);
+ if (info.changes === 0) return notFound(res);
+ res.json({ success: true });
+});
diff --git a/server/src/routes/proxy.ts b/server/src/routes/proxy.ts
index e1a0e6f7..eb005ce1 100644
--- a/server/src/routes/proxy.ts
+++ b/server/src/routes/proxy.ts
@@ -8,7 +8,8 @@ import { recordRequest, recordTokens, setCooldown, getCooldownDurationForLimit,
import { runEmbeddings, EmbeddingsError } from '../services/embeddings.js';
import { runImageGeneration, runSpeech, runTranscription, MediaError, MAX_TRANSCRIPTION_BYTES } from '../services/media.js';
import multer from 'multer';
-import { getDb, getUnifiedApiKey } from '../db/index.js';
+import { getDb } from '../db/index.js';
+import { resolveAuth, prependSystemPrompt, type ResolvedAuth } from '../lib/system-prompt.js';
import { contentToString, messageHasImage, normalizeOutboundContent, sanitizeResponse } from '../lib/content.js';
import { repairToolArguments, toolSchemaMap } from '../lib/tool-args.js';
import { sanitizeProviderErrorMessage } from '../lib/error-redaction.js';
@@ -44,18 +45,23 @@ function isAutoModel(modelId: string | undefined): boolean {
return lower === AUTO_MODEL_ID || lower.startsWith(`${AUTO_MODEL_ID}:`);
}
-// Constant-time string comparison for the unified API key. Plain `===` leaks
-// length and per-character timing, which a network attacker could in principle
-// use to recover the key one byte at a time.
-export function timingSafeStringEqual(provided: string, expected: string): boolean {
- // Use HMAC to produce fixed-length digests so timingSafeEqual always
- // receives same-length buffers regardless of input length. This eliminates
- // both the per-character timing leak and the length-branch timing leak that
- // the Buffer.alloc-on-mismatch approach had.
- const key = Buffer.alloc(32);
- const a = crypto.createHmac('sha256', key).update(provided).digest();
- const b = crypto.createHmac('sha256', key).update(expected).digest();
- return crypto.timingSafeEqual(a, b);
+// timingSafeStringEqual moved to lib/system-prompt.ts (resolveAuth needs it
+// and importing it back from this route would be a cycle). Re-exported here
+// for existing importers (anthropic, gemini, mcp, ollama, status, url-tokens).
+export { timingSafeStringEqual } from '../lib/system-prompt.js';
+
+// Shared auth gate for the /v1 inference endpoints (#411): accepts the unified
+// key (default behavior, no enforced prompt) or an enabled client-profile key
+// (which may carry a server-enforced system prompt). Profile keys are ONLY
+// valid here — never on the /api dashboard surface. Writes the 401 itself so
+// call sites can simply bail on null.
+function requireInferenceAuth(req: Request, res: Response): ResolvedAuth | null {
+ const auth = resolveAuth(extractApiToken(req));
+ if (!auth) {
+ res.status(401).json({ error: { message: 'Invalid API key', type: 'authentication_error' } });
+ return null;
+ }
+ return auth;
}
// Extract the unified API key from an incoming request. Accepts both the
@@ -200,12 +206,7 @@ export function setStickyModel(messages: ChatMessage[], modelDbId: number, sessi
// OpenAI-compatible /models endpoint (used by Hermes for metadata)
// shows API models which is linked by the user
proxyRouter.get('/models', (req: Request, res: Response) => {
- const token = extractApiToken(req);
- const unifiedKey = getUnifiedApiKey();
- if (!token || !timingSafeStringEqual(token, unifiedKey)) {
- res.status(401).json({ error: { message: 'Invalid API key', type: 'authentication_error' } });
- return;
- }
+ if (!requireInferenceAuth(req, res)) return;
// By default we return the WHOLE catalog (one row per model id), each tagged
// with whether it is currently usable, so a client can see everything and know
@@ -466,12 +467,7 @@ const EmbeddingsBody = z.object({
});
proxyRouter.post('/embeddings', async (req: Request, res: Response) => {
- const token = extractApiToken(req);
- const unifiedKey = getUnifiedApiKey();
- if (!token || !timingSafeStringEqual(token, unifiedKey)) {
- res.status(401).json({ error: { message: 'Invalid API key', type: 'authentication_error' } });
- return;
- }
+ if (!requireInferenceAuth(req, res)) return;
const parsed = EmbeddingsBody.safeParse(req.body);
if (!parsed.success) {
res.status(400).json({ error: { message: 'Invalid request: `input` is required', type: 'invalid_request_error' } });
@@ -514,12 +510,7 @@ function mediaErrorType(status: number): string {
}
proxyRouter.post('/images/generations', async (req: Request, res: Response) => {
- const token = extractApiToken(req);
- const unifiedKey = getUnifiedApiKey();
- if (!token || !timingSafeStringEqual(token, unifiedKey)) {
- res.status(401).json({ error: { message: 'Invalid API key', type: 'authentication_error' } });
- return;
- }
+ if (!requireInferenceAuth(req, res)) return;
const parsed = ImageBody.safeParse(req.body);
if (!parsed.success) {
res.status(400).json({ error: { message: 'Invalid request: `prompt` is required', type: 'invalid_request_error' } });
@@ -552,12 +543,7 @@ const SpeechBody = z.object({
});
proxyRouter.post('/audio/speech', async (req: Request, res: Response) => {
- const token = extractApiToken(req);
- const unifiedKey = getUnifiedApiKey();
- if (!token || !timingSafeStringEqual(token, unifiedKey)) {
- res.status(401).json({ error: { message: 'Invalid API key', type: 'authentication_error' } });
- return;
- }
+ if (!requireInferenceAuth(req, res)) return;
const parsed = SpeechBody.safeParse(req.body);
if (!parsed.success) {
res.status(400).json({ error: { message: 'Invalid request: `input` is required', type: 'invalid_request_error' } });
@@ -606,12 +592,7 @@ function transcriptionBadRequest(res: Response, message: string, code?: string):
proxyRouter.post('/audio/transcriptions', (req: Request, res: Response, next) => {
// Auth before the multipart body is parsed: an unauthenticated caller's
// upload is never buffered.
- const token = extractApiToken(req);
- const unifiedKey = getUnifiedApiKey();
- if (!token || !timingSafeStringEqual(token, unifiedKey)) {
- res.status(401).json({ error: { message: 'Invalid API key', type: 'authentication_error' } });
- return;
- }
+ if (!requireInferenceAuth(req, res)) return;
transcriptionUpload.single('file')(req, res, (err: unknown) => {
if (err) {
if (err instanceof multer.MulterError && err.code === 'LIMIT_FILE_SIZE') {
@@ -767,14 +748,8 @@ proxyRouter.post('/completions', async (req: Request, res: Response) => {
const requestGroupId = getRequestGroupId(req);
res.setHeader('X-Request-ID', requestGroupId);
- const token = extractApiToken(req);
- const unifiedKey = getUnifiedApiKey();
- if (!token || !timingSafeStringEqual(token, unifiedKey)) {
- res.status(401).json({
- error: { message: 'Invalid API key', type: 'authentication_error' },
- });
- return;
- }
+ const auth = requireInferenceAuth(req, res);
+ if (!auth) return;
const parsed = CompletionBody.safeParse(req.body);
if (!parsed.success) {
@@ -793,7 +768,8 @@ proxyRouter.post('/completions', async (req: Request, res: Response) => {
const max_tokens = parsed.data.max_tokens != null && parsed.data.max_tokens > 0
? parsed.data.max_tokens : 128;
const stop = providerSafeStop(parsed.data.stop);
- const messages = completionPromptToMessages(prompt, suffix);
+ // A profile's enforced prompt goes ahead of the autocomplete system message.
+ const messages = prependSystemPrompt(completionPromptToMessages(prompt, suffix), auth.systemPrompt);
const estimatedInputTokens = messages.reduce((sum, m) => sum + Math.ceil(contentToString(m.content).length / 4), 0);
// Cap the reserved output so a huge client-set max_tokens doesn't falsely
// exclude the whole model pool (#470); input is still counted in full.
@@ -1132,17 +1108,12 @@ proxyRouter.post('/chat/completions', async (req: Request, res: Response) => {
const requestGroupId = getRequestGroupId(req);
res.setHeader('X-Request-ID', requestGroupId);
- // Authenticate with the unified API key for every proxy request, including
- // loopback callers. Browser pages can reach localhost, so socket locality is
- // not a reliable authorization boundary.
- const token = extractApiToken(req);
- const unifiedKey = getUnifiedApiKey();
- if (!token || !timingSafeStringEqual(token, unifiedKey)) {
- res.status(401).json({
- error: { message: 'Invalid API key', type: 'authentication_error' },
- });
- return;
- }
+ // Authenticate every proxy request, including loopback callers. Browser
+ // pages can reach localhost, so socket locality is not a reliable
+ // authorization boundary. Client-profile keys resolve here too, carrying
+ // their server-enforced system prompt (#411).
+ const auth = requireInferenceAuth(req, res);
+ if (!auth) return;
// Validate request
const parsed = chatCompletionSchema.safeParse(req.body);
@@ -1289,6 +1260,13 @@ proxyRouter.post('/chat/completions', async (req: Request, res: Response) => {
messages = compressionResult.messages;
res.setHeader('X-FreeLLM-Compress', formatCompressionHeader(compressionResult));
+ // Server-enforced system prompt (#411): injected AFTER compression so it is
+ // never compressed away, and FIRST in the list so a caller-supplied system
+ // message follows it and cannot override it. Constant per profile, so the
+ // provider-side cache prefix stays stable across requests. Neutral no-op for
+ // the unified key and for profiles without a prompt.
+ messages = prependSystemPrompt(messages, auth.systemPrompt);
+
// Token estimation is intentionally a heuristic (~4 chars per token). Used
// for routing decisions (skip a model whose budget is too small) and for
// streaming bookkeeping where the provider doesn't echo a final usage count.
diff --git a/server/src/routes/responses.ts b/server/src/routes/responses.ts
index c53a615d..5bb73b34 100644
--- a/server/src/routes/responses.ts
+++ b/server/src/routes/responses.ts
@@ -10,13 +10,13 @@ import type {
Platform,
} from '@freellmapi/shared/types.js';
import { routeRequest, hasEnabledToolsModel, resolveStickyPreference, routingReserveTokens, resolveModelGroupCandidates, type RouteResult, type ChainRow } from '../services/router.js';
-import { getDb, getUnifiedApiKey } from '../db/index.js';
+import { getDb } from '../db/index.js';
+import { resolveAuth, prependSystemPrompt } from '../lib/system-prompt.js';
import { isUnifyEnabled, getModelGroups, resolveRequestedIdForDispatch } from '../services/model-groups.js';
import { contentToString } from '../lib/content.js';
import { repairToolArguments, toolSchemaMap } from '../lib/tool-args.js';
import { rescueInlineToolCalls, startsWithDialectMarker, couldBecomeDialectMarker, containsDialectMarker } from '../lib/tool-call-rescue.js';
import {
- timingSafeStringEqual,
extractApiToken,
getRequestGroupId,
getStickyModel,
@@ -312,10 +312,10 @@ responsesRouter.post('/responses', async (req: Request, res: Response) => {
const requestGroupId = getRequestGroupId(req);
res.setHeader('X-Request-ID', requestGroupId);
- // Same unified-key auth as the proxy (accepts Bearer or x-api-key).
- const token = extractApiToken(req);
- const unifiedKey = getUnifiedApiKey();
- if (!token || !timingSafeStringEqual(token, unifiedKey)) {
+ // Same auth as the proxy (accepts Bearer or x-api-key): unified key, or a
+ // client-profile key carrying a server-enforced system prompt (#411).
+ const auth = resolveAuth(extractApiToken(req));
+ if (!auth) {
res.status(401).json({ error: { message: 'Invalid API key', type: 'authentication_error' } });
return;
}
@@ -387,6 +387,11 @@ responsesRouter.post('/responses', async (req: Request, res: Response) => {
messages = compressionResult.messages;
res.setHeader('X-FreeLLM-Compress', formatCompressionHeader(compressionResult));
+ // Server-enforced system prompt (#411): after compression so it is never
+ // compressed away, first in the list so the caller's own instructions
+ // (`instructions` / system input items) follow it and cannot override it.
+ messages = prependSystemPrompt(messages, auth.systemPrompt);
+
const estimatedInputTokens = messages.reduce(
(sum, m) => sum + Math.ceil(contentToString(m.content).length / 4),
0,