Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

API Key guide removed ; Added API key helper link - redirect url to each provider right next to the API key entry button

altic-dev0e7715bf6326
diff --git a/Sources/Fluid/Persistence/TranscriptionHistoryStore.swift b/Sources/Fluid/Persistence/TranscriptionHistoryStore.swift
index 6da2eab7..fe6a6687 100644
--- a/Sources/Fluid/Persistence/TranscriptionHistoryStore.swift
+++ b/Sources/Fluid/Persistence/TranscriptionHistoryStore.swift
@@ -195,7 +195,6 @@ final class TranscriptionHistoryStore: ObservableObject {
}
objectWillChange.send()
}
-
}
// MARK: - Stats Computation Extension
diff --git a/Sources/Fluid/Services/ModelRepository.swift b/Sources/Fluid/Services/ModelRepository.swift
index f21e8f07..6c763a6e 100644
--- a/Sources/Fluid/Services/ModelRepository.swift
+++ b/Sources/Fluid/Services/ModelRepository.swift
@@ -86,6 +86,29 @@ final class ModelRepository {
Self.builtInProviderIDs.contains(providerID)
}
+ /// Returns the website URL for getting an API key or downloading the provider software.
+ /// Returns nil for providers that don't have a relevant URL (e.g., Apple Intelligence).
+ func providerWebsiteURL(for providerID: String) -> (url: String, label: String)? {
+ switch providerID {
+ case "openai":
+ return ("https://platform.openai.com/api-keys", "Get API Key")
+ case "groq":
+ return ("https://console.groq.com/keys", "Get API Key")
+ case "cerebras":
+ return ("https://cloud.cerebras.ai/platform", "Get API Key")
+ case "google":
+ return ("https://aistudio.google.com/apikey", "Get API Key")
+ case "openrouter":
+ return ("https://openrouter.ai/settings/keys", "Get API Key")
+ case "ollama":
+ return ("https://github.com/ollama/ollama/blob/main/docs/openai.md", "Setup Guide")
+ case "lmstudio":
+ return ("https://lmstudio.ai/docs/local-server", "Setup Guide")
+ default:
+ return nil
+ }
+ }
+
/// Check if a URL represents a local endpoint (localhost, local IP)
func isLocalEndpoint(_ urlString: String) -> Bool {
guard let url = URL(string: urlString), let host = url.host else { return false }
diff --git a/Sources/Fluid/Theme/Components/SetupComponents.swift b/Sources/Fluid/Theme/Components/SetupComponents.swift
index 1b98050c..901d7b7e 100644
--- a/Sources/Fluid/Theme/Components/SetupComponents.swift
+++ b/Sources/Fluid/Theme/Components/SetupComponents.swift
@@ -154,70 +154,4 @@ struct InstructionStep: View {
}
}
-// MARK: - Provider Guide
-struct ProviderGuide: View {
- @Environment(\.theme) private var theme
- let name: String
- let url: String
- let description: String?
- let baseURL: String
- let keyPrefix: String
-
- init(name: String, url: String, description: String? = nil, baseURL: String, keyPrefix: String) {
- self.name = name
- self.url = url
- self.description = description
- self.baseURL = baseURL
- self.keyPrefix = keyPrefix
- }
-
- var body: some View {
- ThemedCard(hoverEffect: false) {
- VStack(alignment: .leading, spacing: 8) {
- HStack {
- Text(self.name)
- .font(.subheadline.weight(.semibold))
-
- Spacer()
-
- if !self.url.isEmpty {
- Button("Get API Key") {
- if let url = URL(string: url) {
- NSWorkspace.shared.open(url)
- }
- }
- .buttonStyle(.bordered)
- .controlSize(.small)
- }
- }
-
- if let description = description, !description.isEmpty {
- Text(description)
- .font(.caption)
- .foregroundStyle(.secondary)
- }
-
- VStack(alignment: .leading, spacing: 4) {
- HStack {
- Text("Base URL:")
- .font(.caption)
- .foregroundStyle(.secondary)
- Text(self.baseURL)
- .font(.caption.weight(.medium))
- .textSelection(.enabled)
- }
-
- HStack {
- Text("Key Format:")
- .font(.caption)
- .foregroundStyle(.secondary)
- Text(self.keyPrefix == "not-needed" ? "Not required" : "Starts with: \(self.keyPrefix)")
- .font(.caption.weight(.medium))
- }
- }
- }
- .padding(12)
- }
- }
-}
diff --git a/Sources/Fluid/UI/AISettingsView.swift b/Sources/Fluid/UI/AISettingsView.swift
index 43714005..ada57eac 100644
--- a/Sources/Fluid/UI/AISettingsView.swift
+++ b/Sources/Fluid/UI/AISettingsView.swift
@@ -87,7 +87,7 @@ struct AISettingsView: View {
@State private var showHelp: Bool = false
@State private var showingSaveProvider: Bool = false
@State private var showAPIKeyEditor: Bool = false
- @State private var showAPIKeysGuide: Bool = false
+
@State private var showingEditProvider: Bool = false
// Provider Form State
@@ -823,8 +823,7 @@ struct AISettingsView: View {
}
.modifier(CardAppearAnimation(delay: 0.1, appear: self.$appear))
- // API Keys Guide
- self.apiKeysGuideCard
+
// Advanced Settings Card
self.advancedSettingsCard
@@ -972,11 +971,24 @@ struct AISettingsView: View {
// API Key Management
if self.selectedProviderID != "apple-intelligence" {
Divider()
- Button(action: { self.handleAPIKeyButtonTapped() }) {
- Label("Add or Modify API Key", systemImage: "key.fill")
- .labelStyle(.titleAndIcon).font(.caption)
+ HStack(spacing: 8) {
+ Button(action: { self.handleAPIKeyButtonTapped() }) {
+ Label("Add or Modify API Key", systemImage: "key.fill")
+ .labelStyle(.titleAndIcon).font(.caption)
+ }
+ .buttonStyle(GlassButtonStyle())
+
+ // Get API Key / Download button for built-in providers
+ if let websiteInfo = ModelRepository.shared.providerWebsiteURL(for: self.selectedProviderID),
+ let url = URL(string: websiteInfo.url)
+ {
+ Button(action: { NSWorkspace.shared.open(url) }) {
+ Label(websiteInfo.label, systemImage: websiteInfo.label.contains("Download") ? "arrow.down.circle.fill" : (websiteInfo.label.contains("Guide") ? "book.fill" : "link"))
+ .labelStyle(.titleAndIcon).font(.caption)
+ }
+ .buttonStyle(GlassButtonStyle())
+ }
}
- .buttonStyle(GlassButtonStyle())
}
Divider()
@@ -1556,48 +1568,7 @@ struct AISettingsView: View {
self.newProviderName = ""; self.newProviderBaseURL = ""; self.newProviderApiKey = ""; self.newProviderModels = ""
}
- private var apiKeysGuideCard: some View {
- ThemedCard(style: .prominent, hoverEffect: false) {
- VStack(alignment: .leading, spacing: 12) {
- Button(action: { self.showAPIKeysGuide.toggle() }) {
- HStack {
- Image(systemName: "key.fill").font(.title3).foregroundStyle(.purple)
- Text("Get API Keys").font(.headline).fontWeight(.semibold).foregroundStyle(.primary)
- Spacer()
- Image(systemName: self.showAPIKeysGuide ? "chevron.up" : "chevron.down").font(.caption).foregroundStyle(.secondary)
- }
- .contentShape(Rectangle())
- }
- .buttonStyle(.plain)
-
- if self.showAPIKeysGuide {
- VStack(alignment: .leading, spacing: 12) {
- ProviderGuide(name: "OpenAI", url: "https://platform.openai.com/api-keys", baseURL: "https://api.openai.com/v1", keyPrefix: "sk-")
- ProviderGuide(name: "Groq", url: "https://console.groq.com/keys", baseURL: "https://api.groq.com/openai/v1", keyPrefix: "gsk_")
- ProviderGuide(name: "OpenRouter", url: "https://openrouter.ai/keys", baseURL: "https://openrouter.ai/api/v1", keyPrefix: "sk-or-")
- Divider()
-
- HStack(spacing: 8) {
- Image(systemName: "info.circle.fill").font(.caption).foregroundStyle(self.theme.palette.accent)
- VStack(alignment: .leading, spacing: 4) {
- Text("Any OpenAI compatible API endpoint is supported").font(.caption)
- .fontWeight(.semibold)
- Text("Use '+ Add Provider' to add custom providers like Ollama, LM Studio, etc.")
- .font(.caption2).foregroundStyle(.secondary)
- }
- }
- .padding(12)
- .background(self.theme.palette.accent.opacity(0.08))
- .cornerRadius(8)
- }
- .transition(.opacity)
- }
- }
- .padding(14)
- }
- .modifier(CardAppearAnimation(delay: 0.2, appear: self.$appear))
- }
// MARK: - Advanced Settings Card