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 TTS service.

What it means

Thrown by the GenericOpenAiTTS constructor when process.env.TTS_OPEN_AI_COMPATIBLE_ENDPOINT is falsy. This provider targets any OpenAI-compatible TTS endpoint; key, model, and voice model are optional (logged as warnings) and default to null / tts-1 / alloy, but the endpoint is mandatory because the OpenAI client needs a base URL.

Source

Thrown at server/utils/TextToSpeech/openAiGeneric/index.js:16

class GenericOpenAiTTS {
  constructor() {
    if (!process.env.TTS_OPEN_AI_COMPATIBLE_KEY)
      this.#log(
        "No OpenAI compatible API key was set. You might need to set this to use your OpenAI compatible TTS service."
      );
    if (!process.env.TTS_OPEN_AI_COMPATIBLE_MODEL)
      this.#log(
        "No OpenAI compatible TTS model was set. We will use the default voice model 'tts-1'. This may not exist or be valid your selected endpoint."
      );
    if (!process.env.TTS_OPEN_AI_COMPATIBLE_VOICE_MODEL)
      this.#log(
        "No OpenAI compatible voice model was set. We will use the default voice model 'alloy'. This may not exist for your selected endpoint."
      );
    if (!process.env.TTS_OPEN_AI_COMPATIBLE_ENDPOINT)
      throw new Error(
        "No OpenAI compatible endpoint was set. Please set this to use your OpenAI compatible TTS service."
      );

    const { OpenAI: OpenAIApi } = require("openai");
    this.openai = new OpenAIApi({
      apiKey: process.env.TTS_OPEN_AI_COMPATIBLE_KEY || null,
      baseURL: process.env.TTS_OPEN_AI_COMPATIBLE_ENDPOINT,
    });
    this.model = process.env.TTS_OPEN_AI_COMPATIBLE_MODEL ?? "tts-1";
    this.voice = process.env.TTS_OPEN_AI_COMPATIBLE_VOICE_MODEL ?? "alloy";
    this.#log(
      `Service (${process.env.TTS_OPEN_AI_COMPATIBLE_ENDPOINT}) with model: ${this.model} and voice: ${this.voice}`
    );
  }

  #log(text, ...args) {
    console.log(`\x1b[32m[OpenAiGenericTTS]\x1b[0m ${text}`, ...args);
  }

View on GitHub (pinned to 526360e320)

Solutions

  1. Add TTS_OPEN_AI_COMPATIBLE_ENDPOINT=<base-url> to .env and restart.
  2. Also set TTS_OPEN_AI_COMPATIBLE_KEY if your endpoint requires auth, and TTS_OPEN_AI_COMPATIBLE_MODEL / TTS_OPEN_AI_COMPATIBLE_VOICE_MODEL to match the server.
  3. Verify the endpoint exposes an OpenAI-compatible /audio/speech route.
  4. In Docker, pass the variable to the container.

Example fix

# before
TTS_PROVIDER=generic-openai
# TTS_OPEN_AI_COMPATIBLE_ENDPOINT missing

# after
TTS_PROVIDER=generic-openai
TTS_OPEN_AI_COMPATIBLE_ENDPOINT=http://localhost:8080/v1
TTS_OPEN_AI_COMPATIBLE_KEY=optional
Defensive patterns

Strategy: validation

Validate before calling

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

Try / catch

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

Prevention

When it happens

Trigger: TTS_PROVIDER=generic-openai is set but TTS_OPEN_AI_COMPATIBLE_ENDPOINT is missing/empty; only the key/voice were set; the var was renamed.

Common situations: Self-hosted OpenAI-compatible TTS server (kokoro, vLLM, LocalAI) 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/32e89a87a94bbe5c. Report an issue: GitHub.