Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
feat: show user-defined provider labels and full API key names (#121)
diegosouzapwd55b6e0b7a9f
diff --git a/src/app/(dashboard)/dashboard/combos/page.tsx b/src/app/(dashboard)/dashboard/combos/page.tsxindex f0ac3c7a5a..2ed2fb211e 100644--- a/src/app/(dashboard)/dashboard/combos/page.tsx+++ b/src/app/(dashboard)/dashboard/combos/page.tsx@@ -46,6 +46,7 @@ export default function CombosPage() {const notify = useNotificationStore();const [proxyTargetCombo, setProxyTargetCombo] = useState(null);const [proxyConfig, setProxyConfig] = useState(null);+ const [providerNodes, setProviderNodes] = useState([]);useEffect(() => {fetchData();@@ -57,14 +58,16 @@ export default function CombosPage() {const fetchData = async () => {try {- const [combosRes, providersRes, metricsRes] = await Promise.all([+ const [combosRes, providersRes, metricsRes, nodesRes] = await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/combos/metrics"),+ fetch("/api/provider-nodes"),]);const combosData = await combosRes.json();const providersData = await providersRes.json();const metricsData = await metricsRes.json();+ const nodesData = nodesRes.ok ? await nodesRes.json() : { nodes: [] };if (combosRes.ok) setCombos(combosData.combos || []);if (providersRes.ok) {@@ -74,6 +77,7 @@ export default function CombosPage() {setActiveProviders(active);}if (metricsRes.ok) setMetrics(metricsData.metrics || {});+ setProviderNodes(nodesData.nodes || []);} catch (error) {console.log("Error fetching data:", error);} finally {@@ -230,6 +234,7 @@ export default function CombosPage() {key={combo.id}combo={combo}metrics={metrics[combo.name]}+ providerNodes={providerNodes}copied={copied}onCopy={copy}onEdit={() => setEditingCombo(combo)}@@ -309,11 +314,23 @@ function ComboCard({onProxy,hasProxy,onToggle,+ providerNodes,}) {const strategy = combo.strategy || "priority";const models = combo.models || [];const isDisabled = combo.isActive === false;+ // Resolve provider UUID to user-defined name+ const formatModelDisplay = (modelValue) => {+ const parts = modelValue.split("/");+ if (parts.length !== 2) return modelValue;+ const [providerIdentifier, modelId] = parts;+ const matchedNode = (providerNodes || []).find(+ (node) => node.id === providerIdentifier || node.prefix === providerIdentifier+ );+ return matchedNode ? `${matchedNode.name}/${modelId}` : modelValue;+ };+return (<Card padding="sm" className={`group ${isDisabled ? "opacity-50" : ""}`}><div className="flex items-center justify-between">@@ -378,7 +395,7 @@ function ComboCard({key={index}className="text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted">- {model}+ {formatModelDisplay(model)}{strategy === "weighted" && weight > 0 ? ` (${weight}%)` : ""}</code>);diff --git a/src/shared/components/RequestLoggerV2.tsx b/src/shared/components/RequestLoggerV2.tsxindex 3ef5297aca..41977b5fd6 100644--- a/src/shared/components/RequestLoggerV2.tsx+++ b/src/shared/components/RequestLoggerV2.tsx@@ -43,29 +43,32 @@ const DEFAULT_VISIBLE = Object.fromEntries(COLUMNS.map((c) => [c.key, true]));/*** Get a friendly display label for compatible providers.* Converts long IDs like "openai-compatible-chat-02669115-2545-4896-b003-cb4dac09d441"- * to readable labels like "OAI-Compat".+ * to readable labels. If providerNodes are available, uses user-defined name;+ * otherwise falls back to "OAI-Compat".*/-function getProviderDisplayLabel(provider: string): string {+function getProviderDisplayLabel(provider: string, providerNodes?: any[]): string {if (!provider) return "-";- if (provider.startsWith("openai-compatible-")) {- // Extract the "chat" or custom-name part after the prefix- const suffix = provider.replace("openai-compatible-", "");- // If it's just "chat-<uuid>", show "OAI-Compat"- // If it has a meaningful name, include it- const parts = suffix.split("-");- if (parts.length > 1 && parts[1]?.length >= 8) {- // Looks like chat-<uuid>, just show category- return `OAI-COMPAT`;+ if (provider.startsWith("openai-compatible-") || provider.startsWith("anthropic-compatible-")) {+ // Try to find user-defined name from provider nodes+ if (providerNodes?.length) {+ const matchedNode = providerNodes.find(+ (node) => node.id === provider || node.prefix === provider+ );+ if (matchedNode?.name) return matchedNode.name;}- return `OAI: ${suffix.slice(0, 16).toUpperCase()}`;- }- if (provider.startsWith("anthropic-compatible-")) {- const suffix = provider.replace("anthropic-compatible-", "");- const parts = suffix.split("-");- if (parts.length > 1 && parts[1]?.length >= 8) {- return `ANT-COMPAT`;+ // Fallback to generic labels+ if (provider.startsWith("openai-compatible-")) {+ const suffix = provider.replace("openai-compatible-", "");+ const parts = suffix.split("-");+ if (parts.length > 1 && parts[1]?.length >= 8) return `OAI-COMPAT`;+ return `OAI: ${suffix.slice(0, 16).toUpperCase()}`;+ }+ if (provider.startsWith("anthropic-compatible-")) {+ const suffix = provider.replace("anthropic-compatible-", "");+ const parts = suffix.split("-");+ if (parts.length > 1 && parts[1]?.length >= 8) return `ANT-COMPAT`;+ return `ANT: ${suffix.slice(0, 16).toUpperCase()}`;}- return `ANT: ${suffix.slice(0, 16).toUpperCase()}`;}return null; // Not a compatible provider, use default PROVIDER_COLORS}@@ -90,6 +93,7 @@ export default function RequestLoggerV2() {const [detailData, setDetailData] = useState(null);const intervalRef = useRef(null);const hasLoadedRef = useRef(false);+ const [providerNodes, setProviderNodes] = useState([]);// Column visibility with localStorage persistenceconst [visibleColumns, setVisibleColumns] = useState(() => {@@ -147,6 +151,14 @@ export default function RequestLoggerV2() {fetchLogs(showLoading);}, [fetchLogs]);+ // Fetch provider nodes for display labels+ useEffect(() => {+ fetch("/api/provider-nodes")+ .then((r) => (r.ok ? r.json() : { nodes: [] }))+ .then((d) => setProviderNodes(d.nodes || []))+ .catch(() => {});+ }, []);+// Auto-refreshuseEffect(() => {if (intervalRef.current) clearInterval(intervalRef.current);@@ -299,7 +311,7 @@ export default function RequestLoggerV2() {><option value="">All Providers</option>{uniqueProviders.map((p) => {- const compatLabel = getProviderDisplayLabel(p);+ const compatLabel = getProviderDisplayLabel(p, providerNodes);const pc = PROVIDER_COLORS[p];return (<option key={p} value={p}>@@ -441,7 +453,7 @@ export default function RequestLoggerV2() {{/* Dynamic Provider Quick Filters (from data) */}{uniqueProviders.map((p) => {- const compatLabel = getProviderDisplayLabel(p);+ const compatLabel = getProviderDisplayLabel(p, providerNodes);const pc = PROVIDER_COLORS[p] || {bg: "#374151",text: "#fff",@@ -575,7 +587,7 @@ export default function RequestLoggerV2() {text: "#fff",label: (protocolKey || log.provider || "-").toUpperCase(),};- const compatLabel = getProviderDisplayLabel(log.provider);+ const compatLabel = getProviderDisplayLabel(log.provider, providerNodes);const providerColor = PROVIDER_COLORS[log.provider] || {bg: "#374151",text: "#fff",diff --git a/src/shared/utils/formatting.ts b/src/shared/utils/formatting.tsindex 10063528f8..d9113614c9 100644--- a/src/shared/utils/formatting.ts+++ b/src/shared/utils/formatting.ts@@ -80,16 +80,16 @@ export function maskAccount(account) {}/**- * Format an API key label, masking both name and ID.+ * Format an API key label, showing full name but masking the ID.* @param {string} apiKeyName - Human-readable name of the key* @param {string} apiKeyId - Unique ID of the key* @returns {string}*/export function formatApiKeyLabel(apiKeyName, apiKeyId) {if (!apiKeyName && !apiKeyId) return "—";- const maskedName = apiKeyName ? maskSegment(apiKeyName, 2, 1) : "key";- if (!apiKeyId) return maskedName;- return `${maskedName} (${maskSegment(apiKeyId, 4, 4)})`;+ const displayName = apiKeyName || "key";+ if (!apiKeyId) return displayName;+ return `${displayName} (${maskSegment(apiKeyId, 4, 4)})`;}/**