{"record":{"id":"afc461e40838ac97","repo":"Mintplex-Labs/anything-llm","slug":"open-computer-warning-openai-api-key-not-set","errorCode":null,"errorMessage":"[open-computer] WARNING: OPENAI_API_KEY not set — prompts will fail (or set OPENAI_BASE_URL for local providers)","messagePattern":"\\[open-computer\\] WARNING: OPENAI_API_KEY not set — prompts will fail \\(or set OPENAI_BASE_URL for local providers\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"open-computer/services/interface-service/index.js","lineNumber":112,"sourceCode":"\nregisterEventsWebSocket(server, streamWss);\nregisterUploadWebSocket(uploadWss);\n\n// ─── Background tasks ──────────────────────────────────────────────────────\n\nstartDeliverablesPoller();\nstartIdleDetector();\n\n// ─── Start ─────────────────────────────────────────────────────────────────\n\nserver.listen(PORT, \"0.0.0.0\", () => {\n  console.log(`[open-computer] Listening on :${PORT}`);\n  console.log(`[open-computer] Agent: ${settings.OPENAI_MODEL ? `${process.env.AGENT_NAME || \"agent\"} (model: ${settings.OPENAI_MODEL})` : process.env.AGENT_NAME || \"agent\"}`);\n  console.log(`[open-computer] noVNC proxy: /desktop → localhost:6080`);\n  console.log(`[open-computer] Extensions: ${path.join(SERVICE_ROOT, \"extensions\")}`);\n\n  if (!settings.OPENAI_API_KEY && !settings.OPENAI_BASE_URL) {\n    console.warn(\n      `[open-computer] WARNING: OPENAI_API_KEY not set — prompts will fail ` +\n      `(or set OPENAI_BASE_URL for local providers)`,\n    );\n  }\n  if (settings.OPENAI_BASE_URL) {\n    console.log(\n      `[open-computer] Base URL: ${settings.OPENAI_BASE_URL} ` +\n      `(guest: ${resolveBaseUrlForGuest(settings.OPENAI_BASE_URL)})`,\n    );\n  }\n\n  // Notify reconnecting clients on hot-reload\n  setTimeout(() => {\n    broadcast({ type: \"agent_log\", content: `[server] Reloaded at ${new Date().toLocaleTimeString()}` });\n    broadcast({ type: \"agent_log\", content: `[config] SUBAGENTS_MODE=${SUBAGENTS_MODE}` });\n    broadcast({ type: \"agent_log\", content: `[config] PARALLEL_SUBAGENTS=${PARALLEL_SUBAGENTS}` });\n  }, 500);\n});","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/open-computer/services/interface-service/index.js#L94-L130","documentation":"Boot-time warning from the open-computer service: neither OPENAI_API_KEY nor OPENAI_BASE_URL is set in the loaded settings, so every LLM prompt issued by the agent will fail at request time even though the HTTP server itself starts fine. OPENAI_BASE_URL is the escape hatch for local providers (Ollama, LM Studio, etc.) where no API key exists.","triggerScenarios":"Running open-computer without sourcing its .env; key defined under a different name (e.g. OPENAI_KEY) or in a file the service does not load; env passed in compose but misspelled; local provider intended but base URL also unset.","commonSituations":"Fresh clone/deploy where env templating was skipped; container restarted without the original env file; switching from cloud to local model provider and forgetting OPENAI_BASE_URL.","solutions":["Set OPENAI_API_KEY to a valid key for your provider and restart the service.","For local providers, set OPENAI_BASE_URL (e.g. http://host.docker.internal:11434/v1) instead of a key.","Verify the settings module actually loads the env file you edited (check SERVICE_ROOT/.env path).","Confirm with a quick prompt once booted; the warning disappears when either variable is present."],"exampleFix":"# before\n# OPENAI_API_KEY= (unset)\n\n# after\nOPENAI_API_KEY=sk-...\n# or for a local provider:\nOPENAI_BASE_URL=http://localhost:11434/v1","handlingStrategy":"validation","validationCode":"// Startup assertion in a wrapper script before launching the service:\nif (!process.env.OPENAI_API_KEY && !process.env.OPENAI_BASE_URL) {\n  console.error('Refusing to start: set OPENAI_API_KEY or OPENAI_BASE_URL');\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a .env template listing required keys and fail CI when they are absent.","For local providers, always set OPENAI_BASE_URL so no key is expected.","Verify the service loads the env file you actually edited.","Smoke-test one prompt immediately after boot to catch config gaps early."],"tags":["env-var","openai-api-key","configuration","open-computer"],"backgroundTag":"missing-env-var","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}