Mintplex-Labs/anything-llm · error · Error

No OpenAI compatible endpoint was set. Please set this to…

Error message

No OpenAI compatible endpoint was set. Please set this to use your OpenAI compatible STT service.

What it means

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.

Solutions

  1. 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.
  2. 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.
  3. Double-check the STT_ prefix — the TTS_ equivalents configure text-to-speech, not this class.
  4. Confirm the endpoint actually serves an OpenAI-compatible /audio/transcriptions route with a curl test.

Example fix

# before (.env)
STT_PROVIDER=generic-openai
# no endpoint -> Error at construction

# after (.env)
STT_PROVIDER=generic-openai
STT_OPEN_AI_COMPATIBLE_ENDPOINT=http://localhost:9090/v1
STT_OPEN_AI_COMPATIBLE_KEY=optional
STT_OPEN_AI_COMPATIBLE_MODEL=whisper-1
Defensive patterns

Strategy: validation

Validate before calling

const canUseGenericOpenAiSTT = () =>
  Boolean(process.env.STT_OPEN_AI_COMPATIBLE_ENDPOINT);

if (process.env.STT_PROVIDER === "generic-openai" && !canUseGenericOpenAiSTT()) {
  throw new Error("generic-openai STT requires STT_OPEN_AI_COMPATIBLE_ENDPOINT");
}

Try / catch

try {
  stt = getSTTProvider();
} catch (e) {
  if (/No OpenAI compatible endpoint was set/.test(e.message))
    return respondConfigError("STT_OPEN_AI_COMPATIBLE_ENDPOINT missing");
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/1cb1a7e1cebcfc65. Report an issue: GitHub.

Appendix: source

Thrown at server/utils/SpeechToText/openAiGeneric/index.js:7

const { convertAudioBufferToWav } = require("../helpers");
const path = require("path");

class GenericOpenAiSTT {
  constructor() {
    if (!process.env.STT_OPEN_AI_COMPATIBLE_ENDPOINT)
      throw new Error(
        "No OpenAI compatible endpoint was set. Please set this to use your OpenAI compatible STT service."
      );
    if (!process.env.STT_OPEN_AI_COMPATIBLE_KEY)
      this.#log(
        "No OpenAI compatible API key was set. You might need to set this to use your OpenAI compatible STT service."
      );
    if (!process.env.STT_OPEN_AI_COMPATIBLE_MODEL)
      this.#log(
        "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."
      );

    const { OpenAI: OpenAIApi } = require("openai");
    this.openai = new OpenAIApi({
      apiKey: process.env.STT_OPEN_AI_COMPATIBLE_KEY || null,
      baseURL: process.env.STT_OPEN_AI_COMPATIBLE_ENDPOINT,
    });
    this.model = process.env.STT_OPEN_AI_COMPATIBLE_MODEL ?? "whisper-1";
    this.#log(

View on GitHub (pinned to 3aec848f28)