Skip to main content

API Key Management

OpenAI

window.electronAPI.getOpenAIKey()

Retrieve the stored OpenAI API key.
key
string | null
The OpenAI API key, or null if not set
const apiKey = await window.electronAPI.getOpenAIKey();
if (!apiKey) {
  console.log("No OpenAI API key configured");
}

window.electronAPI.saveOpenAIKey()

Save an OpenAI API key to persistent storage.
key
string
required
The OpenAI API key to save
success
boolean
Whether the key was saved successfully
const result = await window.electronAPI.saveOpenAIKey("sk-...");
if (result.success) {
  console.log("API key saved");
}

Anthropic

window.electronAPI.getAnthropicKey()

Retrieve the stored Anthropic API key.
key
string | null
The Anthropic API key, or null if not set

window.electronAPI.saveAnthropicKey()

Save an Anthropic API key.
key
string
required
The Anthropic API key
success
boolean
Whether the key was saved successfully

Gemini

window.electronAPI.getGeminiKey()

Retrieve the stored Google Gemini API key.

window.electronAPI.saveGeminiKey()

Save a Gemini API key.

Groq

window.electronAPI.getGroqKey()

Retrieve the stored Groq API key.

window.electronAPI.saveGroqKey()

Save a Groq API key.

Mistral

window.electronAPI.getMistralKey()

Retrieve the stored Mistral API key.

window.electronAPI.saveMistralKey()

Save a Mistral API key.

Hotkey Management

window.electronAPI.updateHotkey()

Update the global hotkey used to activate dictation.
hotkey
string
required
Hotkey string in Electron accelerator format (e.g., "Alt+R", "CommandOrControl+Shift+Space")
success
boolean
Whether the hotkey was registered successfully
error
string
Error message if registration failed

Example

const result = await window.electronAPI.updateHotkey("Alt+R");

if (result.success) {
  console.log("Hotkey updated");
} else {
  console.error("Failed to register hotkey:", result.error);
}
GNOME Wayland: On GNOME + Wayland, hotkeys are registered using native GNOME shortcuts (gsettings). The backtick key is not supported; use Alt+R instead.

window.electronAPI.setHotkeyListeningMode()

Enable or disable hotkey capture mode (for recording custom hotkeys in the UI).
enabled
boolean
required
Whether to enable hotkey capture mode
newHotkey
string
The new hotkey (when exiting capture mode)
success
boolean
Whether the mode was changed successfully

Example

// Enter capture mode (temporarily unregister current hotkey)
await window.electronAPI.setHotkeyListeningMode(true);

// User presses keys... capture in UI...

// Exit capture mode and register new hotkey
await window.electronAPI.setHotkeyListeningMode(false, "Alt+Space");

window.electronAPI.getHotkeyModeInfo()

Get information about the hotkey system in use.
isUsingGnome
boolean
Whether GNOME native shortcuts are being used (GNOME + Wayland)
const { isUsingGnome } = await window.electronAPI.getHotkeyModeInfo();

if (isUsingGnome) {
  console.log("Using GNOME shortcuts (activation mode selector hidden)");
}

Activation Mode

window.electronAPI.getActivationMode()

Get the current dictation activation mode.
mode
string
Activation mode: "tap" (toggle on/off) or "push" (hold-to-record)
const mode = await window.electronAPI.getActivationMode();
console.log("Activation mode:", mode); // "tap" or "push"

window.electronAPI.saveActivationMode()

Save the dictation activation mode.
mode
string
required
Activation mode: "tap" or "push"
success
boolean
Whether the mode was saved successfully
await window.electronAPI.saveActivationMode("push");
Push-to-Talk on Windows: Requires the windows-key-listener.exe native binary. Falls back to tap mode if unavailable.GNOME Wayland: Push-to-talk is not supported (only tap mode available).

Dictation Key

window.electronAPI.getDictationKey()

Get the current dictation activation key (file-based persistence for startup).
key
string
The dictation hotkey string

window.electronAPI.saveDictationKey()

Save the dictation activation key to persistent storage.
key
string
required
The hotkey string to save
success
boolean
Whether the key was saved successfully

System Settings

window.electronAPI.openMicrophoneSettings()

Open the system microphone privacy settings.
success
boolean
Whether the settings were opened successfully

Platform-Specific Behavior

  • macOS: Opens System Preferences → Privacy → Microphone
  • Windows: Opens Settings → Privacy → Microphone
  • Linux: No standard URL scheme (user must open manually)
await window.electronAPI.openMicrophoneSettings();

window.electronAPI.openAccessibilitySettings()

Open the system accessibility settings (macOS only, required for clipboard auto-paste).
if (process.platform === "darwin") {
  await window.electronAPI.openAccessibilitySettings();
}

window.electronAPI.requestMicrophoneAccess()

Request microphone permission from the system.
granted
boolean
Whether permission was granted
const { granted } = await window.electronAPI.requestMicrophoneAccess();

if (!granted) {
  console.log("Microphone permission denied");
}

UI Language

window.electronAPI.getUiLanguage()

Get the current UI language.
language
string
Language code (e.g., "en", "es", "fr")

window.electronAPI.saveUiLanguage()

Save the UI language preference.
language
string
required
Language code (e.g., "en", "es", "fr")
language
string
The saved language code

window.electronAPI.setUiLanguage()

Set the UI language and reload the UI.
language
string
required
Language code
success
boolean
Whether the language was changed successfully
language
string
The new language code

Example

const result = await window.electronAPI.setUiLanguage("es");

if (result.success) {
  console.log("Language changed to:", result.language);
  // UI will refresh automatically
}

Auto-Start

window.electronAPI.getAutoStartEnabled()

Check if the app is set to start automatically on login.
enabled
boolean
Whether auto-start is enabled
const enabled = await window.electronAPI.getAutoStartEnabled();
console.log("Auto-start:", enabled ? "enabled" : "disabled");

window.electronAPI.setAutoStartEnabled()

Enable or disable auto-start on login.
enabled
boolean
required
Whether to enable auto-start
success
boolean
Whether the setting was changed successfully
error
string
Error message if failed
const result = await window.electronAPI.setAutoStartEnabled(true);

if (result.success) {
  console.log("Auto-start enabled");
}
The app starts minimized to tray when auto-start is enabled.

Startup Preferences Sync

window.electronAPI.syncStartupPreferences()

Sync startup preferences (used for pre-warming models on app launch).
prefs
object
required

Example

await window.electronAPI.syncStartupPreferences({
  useLocalWhisper: true,
  localTranscriptionProvider: "nvidia",
  model: "parakeet-tdt-0.6b-v3",
  reasoningProvider: "local",
  reasoningModel: "qwen-2.5-3b"
});
This method updates environment variables and persists them to .env for the next app launch.

Environment Persistence

window.electronAPI.saveAllKeysToEnv()

Save all API keys and settings to the .env file.
success
boolean
Whether the keys were saved successfully
await window.electronAPI.saveAllKeysToEnv();

Build docs developers (and LLMs) love