{"record":{"id":"fc8908ef132742cc","repo":"Mintplex-Labs/anything-llm","slug":"minimax-api-key-must-be-provided-to-use-agents","errorCode":null,"errorMessage":"Minimax API key must be provided to use agents.","messagePattern":"Minimax API key must be provided to use agents\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/index.js","lineNumber":289,"sourceCode":"          throw new Error(\n            \"Privatemode base path must be provided to use agents.\"\n          );\n        break;\n      case \"sambanova\":\n        if (!process.env.SAMBANOVA_LLM_API_KEY)\n          throw new Error(\"SambaNova API key must be provided to use agents.\");\n        break;\n      case \"lemonade\":\n        if (!process.env.LEMONADE_LLM_BASE_PATH)\n          throw new Error(\"Lemonade base path must be provided to use agents.\");\n        break;\n      case \"omlx\":\n        if (!process.env.OMLX_LLM_BASE_PATH)\n          throw new Error(\"OMLX base path must be provided to use agents.\");\n        break;\n      case \"minimax\":\n        if (!process.env.MINIMAX_API_KEY)\n          throw new Error(\"Minimax API key must be provided to use agents.\");\n        break;\n      case \"cerebras\":\n        if (!process.env.CEREBRAS_API_KEY)\n          throw new Error(\"Cerebras API key must be provided to use agents.\");\n        break;\n      default:\n        throw new Error(\n          \"No workspace agent provider set. Please set your agent provider in the workspace's settings\"\n        );\n    }\n  }\n\n  /**\n   * Finds the default model for a given provider. If no default model is set for it's associated ENV then\n   * it will return a reasonable base model for the provider if one exists.\n   * @param {string} provider - The provider to find the default model for.\n   * @returns {string|null} The default model for the provider.\n   */","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/index.js#L271-L307","documentation":"Thrown by checkSetup() (server/utils/agents/index.js:128) when the resolved agent provider is 'minimax' but process.env.MINIMAX_API_KEY is unset/empty. It is a precondition gate in agent.init() ensuring the Minimax client is never built without an API key.","triggerScenarios":"A chat turn calls agent.init(); this.provider resolves to 'minimax'; case 'minimax' runs and process.env.MINIMAX_API_KEY is falsy.","commonSituations":"Minimax selected as agent provider but the key was not saved; key expired/rotated; server not restarted after .env change.","solutions":["Set MINIMAX_API_KEY in .env to a valid Minimax key and restart the server.","Verify the process loaded the key via a status probe.","Switch provider if Minimax is not intended."],"exampleFix":"// before (.env)\nMINIMAX_API_KEY=\n// after (.env)\nMINIMAX_API_KEY=<your-minimax-key>","handlingStrategy":"validation","validationCode":"function assertMinimaxReady(workspaceAgentProvider) {\n  const using = workspaceAgentProvider === 'minimax' || process.env.LLM_PROVIDER === 'minimax';\n  if (using && !process.env.MINIMAX_API_KEY)\n    throw new Error('MINIMAX_API_KEY missing - set it before starting an agent.');\n}","typeGuard":null,"tryCatchPattern":"try { await agent.init(); } catch (e) { if (/Minimax API key must be provided/.test(e.message)) return showProviderConfig('minimax'); throw e; }","preventionTips":["Treat API keys as required boot dependencies for their provider.","Restart after .env edits.","Probe key presence (not value) at startup."],"tags":["config","env","agent-provider","minimax","api-key","agents"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}