{"record":{"id":"eaad8f2831570a49","repo":"HeyPuter/puter","slug":"field-invalid-eaad8f","errorCode":"field_invalid","errorMessage":"Invalid model: ${model}. Expected: ${OPENAI_TTS_MODELS.map(({ id }) => id).join(', ')}","messagePattern":"Invalid model: (.+?)\\. Expected: (.+?)\\) => id\\)\\.join\\(', '\\)\\}","errorType":"validation","errorClass":"HttpError","httpStatus":400,"severity":"error","filePath":"src/backend/drivers/ai-tts/providers/openai/OpenAITTSProvider.ts","lineNumber":146,"sourceCode":"            response_format,\n            instructions,\n            test_mode,\n        } = args;\n\n        if (test_mode) {\n            return { url: SAMPLE_AUDIO_URL, content_type: 'audio' };\n        }\n\n        if (typeof text !== 'string' || text.trim() === '') {\n            throw new HttpError(400, 'Missing required field: text', {\n                legacyCode: 'field_required',\n                fields: { key: 'text' },\n            });\n        }\n\n        const model = modelArg || DEFAULT_MODEL;\n        if (!OPENAI_TTS_MODELS.find(({ id }) => id === model)) {\n            throw new HttpError(\n                400,\n                `Invalid model: ${model}. Expected: ${OPENAI_TTS_MODELS.map(({ id }) => id).join(', ')}`,\n                {\n                    legacyCode: 'field_invalid',\n                    fields: {\n                        key: 'model',\n                        expected: OPENAI_TTS_MODELS.map(({ id }) => id).join(\n                            ', ',\n                        ),\n                        got: model,\n                    },\n                },\n            );\n        }\n\n        const voice = voiceArg || DEFAULT_VOICE;\n        if (!OPENAI_TTS_VOICES.find(({ id }) => id === voice)) {\n            throw new HttpError(","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/HeyPuter/puter/blob/908ec23eda38526170322c3edf71ba45ecb1ca95/src/backend/drivers/ai-tts/providers/openai/OpenAITTSProvider.ts#L128-L164","documentation":"Error \"Invalid model: ${model}. Expected: ${OPENAI_TTS_MODELS.map(({ id }) => id).join(', ')}\" thrown in HeyPuter/puter.","triggerScenarios":"Thrown at src/backend/drivers/ai-tts/providers/openai/OpenAITTSProvider.ts:146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the supported OpenAI TTS models listed in the error message.","Check OPENAI_TTS_MODELS for the valid model ids and update the `model` parameter."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"908ec23eda38526170322c3edf71ba45ecb1ca95","analyzedAt":"2026-08-12T20:53:15.911Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}