{"record":{"id":"16081e819b192ae8","repo":"RocketChat/Rocket.Chat","slug":"error-ai-provider-not-configured","errorCode":"error-ai-provider-not-configured","errorMessage":"error-ai-provider-not-configured","messagePattern":"error-ai-provider-not-configured","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/api/v1/ai-search.ts","lineNumber":377,"sourceCode":"\t\t) {\n\t\t\tthrow new Meteor.Error('error-ai-not-enabled');\n\t\t}\n\n\t\tconst answerMessages = await getSearchAnswerMessagesForUser(this.userId, messages);\n\t\ttry {\n\t\t\tconst answer = await AISearch.answer({\n\t\t\t\tquery,\n\t\t\t\tmessages: answerMessages,\n\t\t\t});\n\n\t\t\treturn API.v1.success(answer);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : '';\n\t\t\tif (message === 'error-ai-not-enabled') {\n\t\t\t\tthrow new Meteor.Error('error-ai-not-enabled');\n\t\t\t}\n\t\t\tif (message === 'error-ai-provider-not-configured') {\n\t\t\t\tthrow new Meteor.Error('error-ai-provider-not-configured');\n\t\t\t}\n\t\t\tif (message === 'error-ai-provider-empty-response') {\n\t\t\t\tthrow new Meteor.Error('error-ai-provider-empty-response');\n\t\t\t}\n\t\t\tthrow new Meteor.Error('error-ai-provider-request-failed');\n\t\t}\n\t},\n);\n","sourceCodeStart":359,"sourceCodeEnd":386,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/api/v1/ai-search.ts#L359-L386","documentation":"Returned by POST ai.search.answer when the underlying AISearch.answer() call throws error-ai-provider-not-configured: the workspace selected an LLM provider for answer generation but the provider's credentials/settings are incomplete, so no request could be sent. The endpoint maps the service error one-to-one so clients can distinguish configuration problems from transport failures.","triggerScenarios":"POST /api/v1/ai.search.answer after an admin selected a provider (e.g. OpenAI-compatible or self-hosted gateway) but left the API key, base URL, or model field empty; or the stored provider config was invalidated.","commonSituations":"Provider selected but API key never saved; key rotated and the old one removed from settings; migrating workspaces where the provider reference exists but its secret did not carry over.","solutions":["Open Administration > AI and complete the answer-generation provider setup (provider, API key, base URL, model)","Validate the configuration with GET ai.llm.models, which lists models reachable through the configured provider","Save settings and retry the answer request"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const models = await GET('/api/v1/ai.llm.models');\nif (!models || models.length === 0) throw new Error('Answer provider not configured');","typeGuard":null,"tryCatchPattern":"try { /* ai.search.answer */ } catch (e) {\n  if (e.error === 'error-ai-provider-not-configured') { /* surface admin setup required */ }\n}","preventionTips":["Probe ai.llm.models at integration setup time to catch missing provider config early","Fail CI smoke tests when the provider returns no models"],"tags":["ai-search","configuration","provider-setup","rocket-chat"],"backgroundTag":"ai-provider-not-configured","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}