{"record":{"id":"32e89a87a94bbe5c","repo":"Mintplex-Labs/anything-llm","slug":"no-openai-compatible-endpoint-was-set-please-set-32e89a","errorCode":null,"errorMessage":"No OpenAI compatible endpoint was set. Please set this to use your OpenAI compatible TTS service.","messagePattern":"No OpenAI compatible endpoint was set\\. Please set this to use your OpenAI compatible TTS service\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/TextToSpeech/openAiGeneric/index.js","lineNumber":16,"sourceCode":"class GenericOpenAiTTS {\n  constructor() {\n    if (!process.env.TTS_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 TTS service.\"\n      );\n    if (!process.env.TTS_OPEN_AI_COMPATIBLE_MODEL)\n      this.#log(\n        \"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.\"\n      );\n    if (!process.env.TTS_OPEN_AI_COMPATIBLE_VOICE_MODEL)\n      this.#log(\n        \"No OpenAI compatible voice model was set. We will use the default voice model 'alloy'. This may not exist for your selected endpoint.\"\n      );\n    if (!process.env.TTS_OPEN_AI_COMPATIBLE_ENDPOINT)\n      throw new Error(\n        \"No OpenAI compatible endpoint was set. Please set this to use your OpenAI compatible TTS service.\"\n      );\n\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    this.openai = new OpenAIApi({\n      apiKey: process.env.TTS_OPEN_AI_COMPATIBLE_KEY || null,\n      baseURL: process.env.TTS_OPEN_AI_COMPATIBLE_ENDPOINT,\n    });\n    this.model = process.env.TTS_OPEN_AI_COMPATIBLE_MODEL ?? \"tts-1\";\n    this.voice = process.env.TTS_OPEN_AI_COMPATIBLE_VOICE_MODEL ?? \"alloy\";\n    this.#log(\n      `Service (${process.env.TTS_OPEN_AI_COMPATIBLE_ENDPOINT}) with model: ${this.model} and voice: ${this.voice}`\n    );\n  }\n\n  #log(text, ...args) {\n    console.log(`\\x1b[32m[OpenAiGenericTTS]\\x1b[0m ${text}`, ...args);\n  }","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/TextToSpeech/openAiGeneric/index.js#L1-L34","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add TTS_OPEN_AI_COMPATIBLE_ENDPOINT=<base-url> to .env and restart.","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.","Verify the endpoint exposes an OpenAI-compatible /audio/speech route.","In Docker, pass the variable to the container."],"exampleFix":"# before\nTTS_PROVIDER=generic-openai\n# TTS_OPEN_AI_COMPATIBLE_ENDPOINT missing\n\n# after\nTTS_PROVIDER=generic-openai\nTTS_OPEN_AI_COMPATIBLE_ENDPOINT=http://localhost:8080/v1\nTTS_OPEN_AI_COMPATIBLE_KEY=optional","handlingStrategy":"validation","validationCode":"if (\n  process.env.TTS_PROVIDER === \"generic-openai\" &&\n  !process.env.TTS_OPEN_AI_COMPATIBLE_ENDPOINT\n) {\n  throw new Error(\n    \"TTS_PROVIDER is 'generic-openai' but TTS_OPEN_AI_COMPATIBLE_ENDPOINT is not set.\"\n  );\n}","typeGuard":null,"tryCatchPattern":"try {\n  return new GenericOpenAiTTS();\n} catch (e) {\n  if (/No OpenAI compatible endpoint/i.test(e.message)) {\n    logger.error(\"Set TTS_OPEN_AI_COMPATIBLE_ENDPOINT to your compatible TTS base URL, then restart.\");\n  }\n  throw e;\n}","preventionTips":["Only the endpoint is mandatory; set key/model/voice when your server needs them.","Confirm the endpoint serves an OpenAI-compatible /audio/speech route.","Restart after editing .env."],"tags":["tts","openai-compatible","configuration","environment","provider-selection"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}