{"record":{"id":"7d446ccbd562e17f","repo":"Kuberwastaken/claurst","slug":"no-api-key-found-for-voice-transcription-set-open","errorCode":null,"errorMessage":"No API key found for voice transcription. Set OPENAI_API_KEY, or point WHISPER_ENDPOINT_URL to a local Whisper server (e.g. whisper.cpp or faster-whisper).","messagePattern":"No API key found for voice transcription\\. Set OPENAI_API_KEY, or point WHISPER_ENDPOINT_URL to a local Whisper server \\(e\\.g\\. whisper\\.cpp or faster-whisper\\)\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-rust/crates/core/src/voice.rs","lineNumber":346,"sourceCode":"        }\r\n\r\n        // Resolve API key: explicit config first, then OPENAI_API_KEY, then ANTHROPIC_API_KEY.\r\n        let api_key_opt = config\r\n            .api_key\r\n            .as_deref()\r\n            .filter(|k| !k.is_empty())\r\n            .map(|k| k.to_string())\r\n            .or_else(|| std::env::var(\"OPENAI_API_KEY\").ok().filter(|k| !k.is_empty()))\r\n            .or_else(|| std::env::var(\"ANTHROPIC_API_KEY\").ok().filter(|k| !k.is_empty()));\r\n\r\n        let api_key = match api_key_opt {\r\n            Some(k) => k,\r\n            None => {\r\n                let msg = \"No API key found for voice transcription. \\\r\n                           Set OPENAI_API_KEY, or point WHISPER_ENDPOINT_URL to a \\\r\n                           local Whisper server (e.g. whisper.cpp or faster-whisper).\".to_string();\r\n                let _ = event_tx.send(VoiceEvent::Error(msg.clone())).await;\r\n                return Err(anyhow::anyhow!(msg));\r\n            }\r\n        };\r\n\r\n        match transcribe_audio(\r\n            &samples,\r\n            sample_rate,\r\n            &api_key,\r\n            config.language.as_deref(),\r\n            &config.model,\r\n            config.endpoint_url.as_deref(),\r\n        )\r\n        .await\r\n        {\r\n            Ok(text) => {\r\n                let _ = event_tx.send(VoiceEvent::TranscriptReady(text)).await;\r\n            }\r\n            Err(e) => {\r\n                let _ = event_tx\r","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/core/src/voice.rs#L328-L364","documentation":"record_and_transcribe needs credentials to call the transcription endpoint: it looks for an API key and, when absent, emits VoiceEvent::Error and fails. The message points to the two supported paths: an OPENAI_API_KEY or a local WHISPER_ENDPOINT_URL server. This is an explicit configuration prerequisite, not a runtime failure.","triggerScenarios":"Recording + transcribing without OPENAI_API_KEY set and without WHISPER_ENDPOINT_URL pointing at a local Whisper server.","commonSituations":"Fresh install with no env vars; CI/docker where env vars aren't passed through; user intended to use a local whisper.cpp server but the endpoint env var is unset or misspelled.","solutions":["Export OPENAI_API_KEY with a valid key.","Set WHISPER_ENDPOINT_URL to a local Whisper server (whisper.cpp / faster-whisper) that needs no key.","Check the current transcript path: read the key lookup in voice.rs to confirm which env vars it probes and their exact spelling."],"exampleFix":"// before\n$ cargo run -- --voice\n// after\n$ export OPENAI_API_KEY=sk-...   # or WHISPER_ENDPOINT_URL=http://localhost:8080\n$ cargo run -- --voice","handlingStrategy":"validation","validationCode":"fn voice_configured() -> bool {\n    std::env::var(\"OPENAI_API_KEY\").is_ok()\n        || std::env::var(\"WHISPER_ENDPOINT_URL\").is_ok()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document required env vars for voice in setup instructions.","Check for key/endpoint presence before enabling voice features.","In containers, pass OPENAI_API_KEY through explicitly."],"tags":["voice","api-key","configuration","whisper"],"backgroundTag":"missing-api-key","analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}