{"record":{"id":"1cb1a7e1cebcfc65","repo":"Mintplex-Labs/anything-llm","slug":"no-openai-compatible-endpoint-was-set-please-set","errorCode":null,"errorMessage":"No OpenAI compatible endpoint was set. Please set this to use your OpenAI compatible STT service.","messagePattern":"No OpenAI compatible endpoint was set\\. Please set this to use your OpenAI compatible STT service\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/SpeechToText/openAiGeneric/index.js","lineNumber":7,"sourceCode":"const { convertAudioBufferToWav } = require(\"../helpers\");\nconst path = require(\"path\");\n\nclass GenericOpenAiSTT {\n  constructor() {\n    if (!process.env.STT_OPEN_AI_COMPATIBLE_ENDPOINT)\n      throw new Error(\n        \"No OpenAI compatible endpoint was set. Please set this to use your OpenAI compatible STT service.\"\n      );\n    if (!process.env.STT_OPEN_AI_COMPATIBLE_KEY)\n      this.#log(\n        \"No OpenAI compatible API key was set. You might need to set this to use your OpenAI compatible STT service.\"\n      );\n    if (!process.env.STT_OPEN_AI_COMPATIBLE_MODEL)\n      this.#log(\n        \"No OpenAI compatible STT model was set. We will use the default model 'whisper-1'. This may not exist or be valid for your selected endpoint.\"\n      );\n\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    this.openai = new OpenAIApi({\n      apiKey: process.env.STT_OPEN_AI_COMPATIBLE_KEY || null,\n      baseURL: process.env.STT_OPEN_AI_COMPATIBLE_ENDPOINT,\n    });\n    this.model = process.env.STT_OPEN_AI_COMPATIBLE_MODEL ?? \"whisper-1\";\n    this.#log(","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/SpeechToText/openAiGeneric/index.js#L1-L25","documentation":"Thrown by the GenericOpenAiSTT constructor when STT_OPEN_AI_COMPATIBLE_ENDPOINT is not set. This provider points the OpenAI SDK at any OpenAI-compatible transcription server (whisper.cpp, LocalAI, Groq, etc.), and the endpoint URL is the only hard requirement — a missing STT_OPEN_AI_COMPATIBLE_KEY or STT_OPEN_AI_COMPATIBLE_MODEL only logs a warning and falls back to defaults. It fails at construction, before any audio is sent.","triggerScenarios":"Setting STT_PROVIDER=generic-openai and invoking speech-to-text while STT_OPEN_AI_COMPATIBLE_ENDPOINT is absent from the environment. Key/model being absent does NOT throw — only the endpoint does.","commonSituations":"Self-hosting a whisper-compatible server but forgetting to export the endpoint; using the TTS_* variable names (TTS_OPEN_AI_COMPATIBLE_ENDPOINT) by mistake; endpoint defined in a .env the server does not load; copying config from a machine where the var lived in the shell profile.","solutions":["Set STT_OPEN_AI_COMPATIBLE_ENDPOINT to your server's base URL (e.g. http://localhost:9090/v1/audio/transcriptions or your Groq/localai endpoint) and restart.","Optionally set STT_OPEN_AI_COMPATIBLE_KEY and STT_OPEN_AI_COMPATIBLE_MODEL to silence the warnings and avoid the whisper-1 default being sent to a server that lacks it.","Double-check the STT_ prefix — the TTS_ equivalents configure text-to-speech, not this class.","Confirm the endpoint actually serves an OpenAI-compatible /audio/transcriptions route with a curl test."],"exampleFix":"# before (.env)\nSTT_PROVIDER=generic-openai\n# no endpoint -> Error at construction\n\n# after (.env)\nSTT_PROVIDER=generic-openai\nSTT_OPEN_AI_COMPATIBLE_ENDPOINT=http://localhost:9090/v1\nSTT_OPEN_AI_COMPATIBLE_KEY=optional\nSTT_OPEN_AI_COMPATIBLE_MODEL=whisper-1","handlingStrategy":"validation","validationCode":"const canUseGenericOpenAiSTT = () =>\n  Boolean(process.env.STT_OPEN_AI_COMPATIBLE_ENDPOINT);\n\nif (process.env.STT_PROVIDER === \"generic-openai\" && !canUseGenericOpenAiSTT()) {\n  throw new Error(\"generic-openai STT requires STT_OPEN_AI_COMPATIBLE_ENDPOINT\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  stt = getSTTProvider();\n} catch (e) {\n  if (/No OpenAI compatible endpoint was set/.test(e.message))\n    return respondConfigError(\"STT_OPEN_AI_COMPATIBLE_ENDPOINT missing\");\n  throw e;\n}","preventionTips":["Document the per-provider env matrix (endpoint required; key/model optional warnings) next to your deployment config.","Beware the STT_ vs TTS_ prefix trap — variable names differ by one word between the two factories.","Smoke-test the endpoint URL with curl before pointing production at it."],"tags":["env","configuration","stt","openai-compatible","self-hosted"],"backgroundTag":"missing-env-var","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}