Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: show how to call the Decision API from code (#16499)

Nilayd792213488b5
diff --git a/studio/frontend/src/features/api-monitor/api-monitor-page.tsx b/studio/frontend/src/features/api-monitor/api-monitor-page.tsx
index 5341f68541e..1d1a104ef15 100644
--- a/studio/frontend/src/features/api-monitor/api-monitor-page.tsx
+++ b/studio/frontend/src/features/api-monitor/api-monitor-page.tsx
@@ -35,6 +35,7 @@ import {
loadLanAccess,
loadMultiModelEnabled,
publishLanUrls,
+ useKeylessExampleAccess,
useSettingsDialogStore,
} from "@/features/settings";
// Not through the barrel: these pull in chat, which every barrel importer would then load.
@@ -919,6 +920,12 @@ function QuickStart({
const [useTunnel] = useApiTunnelPref();
const [kind, setKind] = useState<ApiExampleKind>("chat");
const freshKey = useFreshApiKeyStore((s) => s.key);
+ const isOwner = useIsAccountOwner();
+ const keylessAccess = useKeylessExampleAccess(isOwner);
+ const keyless = {
+ keylessScope: keylessAccess.scope,
+ keylessExposure: keylessAccess.exposure,
+ };
return (
<div className="flex flex-col items-center gap-4 px-6 py-12 text-center">
<span className="flex size-10 items-center justify-center icon-disc text-muted-foreground">
@@ -961,15 +968,22 @@ function QuickStart({
apiKey={freshKey}
useTunnel={useTunnel}
showHeading={false}
+ {...keyless}
/>
) : kind === "audio" ? (
<AudioApiExamples
apiKey={freshKey}
useTunnel={useTunnel}
showHeading={false}
+ {...keyless}
/>
) : (
- <DecisionApiSection showHeading={false} />
+ <DecisionApiSection
+ apiKey={freshKey}
+ useTunnel={useTunnel}
+ showHeading={false}
+ {...keyless}
+ />
)}
</div>
)}
diff --git a/studio/frontend/src/features/settings/components/api-example-tabs.tsx b/studio/frontend/src/features/settings/components/api-example-tabs.tsx
index 504990e18b5..dae16ee9dd3 100644
--- a/studio/frontend/src/features/settings/components/api-example-tabs.tsx
+++ b/studio/frontend/src/features/settings/components/api-example-tabs.tsx
@@ -236,7 +236,12 @@ export function ApiExamplesPanel({
{...keyless}
/>
) : (
- <DecisionApiSection showHeading={false} />
+ <DecisionApiSection
+ apiKey={apiKey}
+ useTunnel={useTunnel}
+ showHeading={false}
+ {...keyless}
+ />
)}
</div>
);
diff --git a/studio/frontend/src/features/settings/components/decision-api-section.tsx b/studio/frontend/src/features/settings/components/decision-api-section.tsx
index 082ced885bc..82fa1102405 100644
--- a/studio/frontend/src/features/settings/components/decision-api-section.tsx
+++ b/studio/frontend/src/features/settings/components/decision-api-section.tsx
@@ -29,6 +29,7 @@ import {
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
+import { usePlatformStore } from "@/config/env";
import {
DOWNLOAD_KIND,
downloadManager,
@@ -38,13 +39,22 @@ import {
useDownloadManagerStore,
} from "@/features/hub";
import { translate, useT } from "@/i18n";
+import { isTauri } from "@/lib/api-base";
import { toast } from "@/lib/toast";
import { cn } from "@/lib/utils";
+import {
+ ApiExampleBox,
+ useApiExampleChoices,
+} from "../../api-monitor/components/api-example-box";
import { scrollIntoPane } from "../lib/scroll-into-pane";
import { ArrowUpRight01Icon, TaskDone01Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { type ReactElement, useEffect, useRef, useState } from "react";
import { useSettingsDialogStore } from "../stores/settings-dialog-store";
+import type {
+ KeylessApiAccessExposure,
+ KeylessApiAccessScope,
+} from "../api/keyless-api-access";
import {
type SystemOneBackend,
decisionRuntimeLabel,
@@ -63,8 +73,14 @@ import {
DECISION_MODEL_LABELS,
isClefDecisionModel,
} from "../lib/decision-model-labels";
+import {
+ buildDecisionApiSnippet,
+ decisionApiKey,
+ decisionMcpUrl,
+} from "./decision-api-snippets";
import { DecisionTryDialog } from "./decision-try-dialog";
import { SettingsRow } from "./settings-row";
+import { UrlPill } from "./url-pill";
import { PlayIcon } from "lucide-react";
const DOWNLOAD_SCOPE = "systemone";
@@ -85,10 +101,34 @@ function errorMessage(error: unknown): string | null {
export function DecisionApiSection({
showHeading = true,
+ apiKey,
+ useTunnel = false,
+ keylessScope = "off",
+ keylessExposure = null,
}: {
showHeading?: boolean;
+ apiKey?: string | null;
+ useTunnel?: boolean;
+ keylessScope?: KeylessApiAccessScope;
+ keylessExposure?: KeylessApiAccessExposure | null;
} = {}): ReactElement | null {
const t = useT();
+ const cloudflareUrl = usePlatformStore((s) => s.cloudflareUrl);
+ const serverUrl = usePlatformStore((s) => s.serverUrl);
+ const origin = typeof window !== "undefined" ? window.location.origin : "";
+ const base =
+ useTunnel && cloudflareUrl
+ ? cloudflareUrl
+ : isTauri
+ ? (serverUrl ?? origin)
+ : origin;
+ const exampleKey = decisionApiKey(apiKey, {
+ base,
+ tunnel: useTunnel && !!cloudflareUrl,
+ scope: keylessScope,
+ exposure: keylessExposure,
+ });
+ const choices = useApiExampleChoices(base, "curl");
const [settings, setSettings] = useState<SystemOneSettings | null>(null);
const [connections, setConnections] = useState<SystemOneConnection[] | null>(
null,
@@ -776,12 +816,43 @@ export function DecisionApiSection({
</div>
</div>
+ <div className="flex min-w-0 flex-col gap-3">
+ <h3 className="text-ui-13 font-medium text-foreground">
+ {t("settings.apiKeys.decisionApi.codeTitle")}
+ </h3>
+ {enabled ? null : (
+ <p className="text-xs text-muted-foreground">
+ {t("decisions.tryItOff")}
+ </p>
+ )}
+ <ApiExampleBox
+ choices={choices}
+ hasRealKey={Boolean(apiKey)}
+ code={buildDecisionApiSnippet({
+ base,
+ apiKey: exampleKey,
+ language: choices.language,
+ os: choices.os,
+ })}
+ />
+ <div className="flex min-w-0 flex-col gap-1.5">
+ <span className="text-xs font-medium text-foreground">
+ {t("settings.apiKeys.decisionApi.mcpUrl")}
+ </span>
+ <UrlPill url={decisionMcpUrl(base, settings.mcpUrl)} />
+ <p className="text-xs text-muted-foreground">
+ {t("settings.apiKeys.decisionApi.mcpUrlDescription")}
+ </p>
+ </div>
+ </div>
+
<DecisionTryDialog
open={tryOpen && enabled}
onOpenChange={setTryOpen}
initialModel={tryModel}
settings={settings}
connections={connections ?? []}
+ curlTarget={{ base, apiKey: exampleKey, os: choices.os }}
onRun={() => {
loadSystemOneSettings().then(setSettings, () => undefined);
}}
diff --git a/studio/frontend/src/features/settings/components/decision-api-snippets.ts b/studio/frontend/src/features/settings/components/decision-api-snippets.ts
new file mode 100644
index 00000000000..bb4cd943762
--- /dev/null
+++ b/studio/frontend/src/features/settings/components/decision-api-snippets.ts
@@ -0,0 +1,142 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import type {
+ ApiExampleLanguage,
+ ApiExampleOs,
+} from "../../api-monitor/api-sampling-example.ts";
+import { DEFAULT_MODEL, requestText } from "../lib/decision-request.ts";
+import type {
+ KeylessApiAccessExposure,
+ KeylessApiAccessScope,
+} from "../api/keyless-api-access";
+import { psSingle, shSingle } from "./agent-command.ts";
+import { keylessBaseEligible } from "./keyless-example-eligibility.ts";
+
+const KEY_PLACEHOLDER = "sk-unsloth-YOUR_KEY";
+const KEYLESS_KEY_PLACEHOLDER = "not-needed";
+const STATE = "I was charged twice. Please fix this ASAP.";
+const INSTRUCTIONS = "What is this ticket about?";
+const CRITERIA = {
+ billing: "Charges, refunds or invoices",
+ technical: "Bugs or errors in the product",
+ other: "Anything else",
+};
+
+export function decisionApiKey(
+ apiKey: string | null | undefined,
+ server: {
+ base: string;
+ tunnel: boolean;
+ scope: KeylessApiAccessScope;
+ exposure: KeylessApiAccessExposure | null;
+ },
+): string {
+ if (apiKey) return apiKey;
+ const keyless =
+ !server.tunnel &&
+ keylessBaseEligible(server.base, server.scope, server.exposure);
+ return keyless ? KEYLESS_KEY_PLACEHOLDER : KEY_PLACEHOLDER;
+}
+
+// mcp_url always names 127.0.0.1, which is the wrong machine over LAN or a tunnel.
+export function decisionMcpUrl(base: string, mcpUrl: string): string {
+ return `${base}${new URL(mcpUrl).pathname}`;
+}
+
+export function buildDecisionCurl({
+ base,
+ apiKey,
+ body,
+ os,
+}: {
+ base: string;
+ apiKey: string;
+ body: string;
+ os: ApiExampleOs;
+}): string {
+ if (os === "windows") {
+ // Set-Content writes ascii: \u escapes survive it, raw non-English text does not.
+ const ascii = body.replace(
+ /[\u0080-\uffff]/g,
+ (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`,
+ );
+ return `$body = '${psSingle(ascii)}'
+Set-Content -Path body.json -Value $body -Encoding ascii
+curl.exe ${base}/v1/systemone \`
+ -H "Authorization: Bearer ${apiKey}" \`
+ -H "Content-Type: application/json" \`
+ -d "@body.json"`;
+ }
+ return `curl ${base}/v1/systemone \\
+ -H "Authorization: Bearer ${apiKey}" \\
+ -H "Content-Type: application/json" \\
+ -d '${shSingle(body)}'`;
+}
+
+function pythonExample(base: string, apiKey: string): string {
+ return `# pip install typesafe-sdk
+from typesafe_sdk import Choice, TypeSafeClient
+
+with TypeSafeClient(base_url=${JSON.stringify(base)}, api_key=${JSON.stringify(apiKey)}) as client:
+ response = client.system_one(
+ state=${JSON.stringify(STATE)},
+ questions={
+ "category": Choice(
+ instructions=${JSON.stringify(INSTRUCTIONS)},
+ criteria=${JSON.stringify(CRITERIA, null, 4).replace(/\n/g, `\n${" ".repeat(16)}`)},
+ ),
+ },
+ )
+
+print(response.choices["category"].choice)`;
+}
+
+function javascriptExample(base: string, apiKey: string): string {
+ return `// npm install @typesafe-ai/sdk
+import { choice, TypeSafeClient } from "@typesafe-ai/sdk";
+
+const client = new TypeSafeClient({
+ baseURL: ${JSON.stringify(base)},
+ apiKey: ${JSON.stringify(apiKey)},
+});
+const response = await client.systemOne({
+ state: ${JSON.stringify(STATE)},
+ questions: {
+ category: choice(${JSON.stringify(INSTRUCTIONS)}, ${JSON.stringify(CRITERIA, null, 2).replace(/\n/g, "\n ")}),
+ },
+});
+
+console.log(response.answers.category.choice);`;
+}
+
+export function buildDecisionApiSnippet({
+ base,
+ apiKey,
+ language,
+ os,
+}: {
+ base: string;
+ apiKey: string;
+ language: ApiExampleLanguage;
+ os: ApiExampleOs;
+}): string {
+ if (language === "python") return pythonExample(base, apiKey);
+ if (language === "javascript") return javascriptExample(base, apiKey);
+ return buildDecisionCurl({
+ base,
+ apiKey,
+ os,
+ body: requestText({
+ state: STATE,
+ model: DEFAULT_MODEL,
+ questions: {
+ category: {
+ type: "choice",
+ instructions: INSTRUCTIONS,
+ criteria: CRITERIA,
+ },
+ },
+ }),
+ });
+}
diff --git a/studio/frontend/src/features/settings/components/decision-try-dialog.tsx b/studio/frontend/src/features/settings/components/decision-try-dialog.tsx
index a9493a23461..f50c516fedd 100644
--- a/studio/frontend/src/features/settings/components/decision-try-dialog.tsx
+++ b/studio/frontend/src/features/settings/components/decision-try-dialog.tsx
@@ -29,6 +29,7 @@ import { Spinner } from "@/components/ui/spinner";
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";
import { type TranslationKey, useLocale, useT } from "@/i18n";
+import { copyToClipboard } from "@/lib/copy-to-clipboard";
import { cn } from "@/lib/utils";
import {
Alert02Icon,
@@ -80,6 +81,8 @@ import {
isClefDecisionModel,
} from "../lib/decision-model-labels";
import { isModEnter, modEnterLabel } from "../lib/keyboard-shortcuts";
+import type { ExampleOs } from "./api-example-parts";
+import { buildDecisionCurl } from "./decision-api-snippets";
import { type LucideIcon, PlayIcon } from "lucide-react";
const SHORTCUT = modEnterLabel();
@@ -206,19 +209,47 @@ function ViewToggle<T extends string>({
);
}
+function CopyText({
+ label,
+ text,
+}: {
+ label: string;
+ text: string;
+}): ReactElement {
+ const t = useT();
+ const [copied, setCopied] = useState(false);
+ return (
+ <button
+ type="button"
+ onClick={async () => {
+ if (await copyToClipboard(text)) {
+ setCopied(true);
+ setTimeout(() => setCopied(false), 1800);
+ }
+ }}
+ className="shrink-0 rounded font-sans text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
+ >
+ {copied ? t("settings.apiKeys.copied") : label}
+ </button>
+ );
+}
+
function CodeBlock({
title,
value,
onChange,
+ actions,
}: {
title: string;
value: string;
onChange?: (value: string) => void;
+ actions?: ReactNode;
}): ReactElement {
return (
<div className="flex min-w-0 flex-col overflow-hidden rounded-xl border border-border/70 bg-muted/40">
- <div className="truncate border-b border-border/60 px-3.5 py-2 font-mono text-ui-11 text-muted-foreground">
- {title}
+ <div className="flex items-center justify-between gap-3 border-b border-border/60 px-3.5 py-2 font-mono text-ui-11 text-muted-foreground">
+ <span className="truncate">{title}</span>
+ {actions}
</div>
{onChange ? (
<textarea
@@ -814,6 +845,7 @@ export function DecisionTryDialog({
initialModel,
settings,
connections,
+ curlTarget,
onRun,
}: {
open: boolean;
@@ -821,6 +853,7 @@ export function DecisionTryDialog({
initialModel?: string;
settings: SystemOneSettings;
connections: SystemOneConnection[];
+ curlTarget: { base: string; apiKey: string; os: ExampleOs };
onRun: () => void;
}): ReactElement {
const t = useT();
@@ -1183,6 +1216,21 @@ export function DecisionTryDialog({
title="POST /v1/systemone"
value={jsonText}
onChange={setJsonText}
+ actions={
+ <span className="flex shrink-0 items-center gap-3">
+ <CopyText
+ label={t("decisions.copyBody")}
+ text={jsonText}
+ />
+ <CopyText
+ label={t("decisions.copyCurl")}
+ text={buildDecisionCurl({
+ ...curlTarget,
+ body: jsonText,
+ })}
+ />
+ </span>
+ }
/>
</>
)}
diff --git a/studio/frontend/src/features/settings/hooks/use-keyless-example-access.ts b/studio/frontend/src/features/settings/hooks/use-keyless-example-access.ts
new file mode 100644
index 00000000000..2bed2522575
--- /dev/null
+++ b/studio/frontend/src/features/settings/hooks/use-keyless-example-access.ts
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { usePlatformStore } from "@/config/env";
+import { useEffect, useState } from "react";
+import {
+ type KeylessApiAccessExposure,
+ type KeylessApiAccessScope,
+ loadKeylessApiAccess,
+} from "../api/keyless-api-access";
+import { useSettingsDialogStore } from "../stores/settings-dialog-store";
+
+export type KeylessExampleAccess = {
+ scope: KeylessApiAccessScope;
+ tools: boolean;
+ exposure: KeylessApiAccessExposure | null;
+};
+
+/** The keyless policy the examples' placeholder key follows; owner-only route, else "off". */
+export function useKeylessExampleAccess(isOwner: boolean): KeylessExampleAccess {
+ const [keyless, setKeyless] = useState<KeylessExampleAccess>({
+ scope: "off",
+ tools: false,
+ exposure: null,
+ });
+ // Tunnel changes exposure; Settings edits the policy while the API Monitor stays mounted behind it.
+ const cloudflareUrl = usePlatformStore((state) => state.cloudflareUrl);
+ const settingsOpen = useSettingsDialogStore((state) => state.open);
+ // biome-ignore lint/correctness/useExhaustiveDependencies: cloudflareUrl and settingsOpen are triggers, not inputs
+ useEffect(() => {
+ if (!isOwner) {
+ return;
+ }
+ let cancelled = false;
+ loadKeylessApiAccess()
+ .then((next) => {
+ if (!cancelled) {
+ setKeyless({
+ scope: next.suspendedByAccounts ? "off" : next.scope,
+ tools: next.tools,
+ exposure: next.exposure,
+ });
+ }
+ })
+ .catch(() => undefined);
+ return () => {
+ cancelled = true;
+ };
+ }, [isOwner, cloudflareUrl, settingsOpen]);
+ return keyless;
+}
diff --git a/studio/frontend/src/features/settings/index.ts b/studio/frontend/src/features/settings/index.ts
index 9b5be6720c6..3fd71c9b740 100644
--- a/studio/frontend/src/features/settings/index.ts
+++ b/studio/frontend/src/features/settings/index.ts
@@ -21,6 +21,7 @@ export { updateHubSource } from "./api/hub-settings";
export { loadLanAccess, publishLanUrls } from "./api/lan-access";
export { lanApiUrls } from "./api/lan-access-state";
export { loadMultiModelEnabled } from "./api/multi-model";
+export { useKeylessExampleAccess } from "./hooks/use-keyless-example-access";
export { loadOpenAIAutoSwitchSettings } from "./api/openai-auto-switch";
export { listOpenAIModels } from "./api/openai-models";
export {
diff --git a/studio/frontend/src/features/settings/tabs/api-keys-tab.tsx b/studio/frontend/src/features/settings/tabs/api-keys-tab.tsx
index 7345bb9a2ae..58ea8c8c0b5 100644
--- a/studio/frontend/src/features/settings/tabs/api-keys-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/api-keys-tab.tsx
@@ -10,7 +10,6 @@ import {
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
-import { usePlatformStore } from "@/config/env";
import { useIsAccountOwner } from "@/features/auth";
import { cn } from "@/lib/utils";
import { translate, useT } from "@/i18n";
@@ -22,11 +21,6 @@ import {
fetchApiKeys,
revokeApiKey,
} from "../api/api-keys";
-import {
- type KeylessApiAccessExposure,
- type KeylessApiAccessScope,
- loadKeylessApiAccess,
-} from "../api/keyless-api-access";
import { apiKeyActionMessage } from "../components/api-key-action-message";
import {
ApiKeyRow,
@@ -44,6 +38,7 @@ import { MonitorLink } from "../components/monitor-link";
import { SettingsSection } from "../components/settings-section";
import { ApiExamplesPanel } from "../components/api-example-tabs";
import { useApiTunnelPref } from "../components/usage-examples";
+import { useKeylessExampleAccess } from "../hooks/use-keyless-example-access";
import { usePublishAccessUrls } from "../hooks/use-publish-access-urls";
import { useFreshApiKeyStore } from "../stores/fresh-api-key-store";
@@ -74,34 +69,7 @@ export function ApiKeysTab() {
const [useTunnel, setUseTunnel] = useApiTunnelPref();
// Owner-only routes, as the Remote & LAN tab is.
usePublishAccessUrls(isOwner);
- const [keyless, setKeyless] = useState<{
- scope: KeylessApiAccessScope;
- tools: boolean;
- exposure: KeylessApiAccessExposure | null;
- }>({ scope: "off", tools: false, exposure: null });
- // Read for the examples' placeholder key; a tunnel coming or going changes exposure.
- const cloudflareUrl = usePlatformStore((state) => state.cloudflareUrl);
- // biome-ignore lint/correctness/useExhaustiveDependencies: cloudflareUrl is a trigger, not an input
- useEffect(() => {
- if (!isOwner) {
- return;
- }
- let cancelled = false;
- loadKeylessApiAccess()
- .then((next) => {
- if (!cancelled) {
- setKeyless({
- scope: next.suspendedByAccounts ? "off" : next.scope,
- tools: next.tools,
- exposure: next.exposure,
- });
- }
- })
- .catch(() => undefined);
- return () => {
- cancelled = true;
- };
- }, [isOwner, cloudflareUrl]);
+ const keyless = useKeylessExampleAccess(isOwner);
const reduced = useReducedMotion();
const transition = reduced
? { duration: 0 }
diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.ts
index 6c40d644063..2e0608ba950 100644
--- a/studio/frontend/src/i18n/locales/ar.ts
+++ b/studio/frontend/src/i18n/locales/ar.ts
@@ -3461,6 +3461,9 @@ export const ar = {
docs: "التوثيق",
docsLabel: "فتح توثيق واجهة القرارات البرمجية",
description: "أجب عن أسئلة نعم/لا والاختيار من متعدد والتقييم حول النص باستخدام نموذج على هذا الجهاز أو نموذج قرارات من الاتصالات. يعمل مع حزمة TypeSafe.",
+ codeTitle: "استدعِه من الشيفرة",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "تتصل عملاء MCP الأخرى هنا باستخدام الرمز نفسه.",
enable: "خدمة الطلبات",
enableDescription: "يقدّم /v1/systemone. عند التشغيل يُنزَّل النموذج.",
enableRemoteDescription: "يقدّم /v1/systemone.",
@@ -5098,6 +5101,8 @@ export const ar = {
removeLevel: "إزالة المستوى {n}",
addLevel: "إضافة مستوى",
jsonHelp: "نص الطلب. التشغيل يرسله كما هو.",
+ copyBody: "نسخ النص الأساسي",
+ copyCurl: "نسخ كـ cURL",
examples: "أمثلة",
presetToolApproval: "الموافقة على استدعاءات أدوات الوكيل",
presetPromptInjection: "كشف حقن الأوامر",
diff --git a/studio/frontend/src/i18n/locales/cs.ts b/studio/frontend/src/i18n/locales/cs.ts
index 4ac1df8a6c5..0cb8ecea3d5 100644
--- a/studio/frontend/src/i18n/locales/cs.ts
+++ b/studio/frontend/src/i18n/locales/cs.ts
@@ -3772,6 +3772,9 @@ export const cs = {
docsLabel: "Otevřít dokumentaci Decision API",
description:
"Odpovídejte na otázky typu ano/ne, s výběrem z možností a s hodnocením týkající se textu pomocí modelu v tomto počítači nebo rozhodovacího modelu z Připojení. Funguje se sadou TypeSafe SDK.",
+ codeTitle: "Volání z kódu",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Ostatní klienti MCP se sem připojují se stejným tokenem.",
enable: "Obsluhovat požadavky",
enableDescription: "Obsluhuje /v1/systemone. Zapnutím se stáhne model.",
enableRemoteDescription: "Obsluhuje /v1/systemone.",
@@ -5510,6 +5513,8 @@ export const cs = {
removeLevel: "Odebrat úroveň {n}",
addLevel: "Přidat úroveň",
jsonHelp: "Tělo požadavku. Spuštění ho odešle přesně tak, jak je napsané.",
+ copyBody: "Kopírovat tělo",
+ copyCurl: "Kopírovat jako cURL",
examples: "Příklady",
presetToolApproval: "Schvalovat volání nástrojů agenta",
presetPromptInjection: "Odhalit prompt injection",
diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.ts
index fd4b7f0881f..40860926da8 100644
--- a/studio/frontend/src/i18n/locales/de.ts
+++ b/studio/frontend/src/i18n/locales/de.ts
@@ -3508,6 +3508,9 @@ export const de = {
docs: "Dokumentation",
docsLabel: "Dokumentation zur Entscheidungs-API öffnen",
description: "Beantworte Ja/Nein-, Auswahl- und Bewertungsfragen zu Text mit einem Modell auf diesem Rechner oder einem Entscheidungsmodell aus den Verbindungen. Funktioniert mit dem TypeSafe-SDK.",
+ codeTitle: "Aus Code aufrufen",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Andere MCP-Clients verbinden sich hier mit demselben Token.",
enable: "Anfragen beantworten",
enableDescription: "Stellt /v1/systemone bereit. Beim Einschalten wird das Modell heruntergeladen.",
enableRemoteDescription: "Stellt /v1/systemone bereit.",
@@ -5172,6 +5175,8 @@ export const de = {
removeLevel: "Stufe {n} entfernen",
addLevel: "Stufe hinzufügen",
jsonHelp: "Der Anfrage-Body. Ausführen sendet ihn so, wie er ist.",
+ copyBody: "Body kopieren",
+ copyCurl: "Als cURL kopieren",
examples: "Beispiele",
presetToolApproval: "Tool-Aufrufe von Agenten freigeben",
presetPromptInjection: "Prompt-Injection erkennen",
diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.ts
index b1caa3f0198..efdd8a564b2 100644
--- a/studio/frontend/src/i18n/locales/en.ts
+++ b/studio/frontend/src/i18n/locales/en.ts
@@ -3478,6 +3478,9 @@ export const en = {
docs: "Docs",
docsLabel: "Open the Decision API docs",
description: "Answer yes/no, multiple choice and score questions about text with a model on this machine or a decision model from Connections. Works with the TypeSafe SDK.",
+ codeTitle: "Call it from code",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Other MCP clients connect here with the same token.",
enable: "Serve requests",
enableDescription: "Serves /v1/systemone. Turning it on downloads the model.",
enableRemoteDescription: "Serves /v1/systemone.",
@@ -5132,6 +5135,8 @@ export const en = {
removeLevel: "Remove level {n}",
addLevel: "Add level",
jsonHelp: "The request body. Run sends it as written.",
+ copyBody: "Copy body",
+ copyCurl: "Copy as cURL",
examples: "Examples",
presetToolApproval: "Approve agent tool calls",
presetPromptInjection: "Catch prompt injection",
diff --git a/studio/frontend/src/i18n/locales/es-419.ts b/studio/frontend/src/i18n/locales/es-419.ts
index c0253cecbcd..8b865828ec7 100644
--- a/studio/frontend/src/i18n/locales/es-419.ts
+++ b/studio/frontend/src/i18n/locales/es-419.ts
@@ -3811,6 +3811,9 @@ export const es419 = {
docsLabel: "Abrir la documentación de la API de decisiones",
description:
"Responde preguntas de sí/no, de opción múltiple y de puntuación sobre texto con un modelo en esta computadora o un modelo de decisiones de Conexiones. Funciona con el SDK de TypeSafe.",
+ codeTitle: "Llámalo desde código",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Otros clientes MCP se conectan aquí con el mismo token.",
enable: "Atender solicitudes",
enableDescription:
"Atiende /v1/systemone. Al activarlo se descarga el modelo.",
@@ -5576,6 +5579,8 @@ export const es419 = {
removeLevel: "Quitar el nivel {n}",
addLevel: "Agregar nivel",
jsonHelp: "El cuerpo de la solicitud. Ejecutar lo envía tal cual.",
+ copyBody: "Copiar cuerpo",
+ copyCurl: "Copiar como cURL",
examples: "Ejemplos",
presetToolApproval: "Aprobar llamadas a herramientas de agentes",
presetPromptInjection: "Detectar inyección de prompts",
diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.ts
index da6f8b602b7..f0d4da6bf58 100644
--- a/studio/frontend/src/i18n/locales/es.ts
+++ b/studio/frontend/src/i18n/locales/es.ts
@@ -3501,6 +3501,9 @@ export const es = {
docs: "Documentación",
docsLabel: "Abrir la documentación de la API de decisiones",
description: "Responde preguntas de sí/no, de opción múltiple y de puntuación sobre texto con un modelo en este equipo o un modelo de decisiones de Conexiones. Funciona con el SDK de TypeSafe.",
+ codeTitle: "Llámalo desde código",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Otros clientes MCP se conectan aquí con el mismo token.",
enable: "Atender solicitudes",
enableDescription: "Atiende /v1/systemone. Al activarlo se descarga el modelo.",
enableRemoteDescription: "Atiende /v1/systemone.",
@@ -5171,6 +5174,8 @@ export const es = {
removeLevel: "Quitar el nivel {n}",
addLevel: "Añadir nivel",
jsonHelp: "El cuerpo de la solicitud. Ejecutar lo envía tal cual.",
+ copyBody: "Copiar cuerpo",
+ copyCurl: "Copiar como cURL",
examples: "Ejemplos",
presetToolApproval: "Aprobar llamadas a herramientas de agentes",
presetPromptInjection: "Detectar inyección de prompts",
diff --git a/studio/frontend/src/i18n/locales/fa.ts b/studio/frontend/src/i18n/locales/fa.ts
index 920dc8c8f7b..830c27f8a69 100644
--- a/studio/frontend/src/i18n/locales/fa.ts
+++ b/studio/frontend/src/i18n/locales/fa.ts
@@ -3740,6 +3740,9 @@ export const fa = {
docsLabel: "باز کردن مستندات API تصمیم‌گیری",
description:
"با یک مدل روی این دستگاه یا یک مدل تصمیم‌گیری از «اتصال‌ها»، به پرسش‌های بله/خیر، چندگزینه‌ای و امتیازدهی دربارهٔ متن پاسخ دهید. با TypeSafe SDK کار می‌کند.",
+ codeTitle: "فراخوانی از کد",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "سایر کلاینت‌های MCP با همان توکن به اینجا وصل می‌شوند.",
enable: "پاسخ به درخواست‌ها",
enableDescription:
"/v1/systemone را ارائه می‌دهد. روشن کردن آن مدل را دانلود می‌کند.",
@@ -5461,6 +5464,8 @@ export const fa = {
removeLevel: "حذف سطح {n}",
addLevel: "افزودن سطح",
jsonHelp: "بدنهٔ درخواست. «اجرا» آن را همان‌طور که نوشته شده ارسال می‌کند.",
+ copyBody: "کپی بدنه",
+ copyCurl: "کپی به‌صورت cURL",
examples: "نمونه‌ها",
presetToolApproval: "تأیید فراخوانی‌های ابزار عامل",
presetPromptInjection: "شناسایی تزریق پرامپت",
diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.ts
index af285bd53ff..25a6c32f9a4 100644
--- a/studio/frontend/src/i18n/locales/fr.ts
+++ b/studio/frontend/src/i18n/locales/fr.ts
@@ -3508,6 +3508,9 @@ export const fr = {
docs: "Documentation",
docsLabel: "Ouvrir la documentation de l'API de décision",
description: "Répondez à des questions oui/non, à choix multiples et à score sur du texte avec un modèle sur cette machine ou un modèle de décision issu des Connexions. Compatible avec le SDK TypeSafe.",
+ codeTitle: "Appeler depuis le code",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Les autres clients MCP se connectent ici avec le même jeton.",
enable: "Répondre aux requêtes",
enableDescription: "Sert /v1/systemone. L'activer télécharge le modèle.",
enableRemoteDescription: "Sert /v1/systemone.",
@@ -5182,6 +5185,8 @@ export const fr = {
removeLevel: "Retirer le niveau {n}",
addLevel: "Ajouter un niveau",
jsonHelp: "Le corps de la requête. Exécuter l'envoie tel quel.",
+ copyBody: "Copier le corps",
+ copyCurl: "Copier en cURL",
examples: "Exemples",
presetToolApproval: "Approuver les appels d'outils d'un agent",
presetPromptInjection: "Détecter l'injection de prompt",
diff --git a/studio/frontend/src/i18n/locales/he.ts b/studio/frontend/src/i18n/locales/he.ts
index 47bbdf35e7b..45502a3b6b5 100644
--- a/studio/frontend/src/i18n/locales/he.ts
+++ b/studio/frontend/src/i18n/locales/he.ts
@@ -3547,6 +3547,9 @@ export const he = {
docsLabel: "פתח את התיעוד של ממשק ה-API להחלטות",
description:
"ענה על שאלות כן/לא, רב-ברירה ודירוג לגבי טקסט באמצעות מודל במחשב זה או מודל החלטות מ'חיבורים'. עובד עם TypeSafe SDK.",
+ codeTitle: "קריאה מקוד",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "לקוחות MCP אחרים מתחברים לכאן עם אותו אסימון.",
enable: "הגש בקשות",
enableDescription: "מגיש את /v1/systemone. הפעלה מורידה את המודל.",
enableRemoteDescription: "מגיש את /v1/systemone.",
@@ -5196,6 +5199,8 @@ export const he = {
removeLevel: "הסר רמה {n}",
addLevel: "הוסף רמה",
jsonHelp: "גוף הבקשה. הרצה שולחת אותו כפי שהוא.",
+ copyBody: "העתקת גוף הבקשה",
+ copyCurl: "העתקה כ-cURL",
examples: "דוגמאות",
presetToolApproval: "אישור קריאות לכלים של סוכן",
presetPromptInjection: "זיהוי הזרקת פרומפט",
diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.ts
index 6c939153def..615cd40e9fd 100644
--- a/studio/frontend/src/i18n/locales/hi.ts
+++ b/studio/frontend/src/i18n/locales/hi.ts
@@ -3470,6 +3470,9 @@ export const hi = {
docs: "दस्तावेज़",
docsLabel: "निर्णय API दस्तावेज़ खोलें",
description: "इस मशीन के मॉडल या कनेक्शन के किसी निर्णय मॉडल से टेक्स्ट पर हाँ/नहीं, बहुविकल्पी और स्कोर वाले सवालों के जवाब दें। TypeSafe SDK के साथ काम करता है।",
+ codeTitle: "कोड से कॉल करें",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "अन्य MCP क्लाइंट इसी टोकन से यहाँ कनेक्ट होते हैं।",
enable: "अनुरोधों का जवाब दें",
enableDescription: "/v1/systemone चलाता है। चालू करने पर मॉडल डाउनलोड होता है।",
enableRemoteDescription: "/v1/systemone चलाता है।",
@@ -5109,6 +5112,8 @@ export const hi = {
removeLevel: "स्तर {n} हटाएँ",
addLevel: "स्तर जोड़ें",
jsonHelp: "अनुरोध का बॉडी। चलाने पर यह जैसा है वैसा ही भेजा जाता है।",
+ copyBody: "बॉडी कॉपी करें",
+ copyCurl: "cURL के रूप में कॉपी करें",
examples: "उदाहरण",
presetToolApproval: "एजेंट के टूल कॉल को मंज़ूरी दें",
presetPromptInjection: "प्रॉम्प्ट इंजेक्शन पकड़ें",
diff --git a/studio/frontend/src/i18n/locales/id.ts b/studio/frontend/src/i18n/locales/id.ts
index 53eca6d6d98..3ab85014106 100644
--- a/studio/frontend/src/i18n/locales/id.ts
+++ b/studio/frontend/src/i18n/locales/id.ts
@@ -3753,6 +3753,9 @@ export const id = {
docsLabel: "Buka dokumentasi API Keputusan",
description:
"Jawab pertanyaan ya/tidak, pilihan ganda, dan skor tentang teks dengan model di mesin ini atau model keputusan dari Koneksi. Berfungsi dengan SDK TypeSafe.",
+ codeTitle: "Panggil dari kode",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Klien MCP lain terhubung ke sini dengan token yang sama.",
enable: "Layani permintaan",
enableDescription:
"Melayani /v1/systemone. Mengaktifkannya akan mengunduh model.",
@@ -5492,6 +5495,8 @@ export const id = {
removeLevel: "Hapus tingkat {n}",
addLevel: "Tambah tingkat",
jsonHelp: "Isi permintaan. Jalankan akan mengirimnya apa adanya.",
+ copyBody: "Salin body",
+ copyCurl: "Salin sebagai cURL",
examples: "Contoh",
presetToolApproval: "Setujui panggilan alat agen",
presetPromptInjection: "Deteksi injeksi prompt",
diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.ts
index 1907b183e11..cbad0253838 100644
--- a/studio/frontend/src/i18n/locales/it.ts
+++ b/studio/frontend/src/i18n/locales/it.ts
@@ -3405,6 +3405,9 @@ export const it = {
docs: "Documentazione",
docsLabel: "Apri la documentazione dell'API decisionale",
description: "Rispondi a domande sì/no, a scelta multipla e a punteggio sul testo con un modello su questo computer o un modello decisionale dalle Connessioni. Funziona con l'SDK di TypeSafe.",
+ codeTitle: "Chiamalo dal codice",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Gli altri client MCP si collegano qui con lo stesso token.",
enable: "Rispondi alle richieste",
enableDescription: "Gestisce /v1/systemone. Attivandolo si scarica il modello.",
enableRemoteDescription: "Gestisce /v1/systemone.",
@@ -5167,6 +5170,8 @@ export const it = {
removeLevel: "Rimuovi il livello {n}",
addLevel: "Aggiungi livello",
jsonHelp: "Il corpo della richiesta. Esegui lo invia così com'è.",
+ copyBody: "Copia body",
+ copyCurl: "Copia come cURL",
examples: "Esempi",
presetToolApproval: "Approvare le chiamate agli strumenti di un agente",
presetPromptInjection: "Individuare la prompt injection",
diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.ts
index 02c7a90e096..67b7d027048 100644
--- a/studio/frontend/src/i18n/locales/ja.ts
+++ b/studio/frontend/src/i18n/locales/ja.ts
@@ -3434,6 +3434,9 @@ export const ja = {
docs: "ドキュメント",
docsLabel: "判定 API のドキュメントを開く",
description: "このマシン上のモデル、または接続の判定モデルで、テキストに関するはい/いいえ・選択式・スコアの質問に答えます。TypeSafe SDK で使えます。",
+ codeTitle: "コードから呼び出す",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "他の MCP クライアントは同じトークンでここに接続します。",
enable: "リクエストに応答",
enableDescription: "/v1/systemone を提供します。オンにするとモデルをダウンロードします。",
enableRemoteDescription: "/v1/systemone を提供します。",
@@ -5049,6 +5052,8 @@ export const ja = {
removeLevel: "レベル {n} を削除",
addLevel: "レベルを追加",
jsonHelp: "リクエストの本文。実行するとこのまま送信されます。",
+ copyBody: "本文をコピー",
+ copyCurl: "cURL としてコピー",
examples: "例",
presetToolApproval: "エージェントのツール呼び出しを承認",
presetPromptInjection: "プロンプトインジェクションの検出",
diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.ts
index ba8b891199b..47e568ca72a 100644
--- a/studio/frontend/src/i18n/locales/ko.ts
+++ b/studio/frontend/src/i18n/locales/ko.ts
@@ -3451,6 +3451,9 @@ export const ko = {
docs: "문서",
docsLabel: "판단 API 문서 열기",
description: "이 컴퓨터의 모델이나 연결의 판단 모델로 텍스트에 대한 예/아니오, 객관식, 점수 질문에 답합니다. TypeSafe SDK와 함께 사용할 수 있습니다.",
+ codeTitle: "코드에서 호출",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "다른 MCP 클라이언트는 같은 토큰으로 여기에 연결합니다.",
enable: "요청 처리",
enableDescription: "/v1/systemone을 제공합니다. 켜면 모델을 다운로드합니다.",
enableRemoteDescription: "/v1/systemone을 제공합니다.",
@@ -5089,6 +5092,8 @@ export const ko = {
removeLevel: "수준 {n} 삭제",
addLevel: "수준 추가",
jsonHelp: "요청 본문입니다. 실행하면 그대로 전송됩니다.",
+ copyBody: "본문 복사",
+ copyCurl: "cURL로 복사",
examples: "예시",
presetToolApproval: "에이전트 도구 호출 승인",
presetPromptInjection: "프롬프트 인젝션 탐지",
diff --git a/studio/frontend/src/i18n/locales/nl.ts b/studio/frontend/src/i18n/locales/nl.ts
index 32fb6934c50..cb2d024e64d 100644
--- a/studio/frontend/src/i18n/locales/nl.ts
+++ b/studio/frontend/src/i18n/locales/nl.ts
@@ -3798,6 +3798,9 @@ export const nl = {
docsLabel: "Documentatie van de Decision API openen",
description:
"Beantwoord ja/nee-, meerkeuze- en scorevragen over tekst met een model op deze computer of een beslissingsmodel uit Verbindingen. Werkt met de TypeSafe SDK.",
+ codeTitle: "Aanroepen vanuit code",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Andere MCP-clients maken hier verbinding met hetzelfde token.",
enable: "Verzoeken verwerken",
enableDescription:
"Biedt /v1/systemone aan. Bij inschakelen wordt het model gedownload.",
@@ -5546,6 +5549,8 @@ export const nl = {
removeLevel: "Niveau {n} verwijderen",
addLevel: "Niveau toevoegen",
jsonHelp: "De request body. Uitvoeren verstuurt deze zoals geschreven.",
+ copyBody: "Body kopiëren",
+ copyCurl: "Kopiëren als cURL",
examples: "Voorbeelden",
presetToolApproval: "Toolaanroepen van agents goedkeuren",
presetPromptInjection: "Promptinjectie detecteren",
diff --git a/studio/frontend/src/i18n/locales/pl.ts b/studio/frontend/src/i18n/locales/pl.ts
index 8b3cd174226..7bb90691f54 100644
--- a/studio/frontend/src/i18n/locales/pl.ts
+++ b/studio/frontend/src/i18n/locales/pl.ts
@@ -3799,6 +3799,9 @@ export const pl = {
docsLabel: "Otwórz dokumentację Decision API",
description:
"Odpowiadaj na pytania tak/nie, wielokrotnego wyboru i punktowe dotyczące tekstu za pomocą modelu na tym komputerze lub modelu decyzyjnego z Połączeń. Działa z TypeSafe SDK.",
+ codeTitle: "Wywołaj z kodu",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Inni klienci MCP łączą się tutaj tym samym tokenem.",
enable: "Obsługuj żądania",
enableDescription:
"Udostępnia /v1/systemone. Włączenie powoduje pobranie modelu.",
@@ -5543,6 +5546,8 @@ export const pl = {
removeLevel: "Usuń poziom {n}",
addLevel: "Dodaj poziom",
jsonHelp: "Treść żądania. Uruchomienie wysyła ją w niezmienionej postaci.",
+ copyBody: "Kopiuj treść",
+ copyCurl: "Kopiuj jako cURL",
examples: "Przykłady",
presetToolApproval: "Zatwierdzanie wywołań narzędzi agenta",
presetPromptInjection: "Wykrywanie wstrzykiwania promptów",
diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.ts
index 8003b82a9dc..c374fa16dc9 100644
--- a/studio/frontend/src/i18n/locales/pt-br.ts
+++ b/studio/frontend/src/i18n/locales/pt-br.ts
@@ -3475,6 +3475,9 @@ export const ptBR = {
docs: "Documentação",
docsLabel: "Abrir a documentação da API de decisões",
description: "Responda a perguntas de sim/não, múltipla escolha e pontuação sobre texto com um modelo neste computador ou um modelo de decisões das Conexões. Funciona com o SDK da TypeSafe.",
+ codeTitle: "Chame pelo código",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Outros clientes MCP se conectam aqui com o mesmo token.",
enable: "Atender solicitações",
enableDescription: "Atende /v1/systemone. Ao ativar, o modelo é baixado.",
enableRemoteDescription: "Atende /v1/systemone.",
@@ -5127,6 +5130,8 @@ export const ptBR = {
removeLevel: "Remover o nível {n}",
addLevel: "Adicionar nível",
jsonHelp: "O corpo da solicitação. Executar envia exatamente como está.",
+ copyBody: "Copiar corpo",
+ copyCurl: "Copiar como cURL",
examples: "Exemplos",
presetToolApproval: "Aprovar chamadas de ferramentas de agentes",
presetPromptInjection: "Detectar injeção de prompt",
diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.ts
index 510210d7471..d3f02113669 100644
--- a/studio/frontend/src/i18n/locales/ru.ts
+++ b/studio/frontend/src/i18n/locales/ru.ts
@@ -3473,6 +3473,9 @@ export const ru = {
docs: "Документация",
docsLabel: "Открыть документацию по API решений",
description: "Отвечайте на вопросы «да/нет», с выбором и с оценкой о тексте с помощью модели на этом компьютере или модели решений из подключений. Работает с SDK TypeSafe.",
+ codeTitle: "Вызов из кода",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Другие клиенты MCP подключаются сюда с тем же токеном.",
enable: "Обрабатывать запросы",
enableDescription: "Обслуживает /v1/systemone. При включении модель скачивается.",
enableRemoteDescription: "Обслуживает /v1/systemone.",
@@ -5126,6 +5129,8 @@ export const ru = {
removeLevel: "Удалить уровень {n}",
addLevel: "Добавить уровень",
jsonHelp: "Тело запроса. Запуск отправляет его как есть.",
+ copyBody: "Копировать тело",
+ copyCurl: "Копировать как cURL",
examples: "Примеры",
presetToolApproval: "Одобрять вызовы инструментов агентом",
presetPromptInjection: "Ловить prompt injection",
diff --git a/studio/frontend/src/i18n/locales/sv.ts b/studio/frontend/src/i18n/locales/sv.ts
index 48458cc17c5..5e19442ae37 100644
--- a/studio/frontend/src/i18n/locales/sv.ts
+++ b/studio/frontend/src/i18n/locales/sv.ts
@@ -3646,6 +3646,9 @@ export const sv = {
docsLabel: "Öppna dokumentationen för Decision API",
description:
"Besvara ja/nej-frågor, flervalsfrågor och poängfrågor om text med en modell på denna dator eller en beslutsmodell från Anslutningar. Fungerar med TypeSafe SDK.",
+ codeTitle: "Anropa från kod",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Andra MCP-klienter ansluter hit med samma token.",
enable: "Hantera begäranden",
enableDescription:
"Hanterar /v1/systemone. När du aktiverar det hämtas modellen.",
@@ -5341,6 +5344,8 @@ export const sv = {
removeLevel: "Ta bort nivå {n}",
addLevel: "Lägg till nivå",
jsonHelp: "Begärans body. Kör skickar den precis som den är.",
+ copyBody: "Kopiera brödtext",
+ copyCurl: "Kopiera som cURL",
examples: "Exempel",
presetToolApproval: "Godkänna agentens verktygsanrop",
presetPromptInjection: "Upptäcka promptinjektion",
diff --git a/studio/frontend/src/i18n/locales/th.ts b/studio/frontend/src/i18n/locales/th.ts
index 711991965c7..2b0234fa4a0 100644
--- a/studio/frontend/src/i18n/locales/th.ts
+++ b/studio/frontend/src/i18n/locales/th.ts
@@ -3594,6 +3594,9 @@ export const th = {
docsLabel: "เปิดเอกสาร Decision API",
description:
"ตอบคำถามแบบใช่/ไม่ใช่ แบบหลายตัวเลือก และแบบให้คะแนนเกี่ยวกับข้อความ ด้วยโมเดลบนเครื่องนี้หรือโมเดลการตัดสินใจจากการเชื่อมต่อ ใช้งานร่วมกับ TypeSafe SDK ได้",
+ codeTitle: "เรียกใช้จากโค้ด",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "ไคลเอนต์ MCP อื่นเชื่อมต่อที่นี่ด้วยโทเค็นเดียวกัน",
enable: "ให้บริการคำขอ",
enableDescription: "ให้บริการ /v1/systemone การเปิดตัวเลือกนี้จะดาวน์โหลดโมเดล",
enableRemoteDescription: "ให้บริการ /v1/systemone",
@@ -5228,6 +5231,8 @@ export const th = {
removeLevel: "นำระดับ {n} ออก",
addLevel: "เพิ่มระดับ",
jsonHelp: "เนื้อหาคำขอ ปุ่ม “รันการตัดสินใจ” จะส่งเนื้อหานี้ตามที่เขียนไว้",
+ copyBody: "คัดลอกเนื้อหา",
+ copyCurl: "คัดลอกเป็น cURL",
examples: "ตัวอย่าง",
presetToolApproval: "อนุมัติการเรียกใช้เครื่องมือของเอเจนต์",
presetPromptInjection: "ตรวจจับ Prompt Injection",
diff --git a/studio/frontend/src/i18n/locales/tr.ts b/studio/frontend/src/i18n/locales/tr.ts
index cc7a1d71a25..85a494ba159 100644
--- a/studio/frontend/src/i18n/locales/tr.ts
+++ b/studio/frontend/src/i18n/locales/tr.ts
@@ -3751,6 +3751,9 @@ export const tr = {
docsLabel: "Karar API'si belgelerini aç",
description:
"Bu makinedeki bir modelle veya Bağlantılar'daki bir karar modeliyle metin hakkında evet/hayır, çoktan seçmeli ve puanlama sorularını yanıtlayın. TypeSafe SDK ile çalışır.",
+ codeTitle: "Koddan çağır",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Diğer MCP istemcileri buraya aynı belirteçle bağlanır.",
enable: "İstekleri sun",
enableDescription:
"/v1/systemone uç noktasını sunar. Açıldığında model indirilir.",
@@ -5487,6 +5490,8 @@ export const tr = {
removeLevel: "Düzey {n} öğesini kaldır",
addLevel: "Düzey ekle",
jsonHelp: "İstek gövdesi. Çalıştır, onu yazıldığı gibi gönderir.",
+ copyBody: "Gövdeyi kopyala",
+ copyCurl: "cURL olarak kopyala",
examples: "Örnekler",
presetToolApproval: "Ajan araç çağrılarını onayla",
presetPromptInjection: "İstem enjeksiyonunu yakala",
diff --git a/studio/frontend/src/i18n/locales/uk.ts b/studio/frontend/src/i18n/locales/uk.ts
index 6ec0d7fb2be..001ae71da17 100644
--- a/studio/frontend/src/i18n/locales/uk.ts
+++ b/studio/frontend/src/i18n/locales/uk.ts
@@ -3784,6 +3784,9 @@ export const uk = {
docsLabel: "Відкрити документацію API рішень",
description:
"Відповідайте на запитання «так/ні», з кількома варіантами та з оцінкою щодо тексту за допомогою моделі на цьому комп’ютері або моделі рішень із розділу «Підключення». Працює з TypeSafe SDK.",
+ codeTitle: "Виклик із коду",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Інші клієнти MCP підключаються сюди з тим самим токеном.",
enable: "Обслуговувати запити",
enableDescription:
"Обслуговує /v1/systemone. Увімкнення завантажує модель.",
@@ -5535,6 +5538,8 @@ export const uk = {
removeLevel: "Вилучити рівень {n}",
addLevel: "Додати рівень",
jsonHelp: "Тіло запиту. «Виконати» надсилає його без змін.",
+ copyBody: "Копіювати тіло",
+ copyCurl: "Копіювати як cURL",
examples: "Приклади",
presetToolApproval: "Схвалювати виклики інструментів агентом",
presetPromptInjection: "Виявляти ін’єкції в запити",
diff --git a/studio/frontend/src/i18n/locales/vi.ts b/studio/frontend/src/i18n/locales/vi.ts
index 0e52826ad4f..f0d5a50848c 100644
--- a/studio/frontend/src/i18n/locales/vi.ts
+++ b/studio/frontend/src/i18n/locales/vi.ts
@@ -3754,6 +3754,9 @@ export const vi = {
docsLabel: "Mở tài liệu API quyết định",
description:
"Trả lời các câu hỏi có/không, trắc nghiệm và chấm điểm về văn bản bằng một mô hình trên máy này hoặc một mô hình quyết định từ Kết nối. Hoạt động với TypeSafe SDK.",
+ codeTitle: "Gọi từ mã",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "Các ứng dụng MCP khác kết nối tại đây bằng cùng một token.",
enable: "Phục vụ yêu cầu",
enableDescription:
"Phục vụ /v1/systemone. Khi bật, mô hình sẽ được tải xuống.",
@@ -5491,6 +5494,8 @@ export const vi = {
removeLevel: "Xóa mức {n}",
addLevel: "Thêm mức",
jsonHelp: "Nội dung yêu cầu. Nút Chạy sẽ gửi đúng như những gì đã viết.",
+ copyBody: "Sao chép nội dung",
+ copyCurl: "Sao chép dưới dạng cURL",
examples: "Ví dụ",
presetToolApproval: "Phê duyệt lệnh gọi công cụ của tác tử",
presetPromptInjection: "Phát hiện tấn công chèn lời nhắc",
diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.ts
index e8b516b9d5e..f3576af859c 100644
--- a/studio/frontend/src/i18n/locales/zh-CN.ts
+++ b/studio/frontend/src/i18n/locales/zh-CN.ts
@@ -3407,6 +3407,9 @@ export const zhCN = {
docs: "文档",
docsLabel: "打开决策 API 文档",
description: "使用本机模型或连接中的决策模型回答关于文本的是/否、选择和评分问题。可配合 TypeSafe SDK 使用。",
+ codeTitle: "通过代码调用",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "其他 MCP 客户端使用同一令牌连接到此处。",
enable: "处理请求",
enableDescription: "提供 /v1/systemone。开启后会下载模型。",
enableRemoteDescription: "提供 /v1/systemone。",
@@ -5000,6 +5003,8 @@ export const zhCN = {
removeLevel: "移除等级 {n}",
addLevel: "添加等级",
jsonHelp: "请求正文。运行时会按原样发送。",
+ copyBody: "复制请求体",
+ copyCurl: "复制为 cURL",
examples: "示例",
presetToolApproval: "审批智能体的工具调用",
presetPromptInjection: "识别提示词注入",
diff --git a/studio/frontend/src/i18n/locales/zh-TW.ts b/studio/frontend/src/i18n/locales/zh-TW.ts
index 02090c74953..881e55482ef 100644
--- a/studio/frontend/src/i18n/locales/zh-TW.ts
+++ b/studio/frontend/src/i18n/locales/zh-TW.ts
@@ -3571,6 +3571,9 @@ export const zhTW = {
docsLabel: "開啟決策 API 文件",
description:
"使用此電腦上的模型或「連線」中的決策模型,回答與文字相關的是非題、選擇題和評分題。可搭配 TypeSafe SDK 使用。",
+ codeTitle: "透過程式碼呼叫",
+ mcpUrl: "MCP URL",
+ mcpUrlDescription: "其他 MCP 用戶端使用同一權杖連線到此處。",
enable: "處理請求",
enableDescription: "提供 /v1/systemone 服務。開啟後會下載模型。",
enableRemoteDescription: "提供 /v1/systemone 服務。",
@@ -5185,6 +5188,8 @@ export const zhTW = {
removeLevel: "移除等級 {n}",
addLevel: "新增等級",
jsonHelp: "請求本文。執行時會依原樣傳送。",
+ copyBody: "複製請求內容",
+ copyCurl: "複製為 cURL",
examples: "範例",
presetToolApproval: "核准代理程式工具呼叫",
presetPromptInjection: "偵測提示詞注入",
diff --git a/studio/frontend/tests/api-settings-tab.test.ts b/studio/frontend/tests/api-settings-tab.test.ts
index b5800e03462..caa705bbdff 100644
--- a/studio/frontend/tests/api-settings-tab.test.ts
+++ b/studio/frontend/tests/api-settings-tab.test.ts
@@ -64,7 +64,7 @@ test("one tab row holds every example, with no jump links above it; Agents opens
/<UsageExamples\s+part="chat"/,
/<MediaApiExamples[^>]*showHeading=\{false\}/,
/<AudioApiExamples[^>]*showHeading=\{false\}/,
- /<DecisionApiSection showHeading=\{false\} \/>/,
+ /<DecisionApiSection[^>]*showHeading=\{false\}/,
]) {
assert.match(tabs, card);
}
@@ -107,8 +107,10 @@ test("keyless API access is edited on Remote & LAN; the API tab links there and
const remoteLan = readSrc("features/settings/tabs/remote-lan-tab.tsx");
assert.match(remoteLan, /scrollTarget !== "remote-lan-keyless"/);
assert.match(remoteLan, /<div ref=\{keylessRef\}>\s*<KeylessApiAccessSection \/>/);
- assert.match(TAB, /loadKeylessApiAccess\(\)/);
- assert.match(TAB, /scope: next\.suspendedByAccounts \? "off" : next\.scope/);
+ assert.match(TAB, /useKeylessExampleAccess\(isOwner\)/);
+ const hook = readSrc("features/settings/hooks/use-keyless-example-access.ts");
+ assert.match(hook, /loadKeylessApiAccess\(\)/);
+ assert.match(hook, /scope: next\.suspendedByAccounts \? "off" : next\.scope/);
assert.doesNotMatch(TAB, /<KeylessApiAccessSection/);
});
diff --git a/studio/frontend/tests/decision-api-examples.test.ts b/studio/frontend/tests/decision-api-examples.test.ts
new file mode 100644
index 00000000000..9caf2d74c1f
--- /dev/null
+++ b/studio/frontend/tests/decision-api-examples.test.ts
@@ -0,0 +1,118 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import {
+ buildDecisionApiSnippet,
+ buildDecisionCurl,
+ decisionApiKey,
+ decisionMcpUrl,
+} from "../src/features/settings/components/decision-api-snippets.ts";
+import { en } from "../src/i18n/locales/en.ts";
+import { readSrc } from "./helpers/kit.ts";
+
+const BASE = "https://studio.example.com";
+const KEY = "sk-unsloth-abc";
+const LOCALES = [
+ "ar", "cs", "de", "es-419", "es", "fa", "fr", "he", "hi", "id", "it", "ja", "ko",
+ "nl", "pl", "pt-br", "ru", "sv", "th", "tr", "uk", "vi", "zh-CN", "zh-TW",
+];
+
+test("the Decision tab and the API Monitor pass the key and tunnel to the section", () => {
+ assert.match(
+ readSrc("features/settings/components/api-example-tabs.tsx"),
+ /<DecisionApiSection\s+apiKey=\{apiKey\}\s+useTunnel=\{useTunnel\}\s+showHeading=\{false\}\s+\{\.\.\.keyless\}/,
+ );
+ assert.match(
+ readSrc("features/api-monitor/api-monitor-page.tsx"),
+ /<DecisionApiSection\s+apiKey=\{freshKey\}\s+useTunnel=\{useTunnel\}/,
+ );
+});
+
+test("the API Monitor's examples follow the keyless policy, as the Settings tab's do", () => {
+ const monitor = readSrc("features/api-monitor/api-monitor-page.tsx");
+ assert.match(monitor, /useKeylessExampleAccess\(isOwner\)/);
+ for (const section of ["MediaApiExamples", "AudioApiExamples", "DecisionApiSection"]) {
+ assert.match(monitor, new RegExp(`<${section}[^>]*\\{\\.\\.\\.keyless\\}`), section);
+ }
+ assert.match(readSrc("features/settings/tabs/api-keys-tab.tsx"), /useKeylessExampleAccess\(isOwner\)/);
+ assert.match(
+ readSrc("features/settings/hooks/use-keyless-example-access.ts"),
+ /\}, \[isOwner, cloudflareUrl, settingsOpen\]\);/,
+ );
+});
+
+test("the section shows examples and the MCP URL on the host in use", () => {
+ const section = readSrc("features/settings/components/decision-api-section.tsx");
+ assert.match(section, /<ApiExampleBox/);
+ assert.match(section, /<UrlPill url=\{decisionMcpUrl\(base, settings\.mcpUrl\)\}/);
+ assert.equal(
+ decisionMcpUrl(BASE, "http://127.0.0.1:8888/mcp/decisions/"),
+ `${BASE}/mcp/decisions/`,
+ );
+});
+
+test("Try's JSON view copies the edited body, raw and as cURL", () => {
+ const dialog = readSrc("features/settings/components/decision-try-dialog.tsx");
+ assert.match(dialog, /label=\{t\("decisions\.copyBody"\)\}\s+text=\{jsonText\}/);
+ assert.match(
+ dialog,
+ /label=\{t\("decisions\.copyCurl"\)\}\s+text=\{buildDecisionCurl\(\{\s+\.\.\.curlTarget,\s+body: jsonText,/,
+ );
+});
+
+test("curl posts a valid body to the Decision route", () => {
+ const snippet = buildDecisionApiSnippet({ base: BASE, apiKey: KEY, language: "curl", os: "unix" });
+ assert.match(snippet, /^curl https:\/\/studio\.example\.com\/v1\/systemone \\/);
+ assert.match(snippet, /Authorization: Bearer sk-unsloth-abc/);
+ const body = JSON.parse(snippet.slice(snippet.indexOf("'") + 1, snippet.lastIndexOf("'")));
+ assert.equal(body.model, "default");
+ assert.equal(body.questions.category.type, "choice");
+});
+
+test("the SDK examples use the SDK's own names and a base without /v1, which it adds itself", () => {
+ const python = buildDecisionApiSnippet({ base: BASE, apiKey: KEY, language: "python", os: "unix" });
+ assert.match(python, /pip install typesafe-sdk/);
+ assert.match(python, /from typesafe_sdk import Choice, TypeSafeClient/);
+ assert.match(python, /TypeSafeClient\(base_url="https:\/\/studio\.example\.com", api_key="sk-unsloth-abc"\)/);
+ assert.match(python, /client\.system_one\(/);
+
+ const js = buildDecisionApiSnippet({ base: BASE, apiKey: KEY, language: "javascript", os: "unix" });
+ assert.match(js, /npm install @typesafe-ai\/sdk/);
+ assert.match(js, /baseURL: "https:\/\/studio\.example\.com",\n {2}apiKey: "sk-unsloth-abc"/);
+ assert.match(js, /client\.systemOne\(/);
+});
+
+test("a body with quotes survives each shell", () => {
+ const body = JSON.stringify({ state: "it's café" });
+ assert.match(
+ buildDecisionCurl({ base: BASE, apiKey: KEY, body, os: "unix" }),
+ /-d '\{"state":"it'\\''s café"\}'$/,
+ );
+ const windows = buildDecisionCurl({ base: BASE, apiKey: KEY, body, os: "windows" });
+ assert.ok(windows.startsWith(`$body = '{"state":"it''s caf\\u00e9"}'\n`));
+ assert.match(windows, /curl\.exe https:\/\/studio\.example\.com\/v1\/systemone `/);
+});
+
+test("the key shown is the real one, keyless only where it works, else the placeholder", () => {
+ const local = { base: "http://127.0.0.1:8888", tunnel: false, exposure: null };
+ assert.equal(decisionApiKey(KEY, { ...local, scope: "off" }), KEY);
+ assert.equal(decisionApiKey(null, { ...local, scope: "inference" }), "not-needed");
+ assert.equal(decisionApiKey(null, { ...local, scope: "off" }), "sk-unsloth-YOUR_KEY");
+ assert.equal(
+ decisionApiKey(null, { ...local, tunnel: true, scope: "inference" }),
+ "sk-unsloth-YOUR_KEY",
+ );
+});
+
+test("the new strings exist in every locale", () => {
+ assert.ok(en.settings.apiKeys.decisionApi.codeTitle);
+ for (const locale of LOCALES) {
+ const source = readSrc(`i18n/locales/${locale}.ts`);
+ for (const key of ["codeTitle", "mcpUrl", "mcpUrlDescription", "copyBody", "copyCurl"]) {
+ assert.match(source, new RegExp(`\\n\\s+${key}: "`), `${locale} ${key}`);
+ }
+ }
+});
diff --git a/studio/frontend/tests/decision-api-section.test.ts b/studio/frontend/tests/decision-api-section.test.ts
index 52ad13f10d1..6cb93119cb1 100644
--- a/studio/frontend/tests/decision-api-section.test.ts
+++ b/studio/frontend/tests/decision-api-section.test.ts
@@ -22,7 +22,7 @@ const API_TAB = read("../src/features/settings/tabs/api-keys-tab.tsx");
test("the API tab renders the section and search finds it", () => {
const tabs = read("../src/features/settings/components/api-example-tabs.tsx");
assert.match(API_TAB, /<ApiExamplesPanel/);
- assert.match(tabs, /<DecisionApiSection showHeading=\{false\} \/>/);
+ assert.match(tabs, /<DecisionApiSection[\s\S]*?showHeading=\{false\}/);
assert.match(tabs, /searchLabel: "settings\.apiKeys\.decisionApi\.title"/);
assert.match(tabs, /data-settings-label=\{\s*entry\.searchLabel \? t\(entry\.searchLabel\) : undefined\s*\}/);
assert.ok(