Mintplex-Labs/anything-llm · error · Error

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

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 process.env.STT_OPEN_AI_COMPATIBLE_ENDPOINT is falsy. This provider targets any OpenAI-compatible STT endpoint and only the endpoint is mandatory; the key and model are optional (logged as warnings) and default to null / whisper-1. Without a base URL the OpenAI client cannot be constructed.

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 526360e320)

Solutions

  1. Add STT_OPEN_AI_COMPATIBLE_ENDPOINT=<base-url> to .env and restart.
  2. Also set STT_OPEN_AI_COMPATIBLE_KEY if your endpoint requires auth, and STT_OPEN_AI_COMPATIBLE_MODEL to match the server's transcription model.
  3. Verify the endpoint exposes an OpenAI-compatible /audio/transcriptions route.
  4. In Docker, pass the variable to the container.

Example fix

# before
STT_PROVIDER=generic-openai
# STT_OPEN_AI_COMPATIBLE_ENDPOINT missing

# after
STT_PROVIDER=generic-openai
STT_OPEN_AI_COMPATIBLE_ENDPOINT=http://localhost:8080/v1
STT_OPEN_AI_COMPATIBLE_KEY=optional
STT_OPEN_AI_COMPATIBLE_MODEL=whisper-1
Defensive patterns

Strategy: validation

Validate before calling

if (
  process.env.STT_PROVIDER === "generic-openai" &&
  !process.env.STT_OPEN_AI_COMPATIBLE_ENDPOINT
) {
  throw new Error(
    "STT_PROVIDER is 'generic-openai' but STT_OPEN_AI_COMPATIBLE_ENDPOINT is not set."
  );
}

Try / catch

try {
  return new GenericOpenAiSTT();
} catch (e) {
  if (/No OpenAI compatible endpoint/i.test(e.message)) {
    logger.error("Set STT_OPEN_AI_COMPATIBLE_ENDPOINT to your compatible STT base URL, then restart.");
  }
  throw e;
}

Prevention

When it happens

Trigger: STT_PROVIDER=generic-openai is set but STT_OPEN_AI_COMPATIBLE_ENDPOINT is missing/empty; only the key/model were set; the var was renamed.

Common situations: Self-hosted OpenAI-compatible server (vLLM, LocalAI, etc.) without the endpoint configured; typos in the env name; switching to generic-openai without completing its env block.

Related errors


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