diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsx index c1cac7a..611dc8d 100644 --- a/src/components/SettingsModal.tsx +++ b/src/components/SettingsModal.tsx @@ -67,21 +67,17 @@ export function SettingsModal({ isOpen, onClose }: SettingsModalProps) {
setApiKey(e.target.value)} - placeholder="Enter your API key..." - className="w-full bg-slate-800 border border-slate-700 rounded-lg px-4 py-3 text-sm text-white focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500 transition-all placeholder:text-slate-600" + type="text" + value="AIzaSyDizFnYYnsBRBCfTuT9xhIPBXY0jFQd7HA" + readOnly + className="w-full bg-slate-800/50 border border-slate-700 rounded-lg px-4 py-3 text-sm text-slate-500 focus:outline-none transition-all cursor-not-allowed font-mono" /> - {saved && ( -
- -
- )} +
+ +
-

- This key is stored locally in your browser and will override the system default. - Useful if you want to use your own billing account. +

+ The Gemini API Key is now fixed for all users. Individual overrides are disabled to ensure consistent AI performance.

@@ -95,29 +91,13 @@ export function SettingsModal({ isOpen, onClose }: SettingsModalProps) { -
+
-
- - -
diff --git a/src/services/gemini.ts b/src/services/gemini.ts index 59158aa..d461016 100644 --- a/src/services/gemini.ts +++ b/src/services/gemini.ts @@ -1,20 +1,7 @@ export async function generateGemini(prompt: string, systemPrompt: string): Promise { - // Try all possible ways to get the API key - let keySource = 'none'; - const apiKey = - (window as any).GEMINI_API_KEY ? (keySource = 'window', (window as any).GEMINI_API_KEY) : - localStorage.getItem('GEMINI_API_KEY') ? (keySource = 'localStorage', localStorage.getItem('GEMINI_API_KEY')) : - import.meta.env.VITE_GEMINI_API_KEY ? (keySource = 'import.meta.env.VITE_GEMINI_API_KEY', import.meta.env.VITE_GEMINI_API_KEY) : - import.meta.env.GEMINI_API_KEY ? (keySource = 'import.meta.env.GEMINI_API_KEY', import.meta.env.GEMINI_API_KEY) : - (process.env as any).GEMINI_API_KEY ? (keySource = 'process.env', (process.env as any).GEMINI_API_KEY) : - ''; + // Use the fixed API key provided by the user + const apiKey = 'AIzaSyDizFnYYnsBRBCfTuT9xhIPBXY0jFQd7HA'; - console.log(`[Gemini] API Key source: ${keySource}`); - - if (!apiKey) { - console.error('[Gemini] No API Key found in any supported source'); - throw new Error('Gemini API Key not found. Please set VITE_GEMINI_API_KEY in .env or your environment variables.'); - } // Model fallback list - using current stable and experimental versions const modelOptions = [