Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

feat(transcription): add xAI speech-to-text provider (#942)

Alcahest82892cd328e1
diff --git a/preload.js b/preload.js
index cb76aa222..4005a6ccf 100644
--- a/preload.js
+++ b/preload.js
@@ -354,6 +354,11 @@ contextBridge.exposeInMainWorld("electronAPI", {
getGroqKey: () => ipcRenderer.invoke("get-groq-key"),
saveGroqKey: (key) => ipcRenderer.invoke("save-groq-key", key),
+ // xAI API
+ getXaiKey: () => ipcRenderer.invoke("get-xai-key"),
+ saveXaiKey: (key) => ipcRenderer.invoke("save-xai-key", key),
+ proxyXaiTranscription: (data) => ipcRenderer.invoke("proxy-xai-transcription", data),
+
// Mistral API
getMistralKey: () => ipcRenderer.invoke("get-mistral-key"),
saveMistralKey: (key) => ipcRenderer.invoke("save-mistral-key", key),
diff --git a/src/assets/icons/providers/xai.svg b/src/assets/icons/providers/xai.svg
new file mode 100644
index 000000000..a43359823
--- /dev/null
+++ b/src/assets/icons/providers/xai.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>xAI</title><path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"></path></svg>
diff --git a/src/components/OnboardingFlow.tsx b/src/components/OnboardingFlow.tsx
index 5fd936807..bf2c9c88d 100644
--- a/src/components/OnboardingFlow.tsx
+++ b/src/components/OnboardingFlow.tsx
@@ -84,6 +84,7 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
cloudTranscriptionBaseUrl,
openaiApiKey,
groqApiKey,
+ xaiApiKey,
mistralApiKey,
dictationKey,
activationMode,
@@ -698,6 +699,8 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
return openaiApiKey.trim().length > 0;
} else if (cloudTranscriptionProvider === "groq") {
return groqApiKey.trim().length > 0;
+ } else if (cloudTranscriptionProvider === "xai") {
+ return xaiApiKey.trim().length > 0;
} else if (cloudTranscriptionProvider === "mistral") {
return mistralApiKey.trim().length > 0;
} else if (cloudTranscriptionProvider === "custom") {
diff --git a/src/components/TranscriptionModelPicker.tsx b/src/components/TranscriptionModelPicker.tsx
index 4c80c5c52..125eac3d8 100644
--- a/src/components/TranscriptionModelPicker.tsx
+++ b/src/components/TranscriptionModelPicker.tsx
@@ -202,6 +202,7 @@ interface TranscriptionModelPickerProps {
const CLOUD_PROVIDER_TABS = [
{ id: "openai", name: "OpenAI" },
{ id: "groq", name: "Groq" },
+ { id: "xai", name: "xAI" },
{ id: "mistral", name: "Mistral" },
{ id: "corti", name: "Corti" },
{ id: "custom", name: "Custom" },
@@ -211,6 +212,7 @@ interface ProviderCredentialField {
key:
| "openaiApiKey"
| "groqApiKey"
+ | "xaiApiKey"
| "mistralApiKey"
| "cortiClientId"
| "cortiClientSecret"
@@ -234,6 +236,10 @@ const PROVIDER_CREDENTIALS: Record<
consoleUrl: "https://console.groq.com/keys",
fields: [{ key: "groqApiKey", input: "secret" }],
},
+ xai: {
+ consoleUrl: "https://console.x.ai",
+ fields: [{ key: "xaiApiKey", input: "secret" }],
+ },
mistral: {
consoleUrl: "https://console.mistral.ai/api-keys",
fields: [{ key: "mistralApiKey", input: "secret" }],
@@ -328,6 +334,8 @@ export default function TranscriptionModelPicker({
const setOpenaiApiKey = useSettingsStore((s) => s.setOpenaiApiKey);
const groqApiKey = useSettingsStore((s) => s.groqApiKey);
const setGroqApiKey = useSettingsStore((s) => s.setGroqApiKey);
+ const xaiApiKey = useSettingsStore((s) => s.xaiApiKey);
+ const setXaiApiKey = useSettingsStore((s) => s.setXaiApiKey);
const mistralApiKey = useSettingsStore((s) => s.mistralApiKey);
const setMistralApiKey = useSettingsStore((s) => s.setMistralApiKey);
const cortiClientId = useSettingsStore((s) => s.cortiClientId);
@@ -700,6 +708,7 @@ export default function TranscriptionModelPicker({
const credentialValues: Record<ProviderCredentialField["key"], string> = {
openaiApiKey,
groqApiKey,
+ xaiApiKey,
mistralApiKey,
cortiClientId,
cortiClientSecret,
@@ -709,6 +718,7 @@ export default function TranscriptionModelPicker({
const credentialSetters: Record<ProviderCredentialField["key"], (value: string) => void> = {
openaiApiKey: setOpenaiApiKey,
groqApiKey: setGroqApiKey,
+ xaiApiKey: setXaiApiKey,
mistralApiKey: setMistralApiKey,
cortiClientId: setCortiClientId,
cortiClientSecret: setCortiClientSecret,
diff --git a/src/components/notes/UploadAudioView.tsx b/src/components/notes/UploadAudioView.tsx
index 90576a9a3..74e09755e 100644
--- a/src/components/notes/UploadAudioView.tsx
+++ b/src/components/notes/UploadAudioView.tsx
@@ -117,6 +117,7 @@ export default function UploadAudioView({ onNoteCreated, onOpenSettings }: Uploa
setCloudTranscriptionMode,
openaiApiKey,
groqApiKey,
+ xaiApiKey,
mistralApiKey,
customTranscriptionApiKey,
updateTranscriptionSettings,
@@ -205,9 +206,11 @@ export default function UploadAudioView({ onNoteCreated, onOpenSettings }: Uploa
? openaiApiKey
: cloudTranscriptionProvider === "groq"
? groqApiKey
- : cloudTranscriptionProvider === "mistral"
- ? mistralApiKey
- : customTranscriptionApiKey;
+ : cloudTranscriptionProvider === "xai"
+ ? xaiApiKey
+ : cloudTranscriptionProvider === "mistral"
+ ? mistralApiKey
+ : customTranscriptionApiKey;
if (!cancelled) setProviderReady(!!key);
}
return;
@@ -238,6 +241,7 @@ export default function UploadAudioView({ onNoteCreated, onOpenSettings }: Uploa
cloudTranscriptionBaseUrl,
openaiApiKey,
groqApiKey,
+ xaiApiKey,
mistralApiKey,
customTranscriptionApiKey,
cortiClientId,
@@ -264,6 +268,8 @@ export default function UploadAudioView({ onNoteCreated, onOpenSettings }: Uploa
return openaiApiKey;
case "groq":
return groqApiKey;
+ case "xai":
+ return xaiApiKey;
case "mistral":
return mistralApiKey;
case "custom":
diff --git a/src/components/ui/ProviderIcon.tsx b/src/components/ui/ProviderIcon.tsx
index 766477a7e..6b2ebcceb 100644
--- a/src/components/ui/ProviderIcon.tsx
+++ b/src/components/ui/ProviderIcon.tsx
@@ -1,13 +1,11 @@
import { Brain, Wrench, HardDrive } from "lucide-react";
-import { getProviderIcon } from "@/utils/providerIcons";
+import { getProviderIcon, isMonochromeProvider } from "@/utils/providerIcons";
interface ProviderIconProps {
provider: string;
className?: string;
}
-const MONOCHROME_PROVIDERS = ["openai", "whisper", "anthropic", "openai-oss"];
-
export function ProviderIcon({ provider, className = "w-5 h-5" }: ProviderIconProps) {
if (provider === "custom") {
return <Wrench className={className} />;
@@ -23,7 +21,7 @@ export function ProviderIcon({ provider, className = "w-5 h-5" }: ProviderIconPr
return <Brain className={className} />;
}
- const isMonochrome = MONOCHROME_PROVIDERS.includes(provider);
+ const isMonochrome = isMonochromeProvider(provider);
return (
<img
diff --git a/src/config/constants.ts b/src/config/constants.ts
index 050904431..8a171ded9 100644
--- a/src/config/constants.ts
+++ b/src/config/constants.ts
@@ -75,6 +75,7 @@ export const API_ENDPOINTS = {
ANTHROPIC: "https://api.anthropic.com/v1/messages",
GEMINI: "https://generativelanguage.googleapis.com/v1beta",
GROQ_BASE: "https://api.groq.com/openai/v1",
+ XAI_BASE: "https://api.x.ai/v1",
MISTRAL_BASE: "https://api.mistral.ai/v1",
TRANSCRIPTION_BASE: DEFAULT_TRANSCRIPTION_BASE,
TRANSCRIPTION: buildApiUrl(DEFAULT_TRANSCRIPTION_BASE, "/audio/transcriptions"),
diff --git a/src/helpers/audioManager.js b/src/helpers/audioManager.js
index 5fd8b2b69..b2c309732 100644
--- a/src/helpers/audioManager.js
+++ b/src/helpers/audioManager.js
@@ -67,6 +67,7 @@ function resolveReasoningRoute(text, settings, agentName) {
const PLACEHOLDER_KEYS = {
openai: "your_openai_api_key_here",
groq: "your_groq_api_key_here",
+ xai: "your_xai_api_key_here",
mistral: "your_mistral_api_key_here",
};
@@ -955,6 +956,18 @@ registerProcessor("pcm-streaming-processor", PCMStreamingProcessor);
err.code = "API_KEY_MISSING";
throw err;
}
+ } else if (provider === "xai") {
+ apiKey = s.xaiApiKey;
+ if (!isValidApiKey(apiKey, "xai")) {
+ apiKey = await window.electronAPI.getXaiKey?.();
+ }
+ if (!isValidApiKey(apiKey, "xai")) {
+ const err = new Error(
+ "xAI API key not found. Please set your API key in the Control Panel."
+ );
+ err.code = "API_KEY_MISSING";
+ throw err;
+ }
} else {
// Default to OpenAI
// Prefer store value (user-entered via UI) over main process (.env)
@@ -1561,6 +1574,7 @@ registerProcessor("pcm-streaming-processor", PCMStreamingProcessor);
provider === "custom" ||
(!endpoint.includes("api.openai.com") &&
!endpoint.includes("api.groq.com") &&
+ !endpoint.includes("api.x.ai") &&
!endpoint.includes("api.mistral.ai"));
const apiCallStart = performance.now();
@@ -1601,6 +1615,39 @@ registerProcessor("pcm-streaming-processor", PCMStreamingProcessor);
throw new Error("No text transcribed - Mistral response was empty");
}
+ // xAI STT has a non-OpenAI-compatible API — proxy through main process. See #910.
+ if (provider === "xai" && window.electronAPI?.proxyXaiTranscription) {
+ const audioBuffer = await optimizedAudio.arrayBuffer();
+ const proxyData = { audioBuffer, language: language !== "auto" ? language : undefined };
+
+ const keyterms = this.getKeyterms()
+ .map((t) => t.trim().slice(0, 50))
+ .filter(Boolean)
+ .slice(0, 100);
+ if (keyterms.length > 0) {
+ proxyData.keyterms = keyterms;
+ }
+
+ const result = await window.electronAPI.proxyXaiTranscription(proxyData);
+ const proxyText = result?.text;
+
+ if (proxyText && proxyText.trim().length > 0) {
+ if (this.isDictionaryEcho(proxyText)) {
+ throw new Error("No audio detected");
+ }
+ timings.transcriptionProcessingDurationMs = Math.round(performance.now() - apiCallStart);
+ const rawText = proxyText;
+ const reasoningStart = performance.now();
+ const text = await this.processTranscription(proxyText, "xai");
+ timings.reasoningProcessingDurationMs = Math.round(performance.now() - reasoningStart);
+
+ const source = (await this.isReasoningAvailable()) ? "xai-reasoned" : "xai";
+ return { success: true, text, rawText, source, timings };
+ }
+
+ throw new Error("No text transcribed - xAI response was empty");
+ }
+
// Corti uses OAuth client credentials and an interaction-based REST flow — proxy through main process
if (provider === "corti" && window.electronAPI?.proxyCortiTranscription) {
const audioBuffer = await optimizedAudio.arrayBuffer();
@@ -1881,6 +1928,7 @@ registerProcessor("pcm-streaming-processor", PCMStreamingProcessor);
// Return provider-appropriate default
if (provider === "groq") return "whisper-large-v3-turbo";
+ if (provider === "xai") return "grok-stt";
if (provider === "mistral") return "voxtral-mini-latest";
if (provider === "corti") return "corti-transcribe";
return "gpt-4o-mini-transcribe";
@@ -1935,6 +1983,8 @@ registerProcessor("pcm-streaming-processor", PCMStreamingProcessor);
base = currentBaseUrl.trim() || API_ENDPOINTS.TRANSCRIPTION_BASE;
} else if (currentProvider === "groq") {
base = API_ENDPOINTS.GROQ_BASE;
+ } else if (currentProvider === "xai") {
+ base = API_ENDPOINTS.XAI_BASE;
} else if (currentProvider === "mistral") {
base = API_ENDPOINTS.MISTRAL_BASE;
} else {
diff --git a/src/helpers/environment.js b/src/helpers/environment.js
index 847a640a1..172ddbc93 100644
--- a/src/helpers/environment.js
+++ b/src/helpers/environment.js
@@ -11,6 +11,7 @@ const SECRET_KEYS = [
"ANTHROPIC_API_KEY",
"GEMINI_API_KEY",
"GROQ_API_KEY",
+ "XAI_API_KEY",
"MISTRAL_API_KEY",
"ASSEMBLYAI_API_KEY",
"DEEPGRAM_API_KEY",
@@ -294,6 +295,14 @@ class EnvironmentManager {
return this._saveKey("GROQ_API_KEY", key);
}
+ getXaiKey() {
+ return this._getKey("XAI_API_KEY");
+ }
+
+ saveXaiKey(key) {
+ return this._saveKey("XAI_API_KEY", key);
+ }
+
getMistralKey() {
return this._getKey("MISTRAL_API_KEY");
}
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 101c42bab..ecaedf00b 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -68,6 +68,37 @@ function parseAttendees(raw) {
const MISTRAL_TRANSCRIPTION_URL = "https://api.mistral.ai/v1/audio/transcriptions";
+const XAI_STT_URL = "https://api.x.ai/v1/stt";
+
+// xAI STT supports 25 languages; language must be in this set to enable ITN via format=true
+const XAI_STT_LANGUAGES = new Set([
+ "ar",
+ "cs",
+ "da",
+ "de",
+ "en",
+ "es",
+ "fa",
+ "fil",
+ "fr",
+ "hi",
+ "id",
+ "it",
+ "ja",
+ "ko",
+ "mk",
+ "ms",
+ "nl",
+ "pl",
+ "pt",
+ "ro",
+ "ru",
+ "sv",
+ "th",
+ "tr",
+ "vi",
+]);
+
// Debounce delay: wait for user to stop typing before processing corrections
const AUTO_LEARN_DEBOUNCE_MS = 1500;
@@ -505,6 +536,7 @@ class IPCHandlers {
if (provider === "mistral" && isMistral) return trimmed;
}
if (provider === "groq") return "whisper-large-v3-turbo";
+ if (provider === "xai") return "grok-stt";
if (provider === "mistral") return "voxtral-mini-latest";
return "gpt-4o-mini-transcribe";
}
@@ -2527,6 +2559,50 @@ class IPCHandlers {
return this.environmentManager.saveGroqKey(key);
});
+ ipcMain.handle("get-xai-key", async () => {
+ return this.environmentManager.getXaiKey();
+ });
+
+ ipcMain.handle("save-xai-key", async (event, key) => {
+ return this.environmentManager.saveXaiKey(key);
+ });
+
+ ipcMain.handle(
+ "proxy-xai-transcription",
+ async (event, { audioBuffer, language, keyterms }) => {
+ const apiKey = this.environmentManager.getXaiKey();
+ if (!apiKey) {
+ throw new Error("xAI API key not configured");
+ }
+
+ const formData = new FormData();
+ const audioBlob = new Blob([Buffer.from(audioBuffer)], { type: "audio/webm" });
+ formData.append("file", audioBlob, "audio.webm");
+ if (language && language !== "auto" && XAI_STT_LANGUAGES.has(language)) {
+ formData.append("language", language);
+ formData.append("format", "true");
+ }
+ if (keyterms && keyterms.length > 0) {
+ for (const term of keyterms) {
+ formData.append("keyterm", term);
+ }
+ }
+
+ const response = await proxyFetch(XAI_STT_URL, {
+ method: "POST",
+ headers: { Authorization: `Bearer ${apiKey}` },
+ body: formData,
+ });
+
+ if (!response.ok) {
+ const errorText = await response.text();
+ throw new Error(`xAI API Error: ${response.status} ${errorText}`);
+ }
+
+ return await response.json();
+ }
+ );
+
ipcMain.handle("get-mistral-key", async () => {
return this.environmentManager.getMistralKey();
});
@@ -3712,6 +3788,9 @@ class IPCHandlers {
if (provider === "groq") {
apiKey = this.environmentManager.getGroqKey();
endpoint = "https://api.groq.com/openai/v1/audio/transcriptions";
+ } else if (provider === "xai") {
+ apiKey = this.environmentManager.getXaiKey();
+ endpoint = XAI_STT_URL;
} else if (provider === "mistral") {
apiKey = this.environmentManager.getMistralKey();
endpoint = MISTRAL_TRANSCRIPTION_URL;
@@ -3733,8 +3812,16 @@ class IPCHandlers {
const formData = new FormData();
formData.append("file", new Blob([buffer], { type: "audio/webm" }), "audio.webm");
- formData.append("model", model);
- if (language) formData.append("language", language);
+ if (provider === "xai") {
+ // xAI STT does not accept a model field; language only when in supported set
+ if (language && XAI_STT_LANGUAGES.has(language)) {
+ formData.append("language", language);
+ formData.append("format", "true");
+ }
+ } else {
+ formData.append("model", model);
+ if (language) formData.append("language", language);
+ }
const headers = {};
if (provider === "mistral") {
headers["x-api-key"] = apiKey;
@@ -6338,21 +6425,38 @@ class IPCHandlers {
}
if (!apiKey) throw new Error("No API key configured. Add your key in Settings.");
- if (!baseUrl) throw new Error("No transcription endpoint configured.");
+ if (!baseUrl && provider !== "xai") {
+ throw new Error("No transcription endpoint configured.");
+ }
const audioBuffer = fs.readFileSync(filePath);
const ext = path.extname(filePath).toLowerCase().replace(".", "");
const contentType = AUDIO_MIME_TYPES[ext] || "audio/mpeg";
const fileName = path.basename(filePath);
- let transcriptionUrl = baseUrl.replace(/\/+$/, "");
- if (!transcriptionUrl.endsWith("/audio/transcriptions")) {
- transcriptionUrl += "/audio/transcriptions";
+ let transcriptionUrl;
+ const multipartFields = {};
+ if (provider === "xai") {
+ // xAI STT has a fixed endpoint and accepts no model field. See #910.
+ transcriptionUrl = XAI_STT_URL;
+ if (language && XAI_STT_LANGUAGES.has(language)) {
+ multipartFields.language = language;
+ multipartFields.format = "true";
+ }
+ } else {
+ transcriptionUrl = baseUrl.replace(/\/+$/, "");
+ if (!transcriptionUrl.endsWith("/audio/transcriptions")) {
+ transcriptionUrl += "/audio/transcriptions";
+ }
+ multipartFields.model = model || "whisper-1";
}
- const { body, boundary } = buildMultipartBody(audioBuffer, fileName, contentType, {
- model: model || "whisper-1",
- });
+ const { body, boundary } = buildMultipartBody(
+ audioBuffer,
+ fileName,
+ contentType,
+ multipartFields
+ );
const url = new URL(transcriptionUrl);
const data = await postMultipart(url, body, boundary, {
diff --git a/src/hooks/useSettings.ts b/src/hooks/useSettings.ts
index 3d17141d7..377973f5e 100644
--- a/src/hooks/useSettings.ts
+++ b/src/hooks/useSettings.ts
@@ -55,6 +55,7 @@ export interface ApiKeySettings {
anthropicApiKey: string;
geminiApiKey: string;
groqApiKey: string;
+ xaiApiKey: string;
mistralApiKey: string;
cortiClientId: string;
cortiClientSecret: string;
@@ -216,6 +217,7 @@ function useSettingsInternal() {
anthropicApiKey: store.anthropicApiKey,
geminiApiKey: store.geminiApiKey,
groqApiKey: store.groqApiKey,
+ xaiApiKey: store.xaiApiKey,
mistralApiKey: store.mistralApiKey,
dictationKey: store.dictationKey,
meetingKey: store.meetingKey,
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index 1a3044e24..3dcee3003 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -1754,7 +1754,8 @@
"groq_whisper_large_v3": "Hochpräzise Spracherkennung",
"groq_whisper_large_v3_turbo": "216x Echtzeitgeschwindigkeit",
"mistral_voxtral_mini_latest": "Schnelle mehrsprachige Transkription",
- "corti_transcribe": "Medizinische Transkription in klinischer Qualität"
+ "corti_transcribe": "Medizinische Transkription in klinischer Qualität",
+ "xai_grok_stt": "Hochpräzise Spracherkennung von xAI"
},
"cloud": {
"openai_gpt_5_2": "Starkes Reasoning-Modell",
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 393035953..0c3ede713 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -1854,7 +1854,8 @@
"groq_whisper_large_v3": "High accuracy speech recognition",
"groq_whisper_large_v3_turbo": "216x real-time speed",
"mistral_voxtral_mini_latest": "Fast multilingual transcription",
- "corti_transcribe": "Clinical-grade medical transcription"
+ "corti_transcribe": "Clinical-grade medical transcription",
+ "xai_grok_stt": "High-accuracy speech recognition by xAI"
},
"cloud": {
"openai_gpt_5_2": "Strong reasoning model",
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index f81d8c69b..357c621cd 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -1802,7 +1802,8 @@
"groq_whisper_large_v3": "Reconocimiento de voz de alta precisión",
"groq_whisper_large_v3_turbo": "Velocidad 216x en tiempo real",
"mistral_voxtral_mini_latest": "Transcripción multilingüe rápida",
- "corti_transcribe": "Transcripción médica de nivel clínico"
+ "corti_transcribe": "Transcripción médica de nivel clínico",
+ "xai_grok_stt": "Reconocimiento de voz de alta precisión por xAI"
},
"cloud": {
"openai_gpt_5_2": "Modelo fuerte de razonamiento",
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index 4e73ee837..37fa3bc07 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -1802,7 +1802,8 @@
"groq_whisper_large_v3": "Reconnaissance vocale haute précision",
"groq_whisper_large_v3_turbo": "Vitesse 216x en temps réel",
"mistral_voxtral_mini_latest": "Transcription multilingue rapide",
- "corti_transcribe": "Transcription médicale de qualité clinique"
+ "corti_transcribe": "Transcription médicale de qualité clinique",
+ "xai_grok_stt": "Reconnaissance vocale haute précision par xAI"
},
"cloud": {
"openai_gpt_5_2": "Modèle de raisonnement performant",
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index 498076efa..92ea9e4ef 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -1754,7 +1754,8 @@
"groq_whisper_large_v3_turbo": "Velocità 216x in tempo reale",
"groq_whisper_large_v3": "Modello Large v3, veloce e preciso",
"mistral_voxtral_mini_latest": "Trascrizione multilingue veloce",
- "corti_transcribe": "Trascrizione medica di livello clinico"
+ "corti_transcribe": "Trascrizione medica di livello clinico",
+ "xai_grok_stt": "Riconoscimento vocale ad alta precisione di xAI"
},
"cloud": {
"openai_gpt_5_2": "Modello di ragionamento potente",
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index 45c4c3f8f..95a9ef35b 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -1754,7 +1754,8 @@
"groq_whisper_large_v3_turbo": "リアルタイムの 216 倍速",
"groq_whisper_large_v3": "Large v3 モデル、高速かつ高精度",
"mistral_voxtral_mini_latest": "高速多言語文字起こし",
- "corti_transcribe": "臨床グレードの医療文字起こし"
+ "corti_transcribe": "臨床グレードの医療文字起こし",
+ "xai_grok_stt": "xAIによる高精度音声認識"
},
"cloud": {
"openai_gpt_5_2": "強力な推論モデル",
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index 87af4bf64..3b7329cd0 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -1726,7 +1726,8 @@
"groq_whisper_large_v3_turbo": "Velocidade 216x em tempo real",
"groq_whisper_large_v3": "Modelo Large v3, rápido e preciso",
"mistral_voxtral_mini_latest": "Transcrição multilíngue rápida",
- "corti_transcribe": "Transcrição médica de nível clínico"
+ "corti_transcribe": "Transcrição médica de nível clínico",
+ "xai_grok_stt": "Reconhecimento de voz de alta precisão pela xAI"
},
"cloud": {
"openai_gpt_5_2": "Modelo forte de raciocínio",
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index e804bc556..d1b50ffb7 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -1754,7 +1754,8 @@
"groq_whisper_large_v3_turbo": "Скорость в 216 раз быстрее реального времени",
"groq_whisper_large_v3": "Модель Large v3, быстрая и точная",
"mistral_voxtral_mini_latest": "Быстрая многоязычная транскрипция",
- "corti_transcribe": "Медицинская транскрипция клинического уровня"
+ "corti_transcribe": "Медицинская транскрипция клинического уровня",
+ "xai_grok_stt": "Высокоточное распознавание речи от xAI"
},
"cloud": {
"openai_gpt_5_2": "Сильная модель рассуждения",
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index 6c264dea0..f91e89e7a 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -1749,7 +1749,8 @@
"groq_whisper_large_v3_turbo": "216 倍实时速度",
"groq_whisper_large_v3": "Large v3 模型,快速且精准",
"mistral_voxtral_mini_latest": "快速多语言转录",
- "corti_transcribe": "临床级医疗转录"
+ "corti_transcribe": "临床级医疗转录",
+ "xai_grok_stt": "xAI 高精度语音识别"
},
"cloud": {
"openai_gpt_5_2": "强大的推理模型",
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index e395ec86a..e817078b0 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -1749,7 +1749,8 @@
"groq_whisper_large_v3_turbo": "216 倍即時速度",
"groq_whisper_large_v3": "Large v3 模型,快速且精準",
"mistral_voxtral_mini_latest": "快速多語言轉錄",
- "corti_transcribe": "臨床級醫療轉錄"
+ "corti_transcribe": "臨床級醫療轉錄",
+ "xai_grok_stt": "xAI 高精度語音辨識"
},
"cloud": {
"openai_gpt_5_2": "強大的推理模型",
diff --git a/src/models/modelRegistryData.json b/src/models/modelRegistryData.json
index a7fd76a26..7077f57cf 100644
--- a/src/models/modelRegistryData.json
+++ b/src/models/modelRegistryData.json
@@ -179,6 +179,19 @@
}
]
},
+ {
+ "id": "xai",
+ "name": "xAI",
+ "baseUrl": "https://api.x.ai/v1",
+ "models": [
+ {
+ "id": "grok-stt",
+ "name": "Grok STT",
+ "description": "High-accuracy speech recognition by xAI",
+ "descriptionKey": "models.descriptions.transcription.xai_grok_stt"
+ }
+ ]
+ },
{
"id": "mistral",
"name": "Mistral",
diff --git a/src/stores/settingsStore.ts b/src/stores/settingsStore.ts
index 1b01076b1..30b809401 100644
--- a/src/stores/settingsStore.ts
+++ b/src/stores/settingsStore.ts
@@ -492,6 +492,7 @@ export interface SettingsState
setAnthropicApiKey: (key: string) => void;
setGeminiApiKey: (key: string) => void;
setGroqApiKey: (key: string) => void;
+ setXaiApiKey: (key: string) => void;
setMistralApiKey: (key: string) => void;
setCortiClientId: (key: string) => void;
setCortiClientSecret: (key: string) => void;
@@ -626,6 +627,7 @@ const SECRET_IPC_SAVERS = {
anthropic: "saveAnthropicKey",
gemini: "saveGeminiKey",
groq: "saveGroqKey",
+ xai: "saveXaiKey",
mistral: "saveMistralKey",
cortiClientId: "saveCortiClientId",
cortiClientSecret: "saveCortiClientSecret",
@@ -665,6 +667,7 @@ const STALE_SECRET_LOCALSTORAGE_KEYS = [
"anthropicApiKey",
"geminiApiKey",
"groqApiKey",
+ "xaiApiKey",
"mistralApiKey",
"cortiClientId",
"cortiClientSecret",
@@ -736,6 +739,7 @@ export const useSettingsStore = create<SettingsState>()((set, get) => ({
anthropicApiKey: "",
geminiApiKey: "",
groqApiKey: "",
+ xaiApiKey: "",
mistralApiKey: "",
cortiClientId: "",
cortiClientSecret: "",
@@ -1084,6 +1088,11 @@ export const useSettingsStore = create<SettingsState>()((set, get) => ({
debouncedSaveSecret("groq", key);
invalidateApiKeyCaches("groq");
},
+ setXaiApiKey: (key: string) => {
+ set({ xaiApiKey: key });
+ debouncedSaveSecret("xai", key);
+ invalidateApiKeyCaches();
+ },
setMistralApiKey: (key: string) => {
set({ mistralApiKey: key });
debouncedSaveSecret("mistral", key);
@@ -1473,6 +1482,7 @@ export const useSettingsStore = create<SettingsState>()((set, get) => ({
if (keys.anthropicApiKey !== undefined) s.setAnthropicApiKey(keys.anthropicApiKey);
if (keys.geminiApiKey !== undefined) s.setGeminiApiKey(keys.geminiApiKey);
if (keys.groqApiKey !== undefined) s.setGroqApiKey(keys.groqApiKey);
+ if (keys.xaiApiKey !== undefined) s.setXaiApiKey(keys.xaiApiKey);
if (keys.mistralApiKey !== undefined) s.setMistralApiKey(keys.mistralApiKey);
if (keys.cortiClientId !== undefined) s.setCortiClientId(keys.cortiClientId);
if (keys.cortiClientSecret !== undefined) s.setCortiClientSecret(keys.cortiClientSecret);
@@ -1681,6 +1691,7 @@ export async function initializeSettings(): Promise<void> {
anthropic,
gemini,
groq,
+ xai,
mistral,
cortiClientId,
cortiClientSecret,
@@ -1696,6 +1707,7 @@ export async function initializeSettings(): Promise<void> {
window.electronAPI.getAnthropicKey?.(),
window.electronAPI.getGeminiKey?.(),
window.electronAPI.getGroqKey?.(),
+ window.electronAPI.getXaiKey?.(),
window.electronAPI.getMistralKey?.(),
window.electronAPI.getCortiClientId?.(),
window.electronAPI.getCortiClientSecret?.(),
@@ -1713,6 +1725,7 @@ export async function initializeSettings(): Promise<void> {
anthropicApiKey: anthropic || "",
geminiApiKey: gemini || "",
groqApiKey: groq || "",
+ xaiApiKey: xai || "",
mistralApiKey: mistral || "",
cortiClientId: cortiClientId || "",
cortiClientSecret: cortiClientSecret || "",
diff --git a/src/types/electron.ts b/src/types/electron.ts
index 64a7f69a3..79a7cb6e5 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -962,6 +962,15 @@ declare global {
getGroqKey: () => Promise<string | null>;
saveGroqKey: (key: string) => Promise<void>;
+ // xAI API key management
+ getXaiKey?: () => Promise<string | null>;
+ saveXaiKey?: (key: string) => Promise<void>;
+ proxyXaiTranscription?: (data: {
+ audioBuffer: ArrayBuffer;
+ language?: string;
+ keyterms?: string[];
+ }) => Promise<{ text: string }>;
+
// Mistral API key management
getMistralKey: () => Promise<string | null>;
saveMistralKey: (key: string) => Promise<void>;
diff --git a/src/utils/providerIcons.ts b/src/utils/providerIcons.ts
index faa6e7421..3855910c7 100644
--- a/src/utils/providerIcons.ts
+++ b/src/utils/providerIcons.ts
@@ -11,6 +11,7 @@ import gemmaIcon from "@/assets/icons/providers/gemma.svg";
import bedrockIcon from "@/assets/icons/providers/bedrock.svg";
import azureIcon from "@/assets/icons/providers/azure.svg";
import vertexIcon from "@/assets/icons/providers/vertex.svg";
+import xaiIcon from "@/assets/icons/providers/xai.svg";
export const PROVIDER_ICONS: Record<string, string> = {
openai: openaiIcon,
@@ -27,13 +28,20 @@ export const PROVIDER_ICONS: Record<string, string> = {
bedrock: bedrockIcon,
azure: azureIcon,
vertex: vertexIcon,
+ xai: xaiIcon,
};
export function getProviderIcon(provider: string): string | undefined {
return PROVIDER_ICONS[provider];
}
-export const MONOCHROME_PROVIDERS = ["openai", "whisper", "anthropic", "openai-oss"] as const;
+export const MONOCHROME_PROVIDERS = [
+ "openai",
+ "whisper",
+ "anthropic",
+ "openai-oss",
+ "xai",
+] as const;
export function isMonochromeProvider(provider: string): boolean {
return (MONOCHROME_PROVIDERS as readonly string[]).includes(provider);