danny-avila/LibreChat · error
Configuration or TTS schema is missing
Error message
Configuration or TTS schema is missing
What it means
The getVoices endpoint guard: after resolving appConfig it checks appConfig.speech.tts and throws this distinct message before delegating to TTSService.getProvider. It exists so the endpoint can return a 500 with a clear cause rather than the underlying 'No TTS schema' text. Same root cause as the TTSService schema-missing error but surfaced at the route layer.
Source
Thrown at api/server/services/Files/Audio/getVoices.js:27
*
* @param {Object} req - The request object
* @param {Object} res - The response object
* @returns {Promise<void>}
* @throws {Error} - If the provider is not 'openai' or 'elevenlabs', an error is thrown
*/
async function getVoices(req, res) {
try {
const appConfig =
req.config ??
(await getAppConfig({
role: req.user?.role,
userId: req.user?.id,
tenantId: req.user?.tenantId,
}));
const ttsSchema = appConfig?.speech?.tts;
if (!ttsSchema) {
throw new Error('Configuration or TTS schema is missing');
}
const provider = await getProvider(appConfig);
let voices;
switch (provider) {
case TTSProviders.OPENAI:
voices = ttsSchema.openai?.voices;
break;
case TTSProviders.AZURE_OPENAI:
voices = ttsSchema.azureOpenAI?.voices;
break;
case TTSProviders.ELEVENLABS:
voices = ttsSchema.elevenlabs?.voices;
break;
case TTSProviders.LOCALAI:
voices = ttsSchema.localai?.voices;
break;View on GitHub (pinned to 5ff282f900)
Solutions
- Configure a `speech.tts` block with one populated provider in librechat.yaml.
- Verify the config file is mounted and loaded (startup log).
- Restart the API server; re-request /api/voices.
Example fix
# before
speech: {}
# after
speech:
tts:
openai:
apiKey: '${TTS_API_KEY}'
voices: ['alloy', 'echo'] Defensive patterns
Strategy: validation
Validate before calling
const tts = appConfig?.speech?.tts;
if (!tts) {
return res.status(503).json({ error: 'TTS is not configured on this server.' });
} Type guard
/** @param {unknown} c */
function hasTtsSchema(c) {
return !!c && typeof c === 'object' && 'speech' in c
&& !!c.speech && typeof c.speech === 'object'
&& 'tts' in c.speech && !!c.speech.tts && typeof c.speech.tts === 'object';
} Prevention
- Gate the /api/voices route on the presence of speech.tts and return a 503 instead of letting it throw.
- Mount and validate librechat.yaml at startup.
- Hide the voice picker in the client when TTS is unconfigured.
When it happens
Trigger: GET /api/voices when librechat.yaml has no `speech.tts` section, or role/tenant-scoped config returns an object whose `speech.tts` is falsy.
Common situations: Client renders a voice picker before any TTS provider is configured; librechat.yaml not mounted; tenant override returns empty speech.
Related errors
- No TTS schema is set. Did you configure TTS in the custom co
- Invalid provider
- No STT schema is set. Did you configure STT in the custom co
- Multiple providers are set. Please set only one provider.
- No provider is set. Please set a provider.
AI-assisted analysis of danny-avila/LibreChat@5ff282f900 (2026-08-12).
Data as JSON: /api/errors/2d5399e3d2c78931.
Report an issue: GitHub.